[prev in list] [next in list] [prev in thread] [next in thread] 

List:       amarok-devel
Subject:    Re: Running queries via dbus
From:       Alex Merry <kde () randomguy3 ! me ! uk>
Date:       2010-03-23 21:55:08
Message-ID: 201003232155.17952.kde () randomguy3 ! me ! uk
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


CC'ing plasma-devel, since this is an important point regarding runners that 
use D-Bus.  Please keep any discussion on this issue at plasma-devel.

On Tuesday 23 March 2010 17:26:54 Alex Merry wrote:
> On Monday 22 March 2010 22:05:26 Jacopo De Simoi wrote:
> > > In particular, Meta::Track has float as the return type of bpm().
> > > Perhaps it would be sensible to make this a qreal?  Also, score()
> > > should probably also return qreal (rather than double) for
> > > consistency.
> > 
> > Probably qreal would be the better choice; would it be possible to change
> > it only when using dbus, to minimize interference with other parts of the
> > code? As far as I can tell this issue makes the dbus query interface
> > basically useless in most cases.
> 
> Well, yes, but it would be cleaner to just use qreal everywhere.

Right, committed this - it will be in the next release of Amarok.

BUT the main issue over the freezing interface is that the audioplayercontrol 
runner is using synchronous D-Bus calls (QDBusConnection::call).  This not 
only blocks the calling thread, but the main thread as well (since that's 
where the D-Bus call actually happens).

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.

I'll commit this change to audioplayercontrol to trunk.  Should I also 
backport it?

Alex




["signature.asc" (application/pgp-signature)]

_______________________________________________
Amarok-devel mailing list
Amarok-devel@kde.org
https://mail.kde.org/mailman/listinfo/amarok-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic