<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/115590/">https://git.reviewboard.kde.org/r/115590/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDevelop and Ashwin Rajeev.</div>
<div>By Sven Brauch.</div>


<p style="color: grey;"><i>Updated Feb. 9, 2014, 12:14 a.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">properly save custom items

I sometimes can't believe it's still that much of a hassle in 2014 to save a pair of strings in a config file in C++ ._.</pre>
  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevplatform
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This was more difficult than anticipated, but here it comes ;)

See also discussion here: https://git.reviewboard.kde.org/r/115356/

The basic is to shift the philosophy of source formatters a bit: instead of providing integration with one fixed tool with many slightly different configurations, a Source Formatter plugin can provide an engine for source formatters which can do very different things depending on the configuration. For many languages (I obviously have python in mind) tools already exist which re-format source code and just need to be called. Writing a new formatter plugin for each of those would basically duplicate the existing functionality (especially from the customscript formatter) for each language.

Thus, this patch provides a new virtual function in ILanguageSupport which allows language plugins to return any amount of formatting configurations for any source formatter plugin (the formatter plugin choses which of the items it accepts based on a name).

To make this useful, the mime type and language, and -- optionally -- a text sample different from the default are now stored inside the formatting configuration items. The list of displayed configurations is filtered by language. Only formatting engines which support at least one configuration for a selected language are shown (as before), but this is now "dynamic" and depends on the loaded language plugins (it's no longer hardcoded in the .desktop file).

I didn't yet evaluate creating custom such items, that remains a TODO for the future (it also requires a bit of thinking UI-wise). One step at a time ;)</pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>interfaces/isourceformatter.h <span style="color: grey">(f0ab04c2452d4b9a47311335564c8e932435cde8)</span></li>

 <li>language/interfaces/ilanguagesupport.h <span style="color: grey">(74892d5aa95e1dc18aa72a5ec278f98fb8a415f6)</span></li>

 <li>language/interfaces/ilanguagesupport.cpp <span style="color: grey">(1d50d9495d73603871983b827a0aa29ac0bfde8a)</span></li>

 <li>shell/settings/editstyledialog.cpp <span style="color: grey">(3b019bb4db2f5bdc8ee94fb0f39aec100e26681b)</span></li>

 <li>shell/settings/sourceformattersettings.h <span style="color: grey">(4cb8c48703649201f22e577791a965f2dacade70)</span></li>

 <li>shell/settings/sourceformattersettings.cpp <span style="color: grey">(fda6cde29f55788e7814fd098c58bcf365136f71)</span></li>

 <li>shell/sourceformattercontroller.h <span style="color: grey">(ea6ef555e5965098b3816ad5ff1b817d65480fe6)</span></li>

 <li>shell/sourceformattercontroller.cpp <span style="color: grey">(7b063055b0acfc170eb2025a4253af48154f59ed)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/115590/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>

<ul>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/02/08/2a1a3c51-9ef7-4de4-be24-15ac4d2532c7__python.png">custom script formatter + python</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/02/08/bb2b4080-c712-4cc6-ab36-a0bbbeb1192c__cpp.png">custom script formatter with cpp -- works as before</a></li>

</ul>





  </td>
 </tr>
</table>




  </div>
 </body>
</html>