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


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=3f43c50

The following commit has been merged in the master branch:
commit 3f43c50e6a8974fc3795d333c7e41ce7eef3c2a9
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
---
 src/accounts-list-model.cpp | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/accounts-list-model.cpp b/src/accounts-list-model.cpp
index d3512f2..d62aa78 100644
--- a/src/accounts-list-model.cpp
+++ b/src/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-accounts-kcm packaging



More information about the pkg-kde-commits mailing list