[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:22:05 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=bca67be

The following commit has been merged in the master branch:
commit bca67be2b9d31416ba3ef6b2b56e09fd0379a8f8
Author: Dan Vrátil <dan at progdan.cz>
Date:   Sun Jul 15 18:38:42 2012 +0200

    Fix EntityModel warnings
    
    REVIEW: 105579
    BUG: 303336
---
 logviewer/entity-model.cpp | 48 +++++++++++++++++++++-------------------------
 1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/logviewer/entity-model.cpp b/logviewer/entity-model.cpp
index a7b0d95..cbee00a 100644
--- a/logviewer/entity-model.cpp
+++ b/logviewer/entity-model.cpp
@@ -144,35 +144,31 @@ void EntityModel::onEntitiesSearchFinished(Tpl::PendingOperation *operation)
 
     Tpl::EntityPtrList newEntries = pendingEntities->entities();
 
-    if (newEntries.size() > 0) {
-        Q_FOREACH(const Tpl::EntityPtr &entity, newEntries) {
-            EntityModelItem *parent = m_rootItem->item(pendingEntities->account());
-            if (!parent) {
-                beginInsertRows(QModelIndex(), m_rootItem->itemCount(), m_rootItem->itemCount());
-                parent = new EntityModelItem(m_rootItem);
-                parent->setData(QVariant::fromValue(pendingEntities->account()), EntityModel::AccountRole);
-                m_rootItem->addItem(parent);
-                endInsertRows();
-            }
-
-
-            QModelIndex parentIndex = index(parent->row(), 0, QModelIndex());
-            beginInsertRows(parentIndex, m_rootItem->item(parentIndex.row())->row(), m_rootItem->item(parentIndex.row())->row());
-            EntityModelItem *item = new EntityModelItem(parent);
-            item->setData(QVariant::fromValue(pendingEntities->account()), EntityModel::AccountRole);
-            item->setData(QVariant::fromValue(entity), EntityModel::EntityRole);
-            parent->addItem(item);
-
-            if (pendingEntities->account()->connection()) {
-                Tp::PendingOperation *op =
-                    pendingEntities->account()->connection()->contactManager()->contactsForIdentifiers(
-                                            QStringList() << entity->identifier());
-                connect(op, SIGNAL(finished(Tp::PendingOperation*)),
-                        this, SLOT(onEntityContactRetrieved(Tp::PendingOperation*)));
-            }
+    Q_FOREACH(const Tpl::EntityPtr &entity, newEntries) {
+        EntityModelItem *parent = m_rootItem->item(pendingEntities->account());
+        if (!parent) {
+            beginInsertRows(QModelIndex(), m_rootItem->itemCount(), m_rootItem->itemCount());
+            parent = new EntityModelItem(m_rootItem);
+            parent->setData(QVariant::fromValue(pendingEntities->account()), EntityModel::AccountRole);
+            m_rootItem->addItem(parent);
             endInsertRows();
         }
 
+        QModelIndex parentIndex = index(parent->row(), 0, QModelIndex());
+        beginInsertRows(parentIndex, parent->itemCount() , parent->itemCount());
+        EntityModelItem *item = new EntityModelItem(parent);
+        item->setData(QVariant::fromValue(pendingEntities->account()), EntityModel::AccountRole);
+        item->setData(QVariant::fromValue(entity), EntityModel::EntityRole);
+        parent->addItem(item);
+
+        if (pendingEntities->account()->connection()) {
+            Tp::PendingOperation *op =
+                pendingEntities->account()->connection()->contactManager()->contactsForIdentifiers(
+                                        QStringList() << entity->identifier());
+            connect(op, SIGNAL(finished(Tp::PendingOperation*)),
+                    this, SLOT(onEntityContactRetrieved(Tp::PendingOperation*)));
+        }
+        endInsertRows();
     }
 }
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list