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


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

The following commit has been merged in the master branch:
commit 6f519e82838fd2de69f7abd2bd54bdfab9467906
Author: Lasath Fernando <kde at lasath.org>
Date:   Tue Feb 7 08:00:21 2012 +1100

    Add extra check in handleValidityChange()
    
    It now ensures that the object to be deleted is in that model
    before removing.
---
 plasmoid/declarative-plugin/conversations-model.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/plasmoid/declarative-plugin/conversations-model.cpp b/plasmoid/declarative-plugin/conversations-model.cpp
index c46f8f6..3967bff 100644
--- a/plasmoid/declarative-plugin/conversations-model.cpp
+++ b/plasmoid/declarative-plugin/conversations-model.cpp
@@ -93,11 +93,15 @@ void ConversationsModel::handleValidityChange(bool valid)
     if(!valid) {
         Conversation* sender = qobject_cast<Conversation*>(QObject::sender());
         int index = d->conversations.indexOf(sender);
-        beginRemoveRows(QModelIndex(), index, index);
-
-        d->conversations.removeAt(index);
-        sender->deleteLater();
-        endRemoveRows();
+        if(index != -1) {
+            beginRemoveRows(QModelIndex(), index, index);
+
+            d->conversations.removeAt(index);
+            sender->deleteLater();
+            endRemoveRows();
+        } else {
+            kError() << "attempting to delete non-existant conversation";
+        }
     }
 }
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list