I accidentally replied to Sebastian instead of the nepomuk mailing list. So I&#39;m copy-pasting the conversation we had. I&#39;ve written more stuff in the end.<br><br><div class="gmail_quote">On Sun, Apr 11, 2010 at 6:29 PM, Vishesh Handa <span dir="ltr">&lt;<a href="mailto:handa.vish@gmail.com">handa.vish@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br><div class="gmail_quote"><div class="im">On Sat, Apr 10, 2010 at 1:59 PM, Sebastian Trüg <span dir="ltr">&lt;<a href="mailto:trueg@kde.org" target="_blank">trueg@kde.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
One comment though: for empty strings you should rather use QString()<br>
than QLatin1String(&quot;&quot;).<br></blockquote></div><div><br>Thanks for the heads up!<br><br>I tested the query service, and it works perfectly, BUT it only works with QString() and not with QLatin1String(&quot;&quot;). I want to know what the difference is, so I&#39;ll investigate more when I have the time!<br>

<br>The kded patch works according to your instructions, but I&#39;m still not totally convinced! :-/ For one it gave this output when I SIGTERM or KILL it -<br><div style="margin-left: 40px;">[/home/vishesh/kde/bin/nepomukservicestub] nepomukstrigiservice(5970)/nepomuk (strigi service) Nepomuk::IndexScheduler::setIndexingSpeed: 1 ReducedSpeed<br>

[/home/vishesh/kde/bin/nepomukservicestub] nepomukqueryservice(5972)/nepomuk (query service) Nepomuk::Query::FolderConnection::close:<br>nepomukqueryservice(5972)/nepomuk (query service) Nepomuk::Query::Folder::removeConnection: Folder unused. Deleting.<br>

nepomukqueryservice(5972)/nepomuk (query service) Nepomuk::Query::QueryService::slotFolderConnectionDestroyed: QObject(0x984dff0)<br>nepomukqueryservice(5972)/nepomuk (query service) Nepomuk::Query::QueryService::slotFolderDestroyed: QObject(0x97e8330)<br>

</div><br>and when I tried to manually kill the normal <b><i>kded4</i></b> module and start the trunk kded4, the DBus kded /modules/nepomuksearchmodule wasn&#39;t registered, and I couldn&#39;t check by adding debug statements. If you feel it&#39;s okay, please commit the patch. However I would like to run more tests (just to be sure!)<br>

<br>When I test my code I generally add kDebug() statements, and remove them when creating a patch. Should I remove them or keep them, in future patches?<br><br>Thanks<br><br>- Vishesh Handa<br><br></div></div></blockquote>
<div><br><br><div class="gmail_quote">On Mon, Apr 12, 2010 at 1:16 AM, 
Sebastian Trüg <span dir="ltr">&lt;<a href="mailto:trueg@kde.org">trueg@kde.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Vishesh,<br>
<div class="im"><br>
On 04/11/2010 02:59 PM, Vishesh Handa wrote:<br>
&gt; I tested the query service, and it works perfectly, BUT it only 
works<br>
&gt; with QString() and not with QLatin1String(&quot;&quot;). I want to know what 
the<br>
&gt; difference is, so I&#39;ll investigate more when I have the time!<br>
<br>
</div>Hm, the only difference I can see is that maybe QString() gives a 
null<br>
string (QString::isNull()) while QLatin1String(&quot;&quot;) only gives an empty<br>
one but non-null.<br>
<div class="im"><br>
&gt; The kded patch works according to your instructions, but I&#39;m still 
not<br>
&gt; totally convinced! :-/ For one it gave this output when I SIGTERM 
or<br>
&gt; KILL it -<br>
&gt; [/home/vishesh/kde/bin/nepomukservicestub]<br>
&gt; nepomukstrigiservice(5970)/nepomuk (strigi service)<br>
&gt; Nepomuk::IndexScheduler::setIndexingSpeed: 1 ReducedSpeed<br>
&gt; [/home/vishesh/kde/bin/nepomukservicestub]<br>
&gt; nepomukqueryservice(5972)/nepomuk (query service)<br>
&gt; Nepomuk::Query::FolderConnection::close:<br>
&gt; nepomukqueryservice(5972)/nepomuk (query service)<br>
&gt; Nepomuk::Query::Folder::removeConnection: Folder unused. 
Deleting.<br>
&gt; nepomukqueryservice(5972)/nepomuk (query service)<br>
&gt; Nepomuk::Query::QueryService::slotFolderConnectionDestroyed:<br>
&gt; QObject(0x984dff0)<br>
&gt; nepomukqueryservice(5972)/nepomuk (query service)<br>
&gt; Nepomuk::Query::QueryService::slotFolderDestroyed: 
QObject(0x97e8330)<br>
<br>
</div>This is normal output from the query service. As soon as the 
search kded<br>
module goes down all the searches it was watching (to emit KDirNotify<br>
signals in case search results change) are unregistered from the query<br>
service.<br>
<div class="im"><br>
&gt; and when I tried to manually kill the normal */kded4/* module and 
start<br>
&gt; the trunk kded4, the DBus kded /modules/nepomuksearchmodule wasn&#39;t<br>
&gt; registered, and I couldn&#39;t check by adding debug statements. If you
 feel<br>
&gt; it&#39;s okay, please commit the patch. However I would like to run 
more<br>
&gt; tests (just to be sure!)<br>
<br>
</div>This is because kded4 has 2 initialization steps. Normally 
startkde<br>
takes care of calling the second one. But if you start it manually you<br>
also need to start the second phase manually:<br>
<br>
qdbus org.kde.kded /kded org.kde.kded.loadSecondPhase<br>
<div class="im"><br>
&gt; When I test my code I generally add kDebug() statements, and remove
 them<br>
&gt; when creating a patch. Should I remove them or keep them, in future
 patches?<br>
<br>
</div>This is not easy to answer. I personally try to keep as many of 
them as<br>
possible for easy debugging at later stages. But having too many debug<br>
outputs can flood the terminal and even slow down apps. So in the end it<br>
is a judgment call and needs to be decided on a case-by-case basis.<br>
<br>
Cheers,<br>
<font color="#888888">Sebastian<br>
</font></blockquote></div><br>I&#39;ve tested it out and it works fine. However I changed the code a little bit. I&#39;ve added the <i>m_watcher-&gt;removeWatchedService( message().service() );</i> to the slotServiceUnregistered function instead of the <i>unregisterSearchUrl</i> function. It seems better this way.<br>
<br>Please commit the patches. :-) And, Sebastian, thanks for excellent instructions! I&#39;ll do the rest later (I will do them! I call dibs.)<br><br>Thanks<br><br>- Vishesh Handa<br><br><br></div></div><br>