[SCM] kconfig packaging branch, master, updated. debian/5.28.0-1-4-g8cf9c7c

Maximiliano Curia maxy at moszumanska.debian.org
Fri Mar 31 13:24:36 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/kconfig.git;a=commitdiff;h=b110f54

The following commit has been merged in the master branch:
commit b110f5421ff44fec5af9c65265d19c22d073d8b7
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date:   Fri Mar 31 14:34:40 2017 +0200

    Add new upstream patch: Sanitize-shortcut-list-on-read-write-from-kdeglobals.patch
---
 ...ortcut-list-on-read-write-from-kdeglobals.patch | 59 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 60 insertions(+)

diff --git a/debian/patches/Sanitize-shortcut-list-on-read-write-from-kdeglobals.patch b/debian/patches/Sanitize-shortcut-list-on-read-write-from-kdeglobals.patch
new file mode 100644
index 0000000..8fee6ae
--- /dev/null
+++ b/debian/patches/Sanitize-shortcut-list-on-read-write-from-kdeglobals.patch
@@ -0,0 +1,59 @@
+From: Albert Astals Cid <aacid at kde.org>
+Date: Mon, 6 Mar 2017 22:57:39 +0100
+Subject: Sanitize shortcut list on read/write from kdeglobals
+
+For some reason some people have kdeglobals entries like
+   Close=Ctrl+W; Ctrl+Esc; Ctrl+W; Ctrl+Esc;
+having the same shortcut more than once in the shortcut declaration is clearly bogus so fix it
+
+BUGS: 375555
+REVIEW: 129987
+---
+ src/gui/kstandardshortcut.cpp | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/gui/kstandardshortcut.cpp b/src/gui/kstandardshortcut.cpp
+index 92eb091..dd6a6db 100644
+--- a/src/gui/kstandardshortcut.cpp
++++ b/src/gui/kstandardshortcut.cpp
+@@ -187,6 +187,24 @@ static KStandardShortcutInfo *guardedStandardShortcutInfo(StandardShortcut id)
+     }
+ }
+ 
++
++// Sanitize the list for duplicates. For some reason some
++// people have kdeglobals entries like
++//   Close=Ctrl+W; Ctrl+Esc; Ctrl+W; Ctrl+Esc;
++// having the same shortcut more than once in the shortcut
++// declaration is clearly bogus so fix it
++static void sanitizeShortcutList(QList<QKeySequence> *list)
++{
++    for (int i = 0; i < list->size(); ++i) {
++        const QKeySequence &ks = list->at(i);
++        int other = list->indexOf(ks, i + 1);
++        while (other != -1) {
++            list->removeAt(other);
++            other = list->indexOf(ks, other);
++        }
++    }
++}
++
+ /** Initialize the accelerator @p id by checking if it is overridden
+     in the configuration file (and if it isn't, use the default).
+     On X11, if QApplication was initialized with GUI disabled,
+@@ -209,6 +227,7 @@ static void initialize(StandardShortcut id)
+         QString s = cg.readEntry(info->name);
+         if (s != QLatin1String("none")) {
+             info->cut = QKeySequence::listFromString(s);
++            sanitizeShortcutList(&info->cut);
+         } else {
+             info->cut = QList<QKeySequence>();
+         }
+@@ -244,6 +263,7 @@ void saveShortcut(StandardShortcut id, const QList<QKeySequence> &newShortcut)
+     }
+ 
+     // Write the changed shortcut to kdeglobals
++    sanitizeShortcutList(&info->cut);
+     cg.writeEntry(info->name, QKeySequence::listToString(info->cut), KConfig::Global | KConfig::Persistent);
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..baf2fbf
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+Sanitize-shortcut-list-on-read-write-from-kdeglobals.patch

-- 
kconfig packaging



More information about the pkg-kde-commits mailing list