<table><tr><td style="">dfaure updated this revision to Diff 73858.<br />dfaure retitled this revision from "New class KApplicationTrader, to replace KMimeTypeTrader and KServiceTypeTrader" to "New query mechanism for applications: KApplicationTrader".<br />dfaure edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-kerbwtvrdjini3j/">(Show Details)</a><br />dfaure edited the test plan for this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-jknkni6dvbo2ro2/">(Show Details)</a><br />dfaure added reviewers: aacid, davidedmundson.<br />dfaure removed subscribers: aacid, dhaumann.<br />dfaure added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D25698">View Revision</a></tr></table><br /><div><div><p>Integrate isSubsequence, fix docu, reword commit log</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">The old t</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">KMimeTypeTrader and KServiceTypeT</span>rader<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">s</span> could lookup both applications and<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> plugins, but plugins</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">should nowadays be loaded via their JSON file</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">plugins</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">no desktop-file trader</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">but plugins should nowadays be loaded via their JSON file</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">(KPluginLoader), no desktop-file trader </span>needed anymore.<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> Except maybe for non-C++ plugins?</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">To</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">KApplicationTrader</span> get<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">s</span> rid of plugins and servicetypes from the API<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">, and keep<br />
only the application-lookup-related code</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">the older traders will be<br />
deprecated and their users should either switch to JSON for plugins (KPluginLoader)</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">in</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">or KApplicationTrader for</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">order to keep only the API to look up</span> application desktop files.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">One API question remains:</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The trader query language is no longer used, as discussed on</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> KApplicationTrader::self()->query("...") like the old traders</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">kde-frameworks-devel; instead we use a std::function for filtering</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">or</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">like</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> KApplicationTrader::query("...") (static methods only, or making it a namespace, a bit procedural rather than OO)</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">KPluginLoader.<br />
<br />
This commit also adds KApplicationTrader::isSubsequence</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">or</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">necessary to</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> KApplicationTrader().query("...") like QMimeDatabase/QFontDatabase (but with default ctors for performance) ?</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">replace the subseq operator of the trader query language.</span></div></div></div><br /><div><strong>CHANGES TO TEST PLAN</strong><div><div style="white-space: pre-wrap; color: #74777D;">New unittest (<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">part</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">initial</span>ly based on kservicete<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">st</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">st, simplified, ported<br />
to lambdas</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">but simplified and added</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">and with some</span> new types of checks) passes</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R309 KService</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D25698?vs=73800&id=73858">https://phabricator.kde.org/D25698?vs=73800&id=73858</a></div></div><br /><div><strong>BRANCH</strong><div><div>kapplicationtrader</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25698">https://phabricator.kde.org/D25698</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/CMakeLists.txt<br />
autotests/kapplicationtradertest.cpp<br />
autotests/kservicetest.cpp<br />
src/CMakeLists.txt<br />
src/services/kapplicationtrader.cpp<br />
src/services/kapplicationtrader.h<br />
src/services/kmimetypetrader.cpp<br />
src/services/kservicefactory.cpp<br />
src/services/kservicefactory_p.h<br />
src/services/ktraderparsetree.cpp<br />
src/services/ktraderparsetree_p.h<br />
src/sycoca/ksycocaentry.h</div></div></div><br /><div><strong>To: </strong>dfaure, broulik, mart, vkrause, nicolasfella, aacid, davidedmundson<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns, dhaumann<br /></div>