[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/network/telepathy-accounts-kcm/src
From: George Goldberg <grundleborg () googlemail ! com>
Date: 2009-02-14 17:10:20
Message-ID: 1234631420.625959.12763.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 926103 by gberg:
Add an instance of the AccountsListModel and also fix up the slot that deals with the \
accounts becoming ready to use the latest tpqt4 api.
M +13 -5 kcm-telepathy-accounts.cpp
M +3 -0 kcm-telepathy-accounts.h
--- trunk/playground/network/telepathy-accounts-kcm/src/kcm-telepathy-accounts.cpp \
#926102:926103 @@ -20,12 +20,15 @@
#include "kcm-telepathy-accounts.h"
+#include "accounts-list-model.h"
+
#include <kcategorizedsortfilterproxymodel.h>
#include <kgenericfactory.h>
#include <TelepathyQt4/Client/Account>
#include <TelepathyQt4/Client/AccountManager>
#include <TelepathyQt4/Client/PendingOperation>
+#include <TelepathyQt4/Client/PendingReadyAccount>
K_PLUGIN_FACTORY(KCMTelepathyAccountsFactory, \
registerPlugin<KCMTelepathyAccounts>();) @@ -35,11 +38,13 @@
KCMTelepathyAccounts::KCMTelepathyAccounts(QWidget *parent, const QVariantList& \
args) : KCModule(KCMTelepathyAccountsFactory::componentData(), parent, args),
m_accountsListProxyModel(0),
- m_accountManager(0)
+ m_accountManager(0),
+ m_accountsListModel(0)
{
// TODO: Implement me!
setupUi(this);
startAccountManager();
+ m_accountsListModel = new AccountsListModel(this);
}
KCMTelepathyAccounts::~KCMTelepathyAccounts()
@@ -96,17 +101,20 @@
this, SLOT(onAccountReady(Telepathy::Client::PendingOperation*)));
Q_ASSERT(op->isFinished());
- if(op->isError())
+
+ Telepathy::Client::PendingReadyAccount *pra = \
qobject_cast<Telepathy::Client::PendingReadyAccount*>(op); + Q_ASSERT(0 != pra);
+
+ if(pra->isError())
{
kDebug() << "An error occurred in making and Account ready.";
+ return;
}
else
{
kDebug() << "An Account became ready successfully.";
+ // TODO: Add the account to the model.
}
-
- // TODO: Add the account to the model.
- // FIXME: Need to get the AccountManager::allAccounts() API fixed before can \
continue easily. }
--- trunk/playground/network/telepathy-accounts-kcm/src/kcm-telepathy-accounts.h \
#926102:926103 @@ -25,6 +25,8 @@
#include <kcmodule.h>
+class AccountsListModel;
+
class KCategorizedSortFilterProxyModel;
namespace Telepathy {
@@ -55,6 +57,7 @@
private:
KCategorizedSortFilterProxyModel *m_accountsListProxyModel;
Telepathy::Client::AccountManager *m_accountManager;
+ AccountsListModel *m_accountsListModel;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic