maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   System DBus service issue? (https://talk.maemo.org/showthread.php?t=74700)

mr_jrt 2011-07-08 01:38

System DBus service issue?
 
I'm trying to display the Maemo 5 accounts UI using DBus (via Qt's QDbus). This works fine using dbus-send on the command line.

However, when I call it from code, the first call I get back a fail of sorts (I get an empty error message and the proxy isn't valid)...

...during which, the rtcom-accounts-ui service process is fired up by DBus.

The next call succeeds fine. Once the dialog is closed however, after a minute or so, the process exits. This would all be fine, but when I invoke the DBus call again, the process doesn't get fired up again, probably due to Dbus seemingly thinking it should still be running, as I instead get the error:
Code:

"Could not get owner of name 'com.nokia.AccountsUI': no such name"
Am I missing something that is preventing DBus from invoking the service again? The inability to automatically fire it up again seems to persist for the lifetime of my process. If I start the process manually from another terminal, then the DBus calls succeeds fine (but the process still exists afterwards).

mr_jrt 2011-07-12 20:15

Re: System DBus service issue?
 
Thanks to the awesome Alberto Mardegan from the maemo-devlopers list, I have an elegant workaround:
PHP Code:

QDBusMessage msg(QDBusMessage::createMethodCall(NOKIA_SERVICE_ACCOUNTS_UINOKIA_PATH_ACCOUNTS_UINOKIA_IFACE_ACCOUNTS_UI"OpenAccountsList"));
msg << (uint)winId();
QDBusConnection::sessionBus().call(msg); 

...I suspect there's a nasty bug somewhere inside the QDbusInterface object somewhere...


All times are GMT. The time now is 16:40.

vBulletin® Version 3.8.8