[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:13:26 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=ba861ab
The following commit has been merged in the master branch:
commit ba861ab8cf915250c7f551c24b21ced031def3e4
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Tue Jul 2 14:27:00 2013 +0200
Enable metacontact expanding on click
View's selection model behaves rather strangely and different contacts
get selected after expanding/collapsing, plus sometimes it does not
collapse the correct index. Therefore the index is stored manually.
Reviewed-by: David Edmundson
---
contact-list-widget.cpp | 8 ++++++++
contact-list-widget_p.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index ba18b18..1bdf635 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -226,6 +226,14 @@ void ContactListWidget::onContactListClicked(const QModelIndex& index)
//replace the old value or insert new value if it isn't there yet
d->groupStates.insert(groupId, isExpanded(index));
}
+
+ if (index.parent() != d->selectedIndex && d->selectedIndex.parent() != index) {
+ if (index.data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) {
+ expand(index);
+ }
+ collapse(d->selectedIndex);
+ d->selectedIndex = index;
+ }
}
void ContactListWidget::onContactListDoubleClicked(const QModelIndex& index)
diff --git a/contact-list-widget_p.h b/contact-list-widget_p.h
index f3e7214..5baae87 100644
--- a/contact-list-widget_p.h
+++ b/contact-list-widget_p.h
@@ -50,6 +50,7 @@ public:
QHash<QString, bool> groupStates;
Tp::AccountManagerPtr accountManager;
KTp::ContactsModel::GroupMode groupMode; // Stores current grouping mode (by accounts or by groups)
+ QPersistentModelIndex selectedIndex;
};
#endif //CONTACT_LIST_WIDGET_P_H
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list