[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:14:38 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=5712303
The following commit has been merged in the master branch:
commit 57123038d097dd0fac80c31aadb27976ab2547a7
Author: Renato Atilio <renatoat at gmail.com>
Date: Sat Apr 26 20:03:13 2014 +0200
Fix for a bug that caused the contacts list to not expand some groups on opening and filtering
I've fixed the 325506 bug by creating a decision upon the validity of the inserted item's parent. If it is valid, it works as before, considering it is a top-level element we want to collapse/expand. If it is invalid, the inserted item itself is probably the top-level node (hence the invalid parent - there's none), so we get it in another way.
I don't think the second validity check is strictly needed, but I thought it was safer to keep it anyway.
REVIEW: 117791
BUG: 325506
---
contact-list-widget.cpp | 13 +++++++++++--
contact-list-widget.h | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index ae1b9c9..49d21ee 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -521,12 +521,21 @@ void ContactListWidget::requestFileTransferChannels(const Tp::AccountPtr &accoun
Q_EMIT actionStarted();
}
-void ContactListWidget::onNewGroupModelItemsInserted(const QModelIndex& index, int start, int end)
+void ContactListWidget::onNewGroupModelItemsInserted(const QModelIndex& parentIndex, int start, int end)
{
- Q_UNUSED(start);
Q_UNUSED(end);
Q_D(ContactListWidget);
+ QModelIndex index;
+
+ //if the inserted item's parent is valid, it is probably the top-level item we want to expand/collapse
+ if (parentIndex.isValid()) {
+ index = parentIndex;
+ } else {
+ //if it is invalid, the inserted item may be a group added after a child, so we get the group index
+ index = model()->index(start, 0, QModelIndex());
+ }
+
if (!index.isValid()) {
return;
}
diff --git a/contact-list-widget.h b/contact-list-widget.h
index c5b5328..9aa3a48 100644
--- a/contact-list-widget.h
+++ b/contact-list-widget.h
@@ -65,7 +65,7 @@ private Q_SLOTS:
void onContactListClicked(const QModelIndex &index);
void onContactListDoubleClicked(const QModelIndex &index);
- void onNewGroupModelItemsInserted(const QModelIndex &index, int start, int end);
+ void onNewGroupModelItemsInserted(const QModelIndex &parentIndex, int start, int end);
void addOverlayButtons();
void startTextChannel(const Tp::AccountPtr &account, const Tp::ContactPtr &contact);
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list