lists.maemo-developers at jamie-thompson
Jul 9, 2011, 4:30 PM
Post #1 of 3
I'm trying to bring up the Accounts UI using DBus in a Qt application:
Bringing up the accounts UI using DBus
> const char * NOKIA_SERVICE_ACCOUNTS_UI("com.nokia.AccountsUI");
> const char * NOKIA_PATH_ACCOUNTS_UI("/com/nokia/AccountsUI");
> const char * NOKIA_IFACE_ACCOUNTS_UI("com.nokia.Accounts");
> QDBusInterface nokiaAccountsUI(NOKIA_SERVICE_ACCOUNTS_UI, NOKIA_PATH_ACCOUNTS_UI, NOKIA_IFACE_ACCOUNTS_UI);
> if (nokiaAccountsUI.isValid())
> QDBusReply<void> showAccountsUIReply = nokiaAccountsUI.call("OpenAccountsList", (uint)winId());
> qDebug() << showAccountsUIReply.error().message();
> qDebug() << nokiaAccountsUI.lastError().message();
...but it doesn't seem to work properly.
I'm basing this on the command:
> dbus-send --print-reply --dest=com.nokia.AccountsUI /com/nokia/AccountsUI com.nokia.Accounts.OpenAccountsList uint32:0
...which works perfectly every time.
The first time I create the QDBusInterface, it returns an invalid object
(isValid() == false), and the error message is an empty string.
In the meantime, DBus has activated the rtcom-accounts-ui service, and
dbus-monitor shows introspection going on (which is how I know the
argument is the parent window xid), suggesting that Qt is preparing the
proxy and caching it somewhere (can I not get Qt to wait for the service
to start without bodging this myself?).
The second call (when the rtcom-accounts-ui process is already running)
succeeds, and the UI is displayed. When the UI is closed, after about a
minute or so the rtcom-accounts-ui process terminates, as is reasonable.
However, if I then try to create an instance of the interface again, it
all falls apart, and I get informed:
> "Could not get owner of name 'com.nokia.AccountsUI': no such name"
...and DBus makes no attempt to start the service.
Once I restart my application, it works again. So I basically get one
try per instance...which is clearly not acceptable.
What on earth am I doing wrong here?
maemo-developers mailing list
maemo-developers [at] maemo