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


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

The following commit has been merged in the master branch:
commit b20bf5015305c71c46c3d573afe9ecd2aec09acd
Author: Aleix Pol <aleixpol at kde.org>
Date:   Tue Oct 28 17:31:08 2014 +0100

    KAction -> QAction, KShortcut -> QKeySequence
---
 app/chat-window.cpp      |  9 ++++-----
 app/chat-window.h        |  4 ++--
 lib/adium-theme-view.h   |  4 ++--
 lib/chat-text-edit.cpp   | 11 +++++------
 lib/chat-text-edit.h     |  7 +++----
 lib/chat-widget.cpp      |  2 +-
 lib/chat-widget.h        |  3 +--
 logviewer/log-viewer.cpp |  5 ++---
 8 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 25dc1a0..81840b0 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -886,11 +886,10 @@ void ChatWindow::setupCustomActions()
     connect(addEmoticonAction, SIGNAL(emoticonActivated(QString)), this, SLOT(onAddEmoticon(QString)) );
 
     m_sendMessage = new KAction(i18n("Send message"), this);
-    m_sendMessage->setShortcuts(
+
+    actionCollection()->setDefaultShortcuts(m_sendMessage,
                 // Setting default shortcuts. Return will be a primary one, and Enter (on keypad) - alternate.
-                QList<QKeySequence>() << QKeySequence(Qt::Key_Return) << QKeySequence(Qt::Key_Enter),
-                KAction::DefaultShortcut);
-    m_sendMessage->setShortcutConfigurable(true);
+                QList<QKeySequence>() << QKeySequence(Qt::Key_Return) << QKeySequence(Qt::Key_Enter));
     connect(m_sendMessage, SIGNAL(changed()), SLOT(updateSendMessageShortcuts()));
 
     // add custom actions to the collection
@@ -1323,7 +1322,7 @@ void ChatWindow::onZoomFactorChanged(qreal zoom)
 
 void ChatWindow::updateSendMessageShortcuts()
 {
-    KShortcut newSendMessageShortcuts = m_sendMessage->shortcut();
+    QKeySequence newSendMessageShortcuts = m_sendMessage->shortcut();
     for (int i = 0; i < m_tabWidget->count(); i++) {
         ChatTab* tab = qobject_cast<ChatTab*>(m_tabWidget->widget(i));
         tab->updateSendMessageShortcuts(newSendMessageShortcuts);
diff --git a/app/chat-window.h b/app/chat-window.h
index f85b3fd..cf81375 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -27,7 +27,7 @@
 
 #include <KXmlGuiWindow>
 #include <KTabWidget>
-#include <KAction>
+#include <QAction>
 #include <KActionMenu>
 
 namespace Sonnet {
@@ -213,7 +213,7 @@ private:
      */
     void restoreKeyboardLayout(ChatTab *chatTab);
 
-    KAction *m_sendMessage;
+    QAction *m_sendMessage;
 
     KTabWidget *m_tabWidget;
 
diff --git a/lib/adium-theme-view.h b/lib/adium-theme-view.h
index 881d0d7..5a0c2e6 100644
--- a/lib/adium-theme-view.h
+++ b/lib/adium-theme-view.h
@@ -38,7 +38,7 @@ class ChatWindowStyle;
 
 class QContextMenuEvent;
 
-class KAction;
+class QAction;
 
 class AdiumThemeViewProxy : public QObject
 {
@@ -152,7 +152,7 @@ private:
     QString m_defaultAvatar;
     AdiumThemeContentInfo m_lastContent;
     bool m_displayHeader;
-    KAction *m_openLinkAction;
+    QAction *m_openLinkAction;
 
     QString m_service;
     QString m_serviceIconPath;
diff --git a/lib/chat-text-edit.cpp b/lib/chat-text-edit.cpp
index 7ee2abf..6fce622 100644
--- a/lib/chat-text-edit.cpp
+++ b/lib/chat-text-edit.cpp
@@ -32,7 +32,6 @@
 
 #include <KStandardShortcut>
 #include <KActionCollection>
-#include <KShortcut>
 
 #define MAXHISTORY 100
 
@@ -143,13 +142,13 @@ bool ChatTextEdit::event(QEvent *e)
     if (e->type() == QEvent::ShortcutOverride) {
         // Extract key code for shortcut sequence comparison
         QKeyEvent *keyEvent = static_cast<QKeyEvent*>(e);
-        int key = keyEvent->key();
+        QKeySequence key = keyEvent->key();
         if (keyEvent->modifiers() != Qt::KeypadModifier) {
             // Keypad modifier is not used in KDE shortcuts setup, so, we need to skip it.
-            key |= keyEvent->modifiers();
+            key = QKeySequence(keyEvent->modifiers() | keyEvent->key());
         }
 
-        if (m_sendMessageShortcuts.contains(key)) {
+        if (m_sendMessageShortcuts.matches(key) == QKeySequence::ExactMatch) {
             // keyPressEvent() handles Control modifier wrong, so we need that thing
             // to be in event().
             this->sendMessage();
@@ -204,9 +203,9 @@ void ChatTextEdit::sendMessage()
     Q_EMIT returnKeyPressed();
 }
 
-void ChatTextEdit::setSendMessageShortcuts(const KShortcut &shortcuts)
+void ChatTextEdit::setSendMessageShortcuts(const QKeySequence &shortcuts)
 {
-    m_sendMessageShortcuts = KShortcut(shortcuts);
+    m_sendMessageShortcuts = shortcuts;
 }
 
 // History of sent messages based on code from Konversation
diff --git a/lib/chat-text-edit.h b/lib/chat-text-edit.h
index b647ee0..49fdef6 100644
--- a/lib/chat-text-edit.h
+++ b/lib/chat-text-edit.h
@@ -24,8 +24,7 @@
 #include <QKeySequence>
 
 #include <KTextEdit>
-#include <KAction>
-#include <KShortcut>
+#include <QAction>
 
 class ChannelContactModel;
 class ChatTextEdit : public KTextEdit
@@ -72,7 +71,7 @@ public Q_SLOTS:
      * Updates internal message sending shortcuts. Must be called on every window
      * creation and every message sending shortcuts change.
      */
-    void setSendMessageShortcuts(const KShortcut &shortcuts);
+    void setSendMessageShortcuts(const QKeySequence &shortcuts);
 
 private:
     QStringList m_history;
@@ -85,7 +84,7 @@ private:
     int m_completionPosition;
     bool m_continuousCompletion;
 
-    KShortcut m_sendMessageShortcuts;
+    QKeySequence m_sendMessageShortcuts;
 };
 
 #endif // CHATTEXTEDIT_H
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 81ea549..5ac430f 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -647,7 +647,7 @@ void ChatWidget::acknowledgeMessages()
     }
 }
 
-void ChatWidget::updateSendMessageShortcuts(const KShortcut &shortcuts)
+void ChatWidget::updateSendMessageShortcuts(const QKeySequence &shortcuts)
 {
     d->ui.sendMessageBox->setSendMessageShortcuts(shortcuts);
 }
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index fd50aa3..62e5198 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -32,7 +32,6 @@
 
 #include <QIcon>
 #include <KColorScheme>
-#include <KShortcut>
 
 #include <TelepathyQt/ReceivedMessage>
 
@@ -135,7 +134,7 @@ public Q_SLOTS:
       */
     void acknowledgeMessages();
 
-    void updateSendMessageShortcuts(const KShortcut &shortcuts);
+    void updateSendMessageShortcuts(const QKeySequence &shortcuts);
 
     void reloadTheme();
 
diff --git a/logviewer/log-viewer.cpp b/logviewer/log-viewer.cpp
index d7c78c3..3354e1e 100644
--- a/logviewer/log-viewer.cpp
+++ b/logviewer/log-viewer.cpp
@@ -35,7 +35,6 @@
 #include <KTp/Models/contacts-model.h>
 
 #include <QWebFrame>
-#include <KShortcut>
 #include <KLineEdit>
 #include <KPixmapSequence>
 #include <KMessageBox>
@@ -150,13 +149,13 @@ void LogViewer::setupActions()
     connect(importKopeteLogs, SIGNAL(triggered(bool)), SLOT(slotImportKopeteLogs()));
 
     KAction *prevConversation = new KAction(i18n("&Previous Conversation"), this);
-    prevConversation->setShortcut(KShortcut(Qt::CTRL + Qt::Key_P));
+    prevConversation->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P));
     prevConversation->setIcon(QIcon::fromTheme(QStringLiteral("go-previous")));
     prevConversation->setEnabled(false);
     connect(prevConversation, SIGNAL(triggered(bool)), SLOT(slotJumpToPrevConversation()));
 
     KAction *nextConversation = new KAction(i18n("&Next Conversation"), this);
-    nextConversation->setShortcut(KShortcut(Qt::CTRL + Qt::Key_N));
+    nextConversation->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
     nextConversation->setIcon(QIcon::fromTheme(QStringLiteral("go-next")));
     nextConversation->setEnabled(false);
     connect(nextConversation, SIGNAL(triggered(bool)), SLOT(slotJumpToNextConversation()));

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list