Hello community, here is the log from the commit of package kglobalaccel for openSUSE:Factory checked in at 2015-04-13 20:28:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kglobalaccel (Old) and /work/SRC/openSUSE:Factory/.kglobalaccel.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kglobalaccel" Changes: -------- --- /work/SRC/openSUSE:Factory/kglobalaccel/kglobalaccel.changes 2015-03-16 09:35:54.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kglobalaccel.new/kglobalaccel.changes 2015-04-13 20:28:29.000000000 +0200 @@ -1,0 +2,7 @@ +Sat Apr 4 14:41:05 UTC 2015 - [email protected] + +- Update to 5.9.0 + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.9.0.php + +------------------------------------------------------------------- Old: ---- kglobalaccel-5.8.0.tar.xz New: ---- kglobalaccel-5.9.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kglobalaccel.spec ++++++ --- /var/tmp/diff_new_pack.OM5nPi/_old 2015-04-13 20:28:29.000000000 +0200 +++ /var/tmp/diff_new_pack.OM5nPi/_new 2015-04-13 20:28:29.000000000 +0200 @@ -16,23 +16,26 @@ # +%bcond_without lang %define lname libKF5GlobalAccel5 -%define _tar_path 5.8 +%define _tar_path 5.9 Name: kglobalaccel -Version: %{_tar_path}.0 +Version: 5.9.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.8.0 +BuildRequires: extra-cmake-modules >= %{_tar_path} BuildRequires: fdupes -BuildRequires: kconfig-devel >= %{kf5_version} -BuildRequires: kcoreaddons-devel >= %{kf5_version} -BuildRequires: kcrash-devel >= %{kf5_version} -BuildRequires: kdbusaddons-devel >= %{kf5_version} +BuildRequires: kconfig-devel >= %{_tar_path} +BuildRequires: kcoreaddons-devel >= %{_tar_path} +BuildRequires: kcrash-devel >= %{_tar_path} +BuildRequires: kdbusaddons-devel >= %{_tar_path} BuildRequires: kf5-filesystem -BuildRequires: ki18n-devel >= %{kf5_version} -BuildRequires: kwindowsystem-devel >= %{kf5_version} +BuildRequires: ki18n-devel >= %{_tar_path} +BuildRequires: kwindowsystem-devel >= %{_tar_path} +%if %{with lang} BuildRequires: libqt5-linguist-devel >= 5.2.0 +%endif BuildRequires: libxcb-devel BuildRequires: pkgconfig(Qt5DBus) >= 5.2.0 BuildRequires: pkgconfig(Qt5Test) >= 5.2.0 @@ -56,7 +59,9 @@ %package -n %lname Summary: Global desktop keyboard shortcuts Group: System/GUI/KDE +%if %{with lang} Recommends: %lname-lang = %{version} +%endif Recommends: kglobalaccel5 %requires_ge libQt5Widgets5 %requires_ge libQt5DBus5 @@ -99,9 +104,11 @@ %install %kf5_makeinstall -C build - %fdupes %{buildroot}%{_kf5_sharedir} + %fdupes %{buildroot} - %find_lang %{name}5 --with-qt --without-mo +%if %{with lang} +%find_lang %{name}5 --with-qt --without-mo +%endif %post -n %lname -p /sbin/ldconfig @@ -111,7 +118,9 @@ %postun -n kglobalaccel5 -p /sbin/ldconfig +%if %{with lang} %files -n %lname-lang -f %{name}5.lang +%endif %files -n %lname %defattr(-,root,root) ++++++ kglobalaccel-5.8.0.tar.xz -> kglobalaccel-5.9.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/CMakeLists.txt new/kglobalaccel-5.9.0/CMakeLists.txt --- old/kglobalaccel-5.8.0/CMakeLists.txt 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/CMakeLists.txt 2015-04-04 14:05:12.000000000 +0200 @@ -3,7 +3,7 @@ project(KGlobalAccel) # ECM setup -find_package(ECM 1.8.0 REQUIRED NO_MODULE) +find_package(ECM 5.9.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(FeatureSummary) @@ -14,8 +14,8 @@ include(ECMPoQmTools) -set(KF5_VERSION "5.8.0") # handled by release scripts -set(KF5_DEP_VERSION "5.8.0") # handled by release scripts +set(KF5_VERSION "5.9.0") # handled by release scripts +set(KF5_DEP_VERSION "5.9.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KGLOBALACCEL VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kglobalaccel_version.h" @@ -40,7 +40,7 @@ # no X11 stuff on mac if (NOT APPLE) - find_package(XCB MODULE COMPONENTS XCB KEYSYMS) + find_package(XCB MODULE COMPONENTS XCB KEYSYMS XTEST) set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding" URL "http://xcb.freedesktop.org" TYPE OPTIONAL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/autotests/CMakeLists.txt new/kglobalaccel-5.9.0/autotests/CMakeLists.txt --- old/kglobalaccel-5.8.0/autotests/CMakeLists.txt 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/autotests/CMakeLists.txt 2015-04-04 14:05:12.000000000 +0200 @@ -4,9 +4,17 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII) remove_definitions(-DQT_NO_CAST_TO_ASCII) +set(additionalLibraries ) +if(HAVE_X11 AND XCB_XTEST_FOUND) + add_definitions(-DHAVE_XCB_XTEST) + set(additionalLibraries Qt5::X11Extras XCB::XTEST XCB::KEYSYMS) +else() + set(additionalLibraries ) +endif() + include(ECMAddTests) ecm_add_tests( kglobalshortcuttest.cpp - LINK_LIBRARIES Qt5::Test KF5::GlobalAccel + LINK_LIBRARIES Qt5::Test KF5::GlobalAccel ${additionalLibraries} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/autotests/kglobalshortcuttest.cpp new/kglobalaccel-5.9.0/autotests/kglobalshortcuttest.cpp --- old/kglobalaccel-5.8.0/autotests/kglobalshortcuttest.cpp 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/autotests/kglobalshortcuttest.cpp 2015-04-04 14:05:12.000000000 +0200 @@ -22,6 +22,7 @@ #include "kglobalshortcuttest.h" #include <qdbusinterface.h> +#include <QSignalSpy> #include <QTest> #include <QAction> #include <QThread> @@ -32,7 +33,16 @@ #include <QtDBus/QDBusConnectionInterface> -const QKeySequence sequenceA = QKeySequence(Qt::SHIFT + Qt::META + Qt::CTRL + Qt::ALT + Qt::Key_F28); +#ifdef HAVE_XCB_XTEST +#include <QX11Info> +#define XK_MISCELLANY +#define XK_XKB_KEYS +#include <X11/keysymdef.h> +#include <xcb/xcb_keysyms.h> +#include <xcb/xtest.h> +#endif + +const QKeySequence sequenceA = QKeySequence(Qt::SHIFT + Qt::META + Qt::CTRL + Qt::ALT + Qt::Key_F12); const QKeySequence sequenceB = QKeySequence(Qt::Key_F29); const QKeySequence sequenceC = QKeySequence(Qt::SHIFT + Qt::META + Qt::CTRL + Qt::Key_F28); const QKeySequence sequenceD = QKeySequence(Qt::META + Qt::ALT + Qt::Key_F30); @@ -114,6 +124,57 @@ QVERIFY(KGlobalAccel::self()->defaultShortcut(m_actionB).isEmpty()); } +void KGlobalShortcutTest::testActivateShortcut() +{ +#ifdef HAVE_XCB_XTEST + if (!QX11Info::isPlatformX11()) { + QSKIP("This test can only be run on platform xcb"); + } + + setupTest("testActivateShortcut"); + if (!m_daemonInstalled) { + QSKIP("kglobalaccel not installed"); + } + QSignalSpy actionASpy(m_actionA, SIGNAL(triggered(bool))); + QVERIFY(actionASpy.isValid()); + + xcb_connection_t *c = QX11Info::connection(); + xcb_window_t w = QX11Info::appRootWindow(); + + xcb_key_symbols_t *syms = xcb_key_symbols_alloc(c); + auto getCode = [syms] (int code) { + xcb_keycode_t *keyCodes = xcb_key_symbols_get_keycode(syms, code); + const xcb_keycode_t ret = keyCodes[0]; + free(keyCodes); + return ret; + }; + const xcb_keycode_t shift = getCode(XK_Shift_L); + const xcb_keycode_t meta = getCode(XK_Super_L); + const xcb_keycode_t control = getCode(XK_Control_L); + const xcb_keycode_t alt = getCode(XK_Alt_L); + const xcb_keycode_t f12 = getCode(XK_F12); + xcb_key_symbols_free(syms); + + xcb_test_fake_input(c, XCB_KEY_PRESS, meta, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_PRESS, control, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_PRESS, alt, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_PRESS, shift, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_PRESS, f12, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + + xcb_test_fake_input(c, XCB_KEY_RELEASE, f12, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_RELEASE, shift, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_RELEASE, meta, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_RELEASE, control, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_test_fake_input(c, XCB_KEY_RELEASE, alt, XCB_TIME_CURRENT_TIME, w, 0, 0, 0); + xcb_flush(c); + + QVERIFY(actionASpy.wait()); + QCOMPARE(actionASpy.count(), 1); +#else + QSKIP("This test requires to be compiled with XCB-XTEST"); +#endif +} + // Current state // m_actionA: (sequenceA, sequenceB) // m_actionB: (,) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/autotests/kglobalshortcuttest.h new/kglobalaccel-5.9.0/autotests/kglobalshortcuttest.h --- old/kglobalaccel-5.8.0/autotests/kglobalshortcuttest.h 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/autotests/kglobalshortcuttest.h 2015-04-04 14:05:12.000000000 +0200 @@ -32,6 +32,7 @@ private Q_SLOTS: void initTestCase(); void testSetShortcut(); + void testActivateShortcut(); void testFindActionByKey(); void testChangeShortcut(); void testStealShortcut(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/po/fr/kglobalaccel5_qt.po new/kglobalaccel-5.9.0/po/fr/kglobalaccel5_qt.po --- old/kglobalaccel-5.8.0/po/fr/kglobalaccel5_qt.po 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/po/fr/kglobalaccel5_qt.po 2015-04-04 14:05:12.000000000 +0200 @@ -24,10 +24,10 @@ "PO-Revision-Date: 2014-03-16 18:32+0100\n" "Last-Translator: Sebastien Renard <[email protected]>\n" "Language-Team: French <[email protected]>\n" -"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Lokalize 1.5\n" "X-Environment: kde\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/src/kglobalaccel.cpp new/kglobalaccel-5.9.0/src/kglobalaccel.cpp --- old/kglobalaccel-5.8.0/src/kglobalaccel.cpp 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/src/kglobalaccel.cpp 2015-04-04 14:05:12.000000000 +0200 @@ -115,8 +115,6 @@ q); q->connect(watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)), q, SLOT(_k_serviceOwnerChanged(QString,QString,QString))); - - actionsWidget.setObjectName(QStringLiteral("KGlobalAccel/actionsWidget")); } KGlobalAccel::KGlobalAccel() @@ -129,8 +127,6 @@ connect(&d->iface, SIGNAL(yourShortcutGotChanged(QStringList,QList<int>)), SLOT(_k_shortcutGotChanged(QStringList,QList<int>))); - - d->actionsWidget.installEventFilter(this); } KGlobalAccel::~KGlobalAccel() @@ -219,8 +215,14 @@ nameToAction.insertMulti(actionId.at(KGlobalAccel::ActionUnique), action); actions.insert(action); - actionsWidget.addAction(action); iface.doRegister(actionId); + + QObject::connect(action, &QObject::destroyed, [this, action](QObject *) { + if (actions.contains(action) && (actionShortcuts.contains(action) || actionDefaultShortcuts.contains(action))) { + remove(action, KGlobalAccelPrivate::SetInactive); + } + }); + return true; } @@ -239,7 +241,6 @@ nameToAction.remove(actionId.at(KGlobalAccel::ActionUnique), action); actions.remove(action); - actionsWidget.removeAction(action); if (removal == UnRegister) { // Complete removal of the shortcut is requested @@ -462,7 +463,6 @@ nameToAction.clear(); actions.clear(); Q_FOREACH (QAction *const action, allActions) { - actionsWidget.removeAction(action); if (doRegister(action)) { updateGlobalShortcut(action, ActiveShortcut, KGlobalAccel::Autoloading); } @@ -654,20 +654,6 @@ bool KGlobalAccel::eventFilter(QObject *watched, QEvent *event) { - // A bit of a hack, but we add all the known actions to actionsWidget - // in order to be notified when they get deleted as we'll get an ActionRemoved - // event first. - // Using the destroyed() signal wouldn't cut it as the action would be just - // a QObject at that point and we'd miss some fields to do our job. - - if (watched == &d->actionsWidget && event->type() == QEvent::ActionRemoved) { - QActionEvent *e = static_cast<QActionEvent *>(event); - QAction *action = e->action(); - if (d->actions.contains(action) && hasShortcut(action)) { - d->remove(action, KGlobalAccelPrivate::SetInactive); - } - } - return QObject::eventFilter(watched, event); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/src/kglobalaccel.h new/kglobalaccel-5.9.0/src/kglobalaccel.h --- old/kglobalaccel-5.8.0/src/kglobalaccel.h 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/src/kglobalaccel.h 2015-04-04 14:05:12.000000000 +0200 @@ -30,7 +30,6 @@ #include <QList> class QAction; -class QWidget; class OrgKdeKglobalaccelComponentInterface; /** @@ -334,6 +333,7 @@ #endif /** + * TODO KF6 remove * @internal */ bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kglobalaccel-5.8.0/src/kglobalaccel_p.h new/kglobalaccel-5.9.0/src/kglobalaccel_p.h --- old/kglobalaccel-5.8.0/src/kglobalaccel_p.h 2015-03-07 15:43:05.000000000 +0100 +++ new/kglobalaccel-5.9.0/src/kglobalaccel_p.h 2015-04-04 14:05:12.000000000 +0200 @@ -26,7 +26,6 @@ #include <QtCore/QStringList> #include <QKeySequence> #include <QList> -#include <QWidget> #include "kglobalaccel.h" #include "kglobalaccel_interface.h" @@ -81,7 +80,6 @@ //for all actions with (isEnabled() && globalShortcutAllowed()) QMultiHash<QString, QAction *> nameToAction; QSet<QAction *> actions; - QWidget actionsWidget; // Used to know when an action is deleted (via event filter) bool enabled;
