<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/118795/">https://git.reviewboard.kde.org/r/118795/</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.</div>
<div>By Denis Steckelmacher.</div>


<p style="color: grey;"><i>Updated June 17, 2014, 2:55 p.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;">Diff generated with -M80. It weights 583K instead of 2.1M.</pre>
  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdev-qmljs
</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 patch is huge (2.1 MB!), but the code changes are not that big. This patch comes from two problems that the QML/JS plugin had:

* The version given in QML import statements was not used to find the correct module. An user importing QtQuick 2.0 was therefore able to see components that only appeared in QtQuick 2.1 or 2.2.
* The dependencies of the modules were a bit broken. Builtins1.qml and Builtins2.qml were "built-in" types for QtQuick 2.0 and QtQuick 1.0 respectively (not the inversion :-) ), and several modules happily depended on both files. This yielded duplicate components (Item is declared in Builtins2.qml, Builtins1.qml and QtQuick.qml that was exactly the same file as Builtins1.qml) and slowed down the parsing of the modules.

Now, the idea is to have one file per module and per version. There is therefore 5 files for QtQuick : QtQuick_1.0.qml, QtQuick_1.1.qml, QtQuick_2.0.qml, QtQuick_2.1.qml and QtQuick_2.2.qml. When the user imports a module X with a version Y, the file X_Y.qml is imported. In order to keep things simple, every file sharing the same major number (1 or 2) is exactly the same. DeclarationBuilder, when asked to parse a module file having a version X.Y, ensures that only the components having exactly the version X.Y are parsed. The others are skipped in a very fast fashion (visit() returns false and no declaration is opened). When a new Qt version comes out, updating QML/JS is as simple as running qmlplugindump and to overwrite QtQuick_2.*.qml with the output. The dump contains every declaration with the versions in which they appeared. No need to run a Python script or something like that to postprocess the dumps.

The user is now able to import QtQuick 2.1, that imports QtQuick 2.0, and can see every component that exists in QtQuick 2.1 or 2.0. The components of QtQuick 2.2 are still hidden, though. Moreover, extra modules like QtQuick.Dialog, QtQuick.Controls, etc, depend on the exact QtQuick version they require. For instance, QtQuick.Dialog depends on QtQuick 2.0 while Qt.labs.shaders depends on QtQuick 1.0.

The dependency tree of the modules is now really a tree. This avoids duplicate declarations (each declaration lives in exactly one module and one version), and greatly speeds up the parsing of module files. Filetest now takes 0.90 seconds on my computer, instead of 1.90 before this patch.

I understand that this patch is fairly complex, so take your time reviewing it :-). I've several exams at the end of this week and not much time to push this stuff, so nothing requires your immediate attention.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">Two new tests are added: one ensures that the OpacityAnimator declaration exists in QtQuick 2.2, and the other ensures that OpacityAnimator doesn't exist in QtQuick 2.0 (this declaration has been introduced in QtQuick 2.2). All the other tests still pass.</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>duchain/parsesession.cpp <span style="color: grey">(9ef32a0)</span></li>

 <li>duchain/declarationbuilder.cpp <span style="color: grey">(d0f8772)</span></li>

 <li>duchain/declarationbuilder.h <span style="color: grey">(dc132d9)</span></li>

 <li>codecompletion/tests/qmlcompletiontest.cpp <span style="color: grey">(cef0254)</span></li>

 <li>qmlplugins/Builtins1.qml <span style="color: grey">(6677c03)</span></li>

 <li>qmlplugins/Builtins2.qml <span style="color: grey">(6672239)</span></li>

 <li>qmlplugins/Qt.labs.folderlistmodel.qml <span style="color: grey">(ee1e58e)</span></li>

 <li>qmlplugins/Qt.labs.gestures.qml <span style="color: grey">(675eeb1)</span></li>

 <li>qmlplugins/Qt.labs.particles.qml <span style="color: grey">(9150529)</span></li>

 <li>qmlplugins/Qt.labs.settings.qml <span style="color: grey">(e3cc0f7)</span></li>

 <li>qmlplugins/Qt.labs.shaders.qml <span style="color: grey">(d357277)</span></li>

 <li>qmlplugins/QtAudioEngine.qml <span style="color: grey">(1416717)</span></li>

 <li>qmlplugins/QtBluetooth.qml <span style="color: grey">(9cef5cb)</span></li>

 <li>qmlplugins/QtBluetooth_5.2.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtMultimedia.qml <span style="color: grey">(0dbf3b7)</span></li>

 <li>qmlplugins/QtNfc.qml <span style="color: grey">(e49a811)</span></li>

 <li>qmlplugins/QtNfc_5.2.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtPositioning.qml <span style="color: grey">(30b203f)</span></li>

 <li>qmlplugins/QtPositioning_5.2.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtQuick.Controls.qml <span style="color: grey">(6045273)</span></li>

 <li>qmlplugins/QtQuick.Controls_1.1.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtQuick.Dialogs.qml <span style="color: grey">(5541c5c)</span></li>

 <li>qmlplugins/QtQuick.Dialogs_1.1.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtQuick.Layouts.qml <span style="color: grey">(2263401)</span></li>

 <li>qmlplugins/QtQuick.LocalStorage.qml <span style="color: grey">(cbf8a4d)</span></li>

 <li>qmlplugins/QtQuick.Particles.qml <span style="color: grey">(711c7a2)</span></li>

 <li>qmlplugins/QtQuick.PrivateWidgets.qml <span style="color: grey">(9947c2b)</span></li>

 <li>qmlplugins/QtQuick.PrivateWidgets_1.1.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtQuick.Window.qml <span style="color: grey">(302e27c)</span></li>

 <li>qmlplugins/QtQuick.Window_2.1.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtQuick.XmlListModel.qml <span style="color: grey">(7e24088)</span></li>

 <li>qmlplugins/QtQuick.qml <span style="color: grey">(e00676d)</span></li>

 <li>qmlplugins/QtQuick_2.1.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtQuick_2.2.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtSensors.qml <span style="color: grey">(ada6d52)</span></li>

 <li>qmlplugins/QtSensors_5.1.qml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>qmlplugins/QtTest.qml <span style="color: grey">(3a0e449)</span></li>

 <li>qmlplugins/makedeps.sh <span style="color: grey">(7723c94)</span></li>

 <li>tests/files/test.qml <span style="color: grey">(86e55d1)</span></li>

</ul>

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







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




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