[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:19:13 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=1a0bad7

The following commit has been merged in the master branch:
commit 1a0bad7e2d5aa289db783e49ae7fb9520ed88542
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Sat Apr 2 02:36:17 2011 +0200

    Fix activation of the "Find" shortcut in the chatwindow
    
    The "find" shortcut wasn't being called anymore because ovveridden by the introduction of KTextEdit for the inheritance of "ChatTextEdit". So what I basically did was to
    overload the "keyPressEvent(QKeyEvent* e)" and emit a custom signal.
    
    Reviewed by Dario Freddi
---
 lib/chat-text-edit.cpp | 9 ++++++++-
 lib/chat-text-edit.h   | 6 ++++++
 lib/chat-widget.cpp    | 1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/chat-text-edit.cpp b/lib/chat-text-edit.cpp
index a24c7ff..0462810 100644
--- a/lib/chat-text-edit.cpp
+++ b/lib/chat-text-edit.cpp
@@ -33,7 +33,7 @@ ChatTextEdit::ChatTextEdit(QWidget *parent) :
     setCheckSpellingEnabled(true);
     enableFindReplace(false);
     setMinimumHeight(0);
-    
+
     connect(this, SIGNAL(textChanged()), SLOT(recalculateSize()));
 }
 
@@ -65,6 +65,13 @@ QSize ChatTextEdit::sizeHint() const
     return sh;
 }
 
+void ChatTextEdit::keyPressEvent(QKeyEvent* e)
+{
+    if (e->matches(QKeySequence::Find)) {
+        emit findTextShortcutPressed();
+    }
+}
+
 void ChatTextEdit::resizeEvent(QResizeEvent* e)
 {
     QTextEdit::resizeEvent(e);
diff --git a/lib/chat-text-edit.h b/lib/chat-text-edit.h
index ba46e39..4f553da 100644
--- a/lib/chat-text-edit.h
+++ b/lib/chat-text-edit.h
@@ -33,6 +33,9 @@ public:
     QSize sizeHint() const;
 
 protected:
+    /// HACK this method is overidden to catch the ctrl+f signal for the toggleSearchBar.
+    void keyPressEvent(QKeyEvent *e);
+
     // reimplemented
     void resizeEvent(QResizeEvent*);
 
@@ -40,6 +43,9 @@ private slots:
     void recalculateSize();
     void updateScrollBar();
 
+signals:
+    void findTextShortcutPressed();
+
 public slots:
     /** wraps setFontWeight to a simple on/off bold) */
     void setFontBold(bool);
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 33bd5c9..af7edff 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -235,6 +235,7 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, QWidget *parent)
     connect(windowEventFilter, SIGNAL(windowActivated()), SLOT(windowActivated()));
 
     // find text in chat
+    connect(d->ui.sendMessageBox, SIGNAL(findTextShortcutPressed()), this, SLOT(toggleSearchBar()));
     connect(d->ui.searchBar, SIGNAL(findTextSignal(QString,QWebPage::FindFlags)), this, SLOT(findTextInChat(QString,QWebPage::FindFlags)));
     connect(d->ui.searchBar, SIGNAL(findNextSignal(QString,QWebPage::FindFlags)), this, SLOT(findNextTextInChat(QString,QWebPage::FindFlags)));
     connect(d->ui.searchBar, SIGNAL(findPreviousSignal(QString,QWebPage::FindFlags)), this, SLOT(findPreviousTextInChat(QString,QWebPage::FindFlags)));

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list