[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:56 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=656bd7a
The following commit has been merged in the master branch:
commit 656bd7ab33792a24a32f69d2eea40cf56193f128
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.
---
KTp/Declarative/conversations-model.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/KTp/Declarative/conversations-model.cpp b/KTp/Declarative/conversations-model.cpp
index c46f8f6..3967bff 100644
--- a/KTp/Declarative/conversations-model.cpp
+++ b/KTp/Declarative/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-common-internals packaging
More information about the pkg-kde-commits
mailing list