Running queries via dbus

Alex Merry kde at randomguy3.me.uk
Tue Mar 23 23:47:43 CET 2010


On Tuesday 23 March 2010 21:55:08 Alex Merry wrote:
> Instead, you should use QDBusConnection::asyncCall.  This can be used in
> exactly the same way (implicit casting FTW), and casting to a QDBusReply
> will cause the calling thread to block as you would expect.  But,
> importantly, it WON'T cause the main thread to block.
> 
> Alternatively, you can pass QDBus::BlockWithGui as an argument to
> QDBusConnection::call.

That's (probably) a lie.  I don't think BlockWithGui will work either.

The issue is that if you use any sort of blocking (the default Block or 
BlockWithGui, I think), nothing else can use D-Bus at the same time.  So if 
the main thread wants to use D-Bus (as happens occasionally for notifications 
and such), it blocks.

So either use QDBus::NoBlock mode if you don't care about the result, or use 
asyncCall if you do.

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100323/b584d939/attachment.sig 


More information about the Plasma-devel mailing list