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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 11th, 2015, 1:03 a.m. UTC, <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Can you explain to me what the patch really changes? AFAICS this is a no-op. The same logic with a different syntax.</p></pre>
 </blockquote>




 <p>On January 11th, 2015, 9:25 a.m. UTC, <b>Alex Merry</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Lazy evaluation of || means that if KSycoca::isAvailable() returns false, KServiceType::serviceType("FakePluginType") is never called.</p></pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Incidentally, I started with a form where it was possibly more clear what is going on, but it just looks stupid - an <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">if</code> and an <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">else</code> branch containing only an <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">if</code> is normally written as an <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">if</code> followed by an <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">else if</code>, but in this case both branches have the same body.</p></pre>
<br />










<p>- Alex</p>


<br />
<p>On January 10th, 2015, 7:42 p.m. UTC, Alex Merry wrote:</p>









<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Frameworks and David Faure.</div>
<div>By Alex Merry.</div>


<p style="color: grey;"><i>Updated Jan. 10, 2015, 7:42 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kservice
</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Using KServiceType::serviceType when the sycoca database does not yet
exist can lead to an assert in the KServiceTypeFactory constructor being
called, meaning we never get to the line where we rebuild sycoca.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">rm -rf ~/.qttest; ./ksycocadicttest</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Without this patch, this fails with:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #666666">*********</span> Start testing of KSycocaDictTest <span style="color: #666666">*********</span>
<span style="color: #A0A000">Config:</span> Using QtTest library <span style="color: #666666">5.4.0</span>, Qt <span style="color: #666666">5.4.0</span> (x86_64<span style="color: #666666">-</span>little_endian<span style="color: #666666">-</span>lp64 shared (dynamic) release build; by GCC <span style="color: #666666">4.9.2</span>)
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>openDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open ksycoca from <span style="color: #BA2121">"/home/kde-devel/.qttest/cache/ksycoca5"</span>
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>openDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open global ksycoca from  <span style="color: #BA2121">"/home/kde-devel/.qttest/share/kservices5/ksycoca5"</span>
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>openDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open ksycoca from <span style="color: #BA2121">"/home/kde-devel/.qttest/cache/ksycoca5"</span>
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>openDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open global ksycoca from  <span style="color: #BA2121">"/home/kde-devel/.qttest/share/kservices5/ksycoca5"</span>
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>openDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open ksycoca from <span style="color: #BA2121">"/home/kde-devel/.qttest/cache/ksycoca5"</span>
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>openDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open global ksycoca from  <span style="color: #BA2121">"/home/kde-devel/.qttest/share/kservices5/ksycoca5"</span>
QDEBUG <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span style="color: #666666">?</span>[<span style="color: #666666">34</span>mKSycocaPrivate<span style="color: #666666">::</span>checkDatabase<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> Still no database...
QFATAL <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: #666666">3942</span>)<span style="color: #666666">/</span>(<span style="color: #008000; font-weight: bold">default</span>) <span style="color: #666666">?</span>[<span style="color: #666666">31</span>munknown<span style="color: #666666">?</span>[<span style="color: #666666">0</span>m<span style="color: #666666">:</span> ASSERT failure in KServiceTypeFactory<span style="color: #666666">::</span>KServiceTypeFactory()<span style="color: #666666">:</span> <span style="color: #BA2121">"Could not open sycoca database, you must run kbuildsycoca first!"</span>, file <span style="color: #666666">/</span>home<span style="color: #666666">/</span>kde<span style="color: #666666">-</span>devel<span style="color: #666666">/</span>src<span style="color: #666666">/</span>frameworks<span style="color: #666666">/</span>kservice<span style="color: #666666">/</span>src<span style="color: #666666">/</span>services<span style="color: #666666">/</span>kservicetypefactory.cpp, line <span style="color: #666666">38</span>
FAIL<span style="color: #666666">!</span>  <span style="color: #666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() Received a fatal error.
   <span style="color: #A0A000">Loc:</span> [Unknown file(<span style="color: #666666">0</span>)]
<span style="color: #A0A000">Totals:</span> <span style="color: #666666">0</span> passed, <span style="color: #666666">1</span> failed, <span style="color: #666666">0</span> skipped, <span style="color: #666666">0</span> blacklisted
<span style="color: #666666">*********</span> Finished testing of KSycocaDictTest <span style="color: #666666">*********</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">With the patch, it succeeds.</p></pre>
  </td>
 </tr>
</table>


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

 <li>autotests/ksycocadicttest.cpp <span style="color: grey">(cec9eeb9b40d96b42321fe7f50b8a60b0f5b3492)</span></li>

</ul>

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






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








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