[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5
Maximiliano Curia
maxy at moszumanska.debian.org
Fri May 27 23:57:13 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=678882b
The following commit has been merged in the master branch:
commit 678882be571f280eaf67e90b95a0feb863edb817
Author: George Goldberg <grundleborg at googlemail.com>
Date: Sun Jul 19 15:00:56 2009 +0000
Rough and ready port to TpQt4 0.1.8.
svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=999268
---
src/account-item.cpp | 31 ++++++++++---------------------
src/account-item.h | 15 +++++++--------
src/accounts-list-model.cpp | 6 +++---
src/accounts-list-model.h | 10 +++-------
src/kcm-telepathy-accounts.cpp | 23 +++++++++--------------
src/kcm-telepathy-accounts.h | 13 ++++++-------
6 files changed, 38 insertions(+), 60 deletions(-)
diff --git a/src/account-item.cpp b/src/account-item.cpp
index ddaf036..30d063b 100644
--- a/src/account-item.cpp
+++ b/src/account-item.cpp
@@ -26,11 +26,10 @@
#include <QtCore/QTimer>
-#include <TelepathyQt4/Client/Account>
-#include <TelepathyQt4/Client/PendingOperation>
-#include <TelepathyQt4/Client/PendingReadyAccount>
+#include <TelepathyQt4/PendingOperation>
+#include <TelepathyQt4/PendingReady>
-AccountItem::AccountItem(Telepathy::Client::Account *account, AccountsListModel *parent)
+AccountItem::AccountItem(Tp::AccountPtr account, AccountsListModel *parent)
: QObject(parent),
m_account(account)
{
@@ -44,8 +43,8 @@ AccountItem::AccountItem(Telepathy::Client::Account *account, AccountsListModel
else
{
// FIXME: What features should we get ready with?
- connect(m_account->becomeReady(), SIGNAL(finished(Telepathy::Client::PendingOperation*)),
- this, SLOT(onBecomeReadyFinished(Telepathy::Client::PendingOperation*)), Qt::QueuedConnection);
+ connect(m_account->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)),
+ this, SLOT(onBecomeReadyFinished(Tp::PendingOperation*)), Qt::QueuedConnection);
}
}
@@ -54,31 +53,21 @@ AccountItem::~AccountItem()
// TODO: Implement me...
}
-Telepathy::Client::Account* AccountItem::account() const
+Tp::AccountPtr AccountItem::account() const
{
return m_account;
}
-void AccountItem::onBecomeReadyFinished(Telepathy::Client::PendingOperation *op)
+void AccountItem::onBecomeReadyFinished(Tp::PendingOperation *op)
{
- Q_ASSERT(op->isFinished());
- Telepathy::Client::PendingReadyAccount *pra = qobject_cast<Telepathy::Client::PendingReadyAccount*>(op);
- Q_ASSERT(0 != pra);
-
- if(pra->isError())
+ if(op->isError())
{
kDebug() << "An error occurred in making and Account ready.";
return;
}
- else
- {
- kDebug() << "An Account became ready successfully.";
- m_account = pra->account();
- // FIXME: What features should we check its ready with?
- Q_ASSERT(m_account->isReady());
- Q_EMIT ready();
- }
+
+ Q_EMIT ready();
}
#include "account-item.moc"
diff --git a/src/account-item.h b/src/account-item.h
index c88dbbb..7dde8be 100644
--- a/src/account-item.h
+++ b/src/account-item.h
@@ -23,13 +23,12 @@
#include <QtCore/QObject>
+#include <TelepathyQt4/Account>
+
class AccountsListModel;
namespace Telepathy {
- namespace Client {
- class Account;
- class PendingOperation;
- }
+ class PendingOperation;
}
class AccountItem : public QObject
@@ -38,12 +37,12 @@ class AccountItem : public QObject
Q_DISABLE_COPY(AccountItem);
public:
- explicit AccountItem(Telepathy::Client::Account *account, AccountsListModel *parent = 0);
+ explicit AccountItem(Tp::AccountPtr account, AccountsListModel *parent = 0);
virtual ~AccountItem();
- Telepathy::Client::Account* account() const;
+ Tp::AccountPtr account() const;
private Q_SLOTS:
- void onBecomeReadyFinished(Telepathy::Client::PendingOperation *op);
+ void onBecomeReadyFinished(Tp::PendingOperation *op);
Q_SIGNALS:
void ready();
@@ -51,7 +50,7 @@ Q_SIGNALS:
void updated();
private:
- Telepathy::Client::Account *m_account;
+ Tp::AccountPtr m_account;
};
diff --git a/src/accounts-list-model.cpp b/src/accounts-list-model.cpp
index d62aa78..1ae396f 100644
--- a/src/accounts-list-model.cpp
+++ b/src/accounts-list-model.cpp
@@ -25,7 +25,7 @@
#include <kcategorizedsortfilterproxymodel.h>
#include <kdebug.h>
-#include <TelepathyQt4/Client/Account>
+#include <TelepathyQt4/Account>
AccountsListModel::AccountsListModel(QObject *parent)
: QAbstractListModel(parent)
@@ -87,9 +87,9 @@ QVariant AccountsListModel::data(const QModelIndex &index, int role) const
return data;
}
-void AccountsListModel::addAccount(Telepathy::Client::Account *account)
+void AccountsListModel::addAccount(Tp::AccountPtr account)
{
- kDebug() << "Creating a new AccountItem from account:" << account;
+ kDebug() << "Creating a new AccountItem from account:" << account.data();
// Check if the account is already in the model.
bool found = false;
diff --git a/src/accounts-list-model.h b/src/accounts-list-model.h
index f4f0e81..d46eac5 100644
--- a/src/accounts-list-model.h
+++ b/src/accounts-list-model.h
@@ -23,13 +23,9 @@
#include <QtCore/QAbstractListModel>
-class AccountItem;
+#include <TelepathyQt4/Account>
-namespace Telepathy {
- namespace Client {
- class Account;
- }
-}
+class AccountItem;
class AccountsListModel : public QAbstractListModel
{
@@ -41,7 +37,7 @@ public:
virtual ~AccountsListModel();
virtual int rowCount(const QModelIndex &index) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- void addAccount(Telepathy::Client::Account *account);
+ void addAccount(Tp::AccountPtr account);
private Q_SLOTS:
void onAccountItemReady();
diff --git a/src/kcm-telepathy-accounts.cpp b/src/kcm-telepathy-accounts.cpp
index 4435909..ee57ee2 100644
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@ -26,9 +26,9 @@
#include <kcategorydrawer.h>
#include <kgenericfactory.h>
-#include <TelepathyQt4/Client/Account>
-#include <TelepathyQt4/Client/AccountManager>
-#include <TelepathyQt4/Client/PendingOperation>
+#include <TelepathyQt4/Account>
+#include <TelepathyQt4/PendingOperation>
+#include <TelepathyQt4/PendingReady>
K_PLUGIN_FACTORY(KCMTelepathyAccountsFactory, registerPlugin<KCMTelepathyAccounts>();)
@@ -38,7 +38,6 @@ K_EXPORT_PLUGIN(KCMTelepathyAccountsFactory("telepathy_accounts", "kcm_telepathy
KCMTelepathyAccounts::KCMTelepathyAccounts(QWidget *parent, const QVariantList& args)
: KCModule(KCMTelepathyAccountsFactory::componentData(), parent, args),
m_accountsListProxyModel(0),
- m_accountManager(0),
m_accountsListModel(0)
{
// Start up required telepathy components.
@@ -73,18 +72,14 @@ void KCMTelepathyAccounts::startAccountManager()
{
// This slot is called on construction to set up a telepathy accountmanager
// instance.
- m_accountManager = new Telepathy::Client::AccountManager(this);
+ m_accountManager = Tp::AccountManager::create();
- connect(m_accountManager->becomeReady(), SIGNAL(finished(Telepathy::Client::PendingOperation*)),
- this, SLOT(startAccountManagerFinished(Telepathy::Client::PendingOperation*)));
+ connect(m_accountManager->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)),
+ this, SLOT(startAccountManagerFinished(Tp::PendingOperation*)));
}
-void KCMTelepathyAccounts::startAccountManagerFinished(Telepathy::Client::PendingOperation *op)
+void KCMTelepathyAccounts::startAccountManagerFinished(Tp::PendingOperation *op)
{
- disconnect(op, SIGNAL(finished(Telepathy::Client::PendingOperation*)),
- this, SLOT(startAccountManagerFinished(Telepathy::Client::PendingOperation*)));
-
- Q_ASSERT(op->isFinished());
if(op->isError())
{
kDebug() << "An error occurred making the AccountManager ready.";
@@ -95,8 +90,8 @@ void KCMTelepathyAccounts::startAccountManagerFinished(Telepathy::Client::Pendin
kDebug() << "AccountManager became ready successfully.";
}
- QList<Telepathy::Client::Account*> accounts = m_accountManager->allAccounts();
- foreach(Telepathy::Client::Account* account, accounts)
+ QList<Tp::AccountPtr> accounts = m_accountManager->allAccounts();
+ foreach(Tp::AccountPtr account, accounts)
{
m_accountsListModel->addAccount(account);
}
diff --git a/src/kcm-telepathy-accounts.h b/src/kcm-telepathy-accounts.h
index f1b9797..904bcec 100644
--- a/src/kcm-telepathy-accounts.h
+++ b/src/kcm-telepathy-accounts.h
@@ -25,15 +25,14 @@
#include <kcmodule.h>
+#include <TelepathyQt4/AccountManager>
+
class AccountsListModel;
class KCategorizedSortFilterProxyModel;
-namespace Telepathy {
- namespace Client {
- class AccountManager;
- class PendingOperation;
- }
+namespace Tp {
+ class PendingOperation;
}
class KCMTelepathyAccounts : public KCModule, Ui::MainWidget
@@ -51,11 +50,11 @@ public Q_SLOTS:
private Q_SLOTS:
void startAccountManager();
- void startAccountManagerFinished(Telepathy::Client::PendingOperation *op);
+ void startAccountManagerFinished(Tp::PendingOperation *op);
private:
KCategorizedSortFilterProxyModel *m_accountsListProxyModel;
- Telepathy::Client::AccountManager *m_accountManager;
+ Tp::AccountManagerPtr m_accountManager;
AccountsListModel *m_accountsListModel;
};
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list