I accidentally replied to Sebastian instead of the nepomuk mailing list. So I'm copy-pasting the conversation we had. I'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"><<a href="mailto:handa.vish@gmail.com">handa.vish@gmail.com</a>></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"><<a href="mailto:trueg@kde.org" target="_blank">trueg@kde.org</a>></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("").<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(""). I want to know what the difference is, so I'll investigate more when I have the time!<br>
<br>The kded patch works according to your instructions, but I'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't registered, and I couldn't check by adding debug statements. If you feel it'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"><<a href="mailto:trueg@kde.org">trueg@kde.org</a>></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>
> I tested the query service, and it works perfectly, BUT it only
works<br>
> with QString() and not with QLatin1String(""). I want to know what
the<br>
> difference is, so I'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("") only gives an empty<br>
one but non-null.<br>
<div class="im"><br>
> The kded patch works according to your instructions, but I'm still
not<br>
> totally convinced! :-/ For one it gave this output when I SIGTERM
or<br>
> KILL it -<br>
> [/home/vishesh/kde/bin/nepomukservicestub]<br>
> nepomukstrigiservice(5970)/nepomuk (strigi service)<br>
> Nepomuk::IndexScheduler::setIndexingSpeed: 1 ReducedSpeed<br>
> [/home/vishesh/kde/bin/nepomukservicestub]<br>
> nepomukqueryservice(5972)/nepomuk (query service)<br>
> Nepomuk::Query::FolderConnection::close:<br>
> nepomukqueryservice(5972)/nepomuk (query service)<br>
> Nepomuk::Query::Folder::removeConnection: Folder unused.
Deleting.<br>
> nepomukqueryservice(5972)/nepomuk (query service)<br>
> Nepomuk::Query::QueryService::slotFolderConnectionDestroyed:<br>
> QObject(0x984dff0)<br>
> nepomukqueryservice(5972)/nepomuk (query service)<br>
> 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>
> and when I tried to manually kill the normal */kded4/* module and
start<br>
> the trunk kded4, the DBus kded /modules/nepomuksearchmodule wasn't<br>
> registered, and I couldn't check by adding debug statements. If you
feel<br>
> it's okay, please commit the patch. However I would like to run
more<br>
> 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>
> When I test my code I generally add kDebug() statements, and remove
them<br>
> 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've tested it out and it works fine. However I changed the code a little bit. I've added the <i>m_watcher->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'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>