[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:05:41 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=0253fb0

The following commit has been merged in the master branch:
commit 0253fb06e0d50cba4bf7eb9c76ea9ba0259cb74b
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sat Feb 14 22:09:42 2009 +0000

    Improve the implementation of adding a row to the accounts list model and implement removing a row.#
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=926251
---
 KTp/Models/accounts-list-model.cpp | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/KTp/Models/accounts-list-model.cpp b/KTp/Models/accounts-list-model.cpp
index d3512f2..d62aa78 100644
--- a/KTp/Models/accounts-list-model.cpp
+++ b/KTp/Models/accounts-list-model.cpp
@@ -136,9 +136,9 @@ void AccountsListModel::onAccountItemReady()
     Q_ASSERT(m_unreadyAccounts.contains(item));
     Q_ASSERT(!m_readyAccounts.contains(item));
 
-    beginInsertRows(QModelIndex(), m_readyAccounts.size(), m_readyAccounts.size()+1);
+    beginInsertRows(QModelIndex(), m_readyAccounts.size(), m_readyAccounts.size());
     m_readyAccounts.append(item);
-    Q_ASSERT(1==m_unreadyAccounts.removeAll(item));
+    m_unreadyAccounts.removeAll(item);
     endInsertRows();
 
     Q_ASSERT(!m_unreadyAccounts.contains(item));
@@ -147,7 +147,18 @@ void AccountsListModel::onAccountItemReady()
 
 void AccountsListModel::onAccountItemRemoved()
 {
-    // TODO: Implement me!
+    AccountItem *item = qobject_cast<AccountItem*>(sender());
+    Q_ASSERT(item);
+    Q_ASSERT(!m_unreadyAccounts.contains(item));
+    Q_ASSERT(m_readyAccounts.contains(item));
+
+    beginRemoveRows(QModelIndex(), m_readyAccounts.lastIndexOf(item)-1,
+                    m_readyAccounts.lastIndexOf(item)-1);
+    m_readyAccounts.removeAll(item);
+    endRemoveRows();
+
+    Q_ASSERT(!m_readyAccounts.contains(item));
+    Q_ASSERT(!m_unreadyAccounts.contains(item));
 }
 
 void AccountsListModel::onAccountItemUpdated()

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list