[Nepomuk] [PATCHES] QDBusServiceWatcher and Strigi

Vishesh Handa handa.vish at gmail.com
Sun Apr 11 22:24:22 CEST 2010


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.

On Sun, Apr 11, 2010 at 6:29 PM, Vishesh Handa <handa.vish at gmail.com> wrote:

>
> On Sat, Apr 10, 2010 at 1:59 PM, Sebastian Trüg <trueg at kde.org> wrote:
>
>> One comment though: for empty strings you should rather use QString()
>> than QLatin1String("").
>>
>
> Thanks for the heads up!
>
> 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!
>
> 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
> -
> [/home/vishesh/kde/bin/nepomukservicestub]
> nepomukstrigiservice(5970)/nepomuk (strigi service)
> Nepomuk::IndexScheduler::setIndexingSpeed: 1 ReducedSpeed
> [/home/vishesh/kde/bin/nepomukservicestub]
> nepomukqueryservice(5972)/nepomuk (query service)
> Nepomuk::Query::FolderConnection::close:
> nepomukqueryservice(5972)/nepomuk (query service)
> Nepomuk::Query::Folder::removeConnection: Folder unused. Deleting.
> nepomukqueryservice(5972)/nepomuk (query service)
> Nepomuk::Query::QueryService::slotFolderConnectionDestroyed:
> QObject(0x984dff0)
> nepomukqueryservice(5972)/nepomuk (query service)
> Nepomuk::Query::QueryService::slotFolderDestroyed: QObject(0x97e8330)
>
> and when I tried to manually kill the normal *kded4* 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!)
>
> 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?
>
> Thanks
>
> - Vishesh Handa
>
>

On Mon, Apr 12, 2010 at 1:16 AM, Sebastian Trüg <trueg at kde.org> wrote:

> Hi Vishesh,
>
> On 04/11/2010 02:59 PM, Vishesh Handa wrote:
> > 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!
>
> Hm, the only difference I can see is that maybe QString() gives a null
> string (QString::isNull()) while QLatin1String("") only gives an empty
> one but non-null.
>
> > 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 -
> > [/home/vishesh/kde/bin/nepomukservicestub]
> > nepomukstrigiservice(5970)/nepomuk (strigi service)
> > Nepomuk::IndexScheduler::setIndexingSpeed: 1 ReducedSpeed
> > [/home/vishesh/kde/bin/nepomukservicestub]
> > nepomukqueryservice(5972)/nepomuk (query service)
> > Nepomuk::Query::FolderConnection::close:
> > nepomukqueryservice(5972)/nepomuk (query service)
> > Nepomuk::Query::Folder::removeConnection: Folder unused. Deleting.
> > nepomukqueryservice(5972)/nepomuk (query service)
> > Nepomuk::Query::QueryService::slotFolderConnectionDestroyed:
> > QObject(0x984dff0)
> > nepomukqueryservice(5972)/nepomuk (query service)
> > Nepomuk::Query::QueryService::slotFolderDestroyed: QObject(0x97e8330)
>
> This is normal output from the query service. As soon as the search kded
> module goes down all the searches it was watching (to emit KDirNotify
> signals in case search results change) are unregistered from the query
> service.
>
> > and when I tried to manually kill the normal */kded4/* 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!)
>
> This is because kded4 has 2 initialization steps. Normally startkde
> takes care of calling the second one. But if you start it manually you
> also need to start the second phase manually:
>
> qdbus org.kde.kded /kded org.kde.kded.loadSecondPhase
>
> > 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?
>
> This is not easy to answer. I personally try to keep as many of them as
> possible for easy debugging at later stages. But having too many debug
> outputs can flood the terminal and even slow down apps. So in the end it
> is a judgment call and needs to be decided on a case-by-case basis.
>
> Cheers,
> Sebastian
>

I've tested it out and it works fine. However I changed the code a little
bit. I've added the *m_watcher->removeWatchedService( message().service() );
* to the slotServiceUnregistered function instead of the *
unregisterSearchUrl* function. It seems better this way.

Please commit the patches. :-) And, Sebastian, thanks for excellent
instructions! I'll do the rest later (I will do them! I call dibs.)

Thanks

- Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100412/6ed40084/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kded_nepomuk.patch
Type: text/x-patch
Size: 3821 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100412/6ed40084/attachment.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: queryservice_patch.diff
Type: text/x-patch
Size: 3688 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100412/6ed40084/attachment.diff 


More information about the Nepomuk mailing list