summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <[email protected]>2015-05-26 19:28:38 +0200
committerMartin Klapetek <[email protected]>2015-05-26 19:28:38 +0200
commitebfcfa20029338b785dc1de817b156a8fe980c8e (patch)
treeae1064616493fc7edcf985f62ca3887d5a0e61ed
parentba449964f637062d56ab32477d6c9095b004b33e (diff)
[kaccounts] Account manager is always needed, move back to ctor
-rw-r--r--plugins/kaccounts/kaccounts-ui-provider.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/kaccounts/kaccounts-ui-provider.cpp b/plugins/kaccounts/kaccounts-ui-provider.cpp
index 539706b..39d6b97 100644
--- a/plugins/kaccounts/kaccounts-ui-provider.cpp
+++ b/plugins/kaccounts/kaccounts-ui-provider.cpp
@@ -79,6 +79,14 @@ KAccountsUiProvider::KAccountsUiProvider(QObject *parent)
d->reconnectRequired = false;
Tp::registerTypes();
+
+ Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
+ Tp::Features() << Tp::Account::FeatureCore
+ << Tp::Account::FeatureCapabilities
+ << Tp::Account::FeatureProtocolInfo
+ << Tp::Account::FeatureProfile);
+ d->accountManager = Tp::AccountManager::create(accountFactory);
+ d->accountManager->becomeReady();
}
KAccountsUiProvider::~KAccountsUiProvider()
@@ -100,12 +108,6 @@ void KAccountsUiProvider::init(KAccountsUiPlugin::UiType type)
if (d->accountManager->isReady()) {
Q_EMIT uiReady();
} else {
- Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
- Tp::Features() << Tp::Account::FeatureCore
- << Tp::Account::FeatureCapabilities
- << Tp::Account::FeatureProtocolInfo
- << Tp::Account::FeatureProfile);
- d->accountManager = Tp::AccountManager::create(accountFactory);
// let's wait for AM to become ready first
connect(d->accountManager->becomeReady(), &Tp::PendingOperation::finished, this, &KAccountsUiProvider::uiReady);
}