[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:04:30 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=320202e
The following commit has been merged in the master branch:
commit 320202ebfa6b8cf670710d04b8aaac097867e41d
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Thu Mar 17 21:42:06 2011 +0100
Move the account 'filtering' from the model to the proxy model, where it belongs. Also use the renamed TextUi dbus path.
---
models/accounts-model.cpp | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/models/accounts-model.cpp b/models/accounts-model.cpp
index dacb5a7..266828a 100644
--- a/models/accounts-model.cpp
+++ b/models/accounts-model.cpp
@@ -64,17 +64,15 @@ AccountsModel::AccountsModel(const Tp::AccountManagerPtr &am, QObject *parent)
SLOT(onItemsRemoved(TreeNode*,int,int)));
foreach (Tp::AccountPtr account, mPriv->mAM->allAccounts()) {
- if(account->isEnabled() && account->connectionStatus() == Tp::ConnectionStatusConnected) {
- AccountsModelItem *item = new AccountsModelItem(account);
- connect(item, SIGNAL(connectionStatusChanged(QString,int)),
- this, SIGNAL(accountConnectionStatusChanged(QString,int)));
- mPriv->mTree->addChild(item);
- }
+ AccountsModelItem *item = new AccountsModelItem(account);
+ connect(item, SIGNAL(connectionStatusChanged(QString,int)),
+ this, SIGNAL(accountConnectionStatusChanged(QString,int)));
+ mPriv->mTree->addChild(item);
}
-// connect(mPriv->mAM.data(),
-// SIGNAL(newAccount(Tp::AccountPtr)),
-// SLOT(onNewAccount(Tp::AccountPtr)));
+ connect(mPriv->mAM.data(),
+ SIGNAL(newAccount(Tp::AccountPtr)),
+ SLOT(onNewAccount(Tp::AccountPtr)));
QHash<int, QByteArray> roles;
roles[ItemRole] = "item";
@@ -154,8 +152,11 @@ void AccountsModel::onItemsAdded(TreeNode *parent, const QList<TreeNode *> &node
void AccountsModel::onItemsRemoved(TreeNode *parent, int first, int last)
{
QModelIndex parentIndex = index(parent);
- beginRemoveRows(index(parent->parent()), parentIndex.row(), parentIndex.row());
- parent->remove();
+ QList<TreeNode *> removedItems;
+ beginRemoveRows(parentIndex, first, last);
+ for (int i = last; i >= first; i--) {
+ parent->childAt(i)->remove();
+ }
endRemoveRows();
emit accountCountChanged();
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list