[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:11:55 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=5eaf9d5
The following commit has been merged in the master branch:
commit 5eaf9d57502f4fb45da1c570067c69c1e836ec68
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Fri Jan 4 19:38:18 2013 +0100
Open chats when pressing enter
Reviewed-by: David Edmundson
FEATURE: 312615
FIXED-IN: 0.5.3
---
contact-list-widget.cpp | 15 +++++++++++++++
contact-list-widget.h | 1 +
2 files changed, 16 insertions(+)
diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index 6414dab..6cd3be0 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -570,6 +570,21 @@ bool ContactListWidget::event(QEvent *event)
return QTreeView::event(event);
}
+void ContactListWidget::keyPressEvent(QKeyEvent *event)
+{
+ //this would be normally handled by activated() signal but since we decided
+ //we don't want people starting chats using single click, we can't use activated()
+ //and have to do it ourselves, therefore this. Change only after discussing with the team!
+ if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
+ //start the chat only if the index is valid and has a parent (ie. is not a group/account)
+ if (currentIndex().isValid() && currentIndex().parent().isValid()) {
+ onContactListDoubleClicked(currentIndex());
+ }
+ }
+
+ QTreeView::keyPressEvent(event);
+}
+
void ContactListWidget::mousePressEvent(QMouseEvent *event)
{
Q_D(ContactListWidget);
diff --git a/contact-list-widget.h b/contact-list-widget.h
index b3b4f7c..26dc20b 100644
--- a/contact-list-widget.h
+++ b/contact-list-widget.h
@@ -82,6 +82,7 @@ Q_SIGNALS:
protected:
void setDropIndicatorRect(const QRect &rect);
virtual bool event(QEvent *event);
+ virtual void keyPressEvent(QKeyEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void paintEvent(QPaintEvent *event);
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list