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


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

The following commit has been merged in the master branch:
commit 7c9e5ba4d7106428eb1a3e3449cf52e5a117d818
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Mon Jan 16 13:18:16 2012 +0000

    Better index validity check
    
    Reviewed by: Martin Klapetek
---
 KTp/Models/accounts-model.cpp | 2 +-
 KTp/Models/groups-model.cpp   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/KTp/Models/accounts-model.cpp b/KTp/Models/accounts-model.cpp
index 7132261..13aaa4c 100644
--- a/KTp/Models/accounts-model.cpp
+++ b/KTp/Models/accounts-model.cpp
@@ -286,7 +286,7 @@ QModelIndex AccountsModel::index(int row, int column, const QModelIndex &parent)
 {
     TreeNode *parentNode = mPriv->node(parent);
     Q_ASSERT(parentNode);
-    if (row < parentNode->size()) {
+    if (row >= 0 && row < parentNode->size() && column == 0) {
         return createIndex(row, column, parentNode->childAt(row));
     }
 
diff --git a/KTp/Models/groups-model.cpp b/KTp/Models/groups-model.cpp
index 040e034..bbd5755 100644
--- a/KTp/Models/groups-model.cpp
+++ b/KTp/Models/groups-model.cpp
@@ -138,7 +138,7 @@ bool GroupsModel::setData(const QModelIndex &index, const QVariant &value, int r
 QModelIndex GroupsModel::index(int row, int column, const QModelIndex &parent) const
 {
     TreeNode *parentNode = mPriv->node(parent);
-    if (row < parentNode->size()) {
+    if (row >= 0 && row < parentNode->size() && column == 0) {
         return createIndex(row, column, parentNode->childAt(row));
     }
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list