<table><tr><td style="">apol added inline comments.
</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/D19837">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19837#inline-111500">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KNSBackend.cpp:151</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">auto</span></span><span class="bright"> </span><span class="n"><span class="bright">topLevelName</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span class="n"><span class="bright">knsrcPlasma</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">contains</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">fileName</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">?</span></span><span class="bright"> </span><span class="n"><span class="bright">i18n</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"Plasma Addons"</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">:</span></span><span class="bright"> </span><span class="n"><span class="bright">i18n</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"Application Addons"</span></span><span class="bright"></span><span class="p"><span class="bright">);</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span class="n"><span class="bright">QUrl</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">decoration</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">knsrcPlasma</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">contains</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">fileName</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">?</span></span><span class="bright"> </span><span class="n"><span class="bright">QStringLiteral</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"https://c2.staticflickr.com/4/3148/3042248532_20bd2e38f4_b.jpg"</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">:</span></span><span class="bright"> </span><span class="n"><span class="bright">QStringLiteral</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"https://c2.staticflickr.com/8/7067/6847903539_d9324dcd19_o.jpg"</span></span><span class="bright"></span><span class="p"><span class="bright">))</span>;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="bright"></span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">knsrcApplications</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span class="n"><span class="bright">contains</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">fileName</span></span><span class="bright"></span><span class="p"><span class="bright">))</span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="bright">    </span><span class="n"><span class="bright">m_hasApplications</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #304a96"><span class="bright">true</span></span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">we can just compare with == here, it will be easier to read.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19837#inline-111499">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KNSBackend.cpp:159</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">QStringList</span> <span class="n">tagFilter</span> <span style="color: #aa2211">=</span> <span class="n">m_engine</span><span style="color: #aa2211">-></span><span class="n">tagFilter</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">if</span><span class="p">(</span><span class="n">QSysInfo</span><span style="color: #aa2211">::</span><span class="n">currentCpuArchitecture</span><span class="p">()</span> <span style="color: #aa2211">==</span> <span class="n">QLatin1String</span><span class="p">(</span><span style="color: #766510">"arm"</span><span class="p">))</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">tagFilter</span> <span style="color: #aa2211"><<</span> <span class="n">QLatin1String</span><span class="p">(</span><span style="color: #766510">"application##architecture=armhf"</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I wonder if that's alright, it's very ad-hoc to the opendesktop semantics, isn't it?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19837#inline-111497">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KNSBackend.cpp:186</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">const</span> <span style="color: #aa4000">auto</span> <span class="n">topLevelName</span> <span style="color: #aa2211">=</span> <span class="n">knsrcPlasma</span><span class="p">.</span><span class="n">contains</span><span class="p">(</span><span class="n">fileName</span><span class="p">)</span><span style="color: #aa2211">?</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Plasma Addons"</span><span class="p">)</span> <span style="color: #aa2211">:</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Application Addons"</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">const</span> <span class="n">QUrl</span> <span style="color: #004012">decoration</span><span class="p">(</span><span class="n">knsrcPlasma</span><span class="p">.</span><span class="n">contains</span><span class="p">(</span><span class="n">fileName</span><span class="p">)</span><span style="color: #aa2211">?</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"https://c2.staticflickr.com/4/3148/3042248532_20bd2e38f4_b.jpg"</span><span class="p">)</span> <span style="color: #aa2211">:</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"https://c2.staticflickr.com/8/7067/6847903539_d9324dcd19_o.jpg"</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">auto</span> <span class="n">addonsCategory</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">new</span> <span class="n">Category</span><span class="p">(</span><span class="n">topLevelName</span><span class="p">,</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"plasma"</span><span class="p">),</span> <span class="n">filters</span><span class="p">,</span> <span class="n">backendName</span><span class="p">,</span> <span class="p">{</span><span class="n">actualCategory</span><span class="p">},</span> <span class="n">decoration</span><span class="p">,</span> <span style="color: #304a96">true</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">decoration isn't used anymore, it could make sense to not include it at all over here.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19837#inline-111498">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KNSBackend.cpp:242</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span class="n">KNSResource</span><span style="color: #aa2211">*</span> <span class="n">r</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">static_cast</span><span style="color: #aa2211"><</span><span class="n">KNSResource</span><span style="color: #aa2211">*></span><span class="p">(</span><span class="n">m_resourcesByName</span><span class="p">.</span><span class="n">value</span><span class="p">(</span><span class="n">entry</span><span class="p">.</span><span class="n">uniqueId</span><span class="p">()));</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Unrelated change.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19837#inline-111501">View Inline</a><span style="color: #4b4d51; font-weight: bold;">KNSBackend.cpp:469</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="bright"></span><span style="color: #aa4000"><span class="bright">auto</span></span><span class="bright"> </span><span class="n"><span class="bright">r</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">new</span></span><span class="bright"> </span><span class="n"><span class="bright">ResultsStream</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="n">QString<span class="bright">Literal</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"KNS-search-"</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">+</span></span><span class="bright"></span><span class="n"><span class="bright">name</span></span><span class="bright"></span><span class="p"><span class="bright">());</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="bright"></span><span class="n"><span class="bright">searchStream</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">r</span></span><span class="bright"></span><span class="p"><span class="bright">,</span></span> <span class="n">filter</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">search</span></span><span class="bright"></span><span class="p"><span class="bright">);</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        <span class="bright"></span><span style="color: #aa4000"><span class="bright">return</span></span><span class="bright"> </span><span class="n"><span class="bright">r</span></span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="bright"></span><span style="color: #aa4000"><span class="bright">for</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span class="n">QString<span class="bright"></span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">&</span></span><span class="bright"> </span><span style="color: #a0a000"><span class="bright">category</span></span><span class="bright"> </span><span class="p"><span class="bright">:</span></span><span class="bright"> </span><span class="n"><span class="bright">m_categories</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="bright">    </span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">m_hasApplications</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">||</span></span> <span class="n">filter</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span class="n"><span class="bright">category</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">-></span></span><span class="bright"></span><span class="n"><span class="bright">matchesCategoryName</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">category</span></span><span class="bright"></span><span class="p"><span class="bright">))</span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="bright">        </span><span style="color: #aa4000"><span class="bright">auto</span></span><span class="bright"> </span><span class="n"><span class="bright">r</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">new</span></span><span class="bright"> </span><span class="n"><span class="bright">ResultsStream</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span class="n"><span class="bright">QStringLiteral</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">"KNS-search-"</span></span><span class="bright"></span><span class="p"><span class="bright">)</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">+</span></span><span class="bright"></span><span class="n"><span class="bright">name</span></span><span class="bright"></span><span class="p"><span class="bright">())</span>;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Just use contains?</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R134 Discover Software Store</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19837">https://phabricator.kde.org/D19837</a></div></div><br /><div><strong>To: </strong>leinir, apol, ngraham, Discover Software Store<br /><strong>Cc: </strong>plasma-devel, Discover Software Store, jraleigh, bam, GB_2, ragreen, ixoos, Pitel, ZrenBot, James, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>