From ac1ea87c072c3b392d4d64c810bc199aa13308ca Mon Sep 17 00:00:00 2001 From: "Andre Moreira Magalhaes (andrunko)" Date: Tue, 31 Mar 2009 19:52:52 -0300 Subject: Account: Removed manager method and use QDBusConnection/busName to create account. Rationale: Before this change, to create a Account, the user would pass the AccountManagerPtr as a param. This way, it's desirable that manager always return the proper manager used on Account creation, but this was not true in all cases, as the account manager could be destroyed while the account was still alive. Example: AccountPtr acc; { AccountManagerPtr am = AccountManager::create(); ... acc = Account::create(am, path); } // am is detroyed - nobody referencing it, Account HAD a weakref to it Q_ASSERT(acc->manager()); // fail As the AccountManager is supposed to be a singleton, there is no need for this method, and to avoid misbehaviour let's remove it. --- examples/accounts/account-item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/accounts') diff --git a/examples/accounts/account-item.cpp b/examples/accounts/account-item.cpp index 16555525..172fa74f 100644 --- a/examples/accounts/account-item.cpp +++ b/examples/accounts/account-item.cpp @@ -31,7 +31,8 @@ AccountItem::AccountItem(Telepathy::Client::AccountManagerPtr am, const QString &objectPath, QTableWidget *table, int row, QObject *parent) : QObject(parent), - mAcc(Telepathy::Client::Account::create(am, objectPath)), + mAcc(Telepathy::Client::Account::create(am->dbusConnection(), + am->busName(), objectPath)), mTable(table), mRow(row) { -- cgit v1.2.3