[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    [calligra] libs/main: Add a warning about weird shortcut context initialization in the KoView
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2014-01-31 7:14:06
Message-ID: E1W98Ig-0006bb-Uf () scm ! kde ! org
[Download RAW message or body]

Git commit 818245e7f0b387abe0244a2d65017914ee75fc8c by Dmitry Kazakov.
Committed on 31/01/2014 at 07:12.
Pushed by dkazakov into branch 'master'.

Add a warning about weird shortcut context initialization in the KoView

I don't know why this is done, this code was added back in 2007. Effectively,
it changes the context of three shortcuts only (undo, redo, and active author).
The rest will be added with the default context, which is Qt::WindowShortcut.

CCMAIL:calligra-devel@kde.org
CCMAIL:kimageshop@kde.org

M  +8    -1    libs/main/KoView.cpp

http://commits.kde.org/calligra/818245e7f0b387abe0244a2d65017914ee75fc8c

diff --git a/libs/main/KoView.cpp b/libs/main/KoView.cpp
index 8960cbe..89bd944 100644
--- a/libs/main/KoView.cpp
+++ b/libs/main/KoView.cpp
@@ -194,8 +194,15 @@ KoView::KoView(KoPart *part, KoDocument *document, QWidget *parent)
     }
 
     actionCollection()->addAssociatedWidget(this);
-    foreach(QAction* action, actionCollection()->actions())
+
+    /**
+     * WARNING: This code changes the context of global shortcuts
+     *          only. All actions added later will have the default
+     *          context, which is Qt::WindowShortcut!
+     */
+    foreach(QAction* action, actionCollection()->actions()) {
         action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
+    }
 }
 
 KoView::~KoView()
_______________________________________________
Krita mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic