on xenial help sign in
Fix racy start of AccountsService
commit7d72d31d62dc8bd6401ed42fe13037aa92beaea9 authorMichael Terry <michael.terry@canonical.com> dateWed 21 Aug 2013, 11:46 (13 years ago) parent61173c7
1 file changed+5−1
plugins/AccountsService/AccountsService.cpp+5−1
plugins/AccountsService/AccountsService.cpp+5−1
@@ -18,6 +18,7 @@
1818
1919#include "AccountsService.h"
2020#include <QtDBus/QDBusConnection>
21+#include <QtDBus/QDBusConnectionInterface>
2122#include <QtDBus/QDBusMessage>
2223#include <QtDBus/QDBusVariant>
2324
@@ -26,10 +27,13 @@ AccountsService::AccountsService(QObject* parent)
2627 accounts_manager(NULL),
2728 users()
2829{
30+ auto connection = QDBusConnection::SM_BUSNAME();
31+ auto interface = connection.interface();
32+ interface->startService("org.freedesktop.Accounts");
2933 accounts_manager = new QDBusInterface("org.freedesktop.Accounts",
3034 "/org/freedesktop/Accounts",
3135 "org.freedesktop.Accounts",
32− QDBusConnection::SM_BUSNAME(), this);
36+ connection, this);
3337}
3438
3539QVariant AccountsService::getUserProperty(const QString &user, const QString &property)