Hello community,

here is the log from the commit of package kgoldrunner for openSUSE:Factory 
checked in at 2015-10-03 20:20:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kgoldrunner (Old)
 and      /work/SRC/openSUSE:Factory/.kgoldrunner.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kgoldrunner"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kgoldrunner/kgoldrunner.changes  2015-07-14 
17:34:41.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kgoldrunner.new/kgoldrunner.changes     
2015-10-03 20:21:01.000000000 +0200
@@ -1,0 +2,23 @@
+Sun Sep 13 19:14:38 UTC 2015 - [email protected]
+
+- Update to KDE Applications 15.08.1
+   * KDE Applications 15.08.1 
+   * https://www.kde.org/announcements/announce-applications-15.08.1.php
+
+
+-------------------------------------------------------------------
+Wed Aug 19 19:43:16 UTC 2015 - [email protected]
+
+- Update to KDE Applications 15.08.0
+   * KDE Applications 15.08.0
+   * https://www.kde.org/announcements/announce-applications-15.08.0.php
+
+-------------------------------------------------------------------
+Fri Aug  7 06:54:42 UTC 2015 - [email protected]
+
+- Update to KDE Applications 15.07.90
+   * KDE Applications 15.08.0 RC1
+   * https://www.kde.org/announcements/announce-applications-15.07.90.php
+
+
+-------------------------------------------------------------------

Old:
----
  kgoldrunner-15.04.3.tar.xz

New:
----
  kgoldrunner-15.08.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kgoldrunner.spec ++++++
--- /var/tmp/diff_new_pack.laHbiF/_old  2015-10-03 20:21:02.000000000 +0200
+++ /var/tmp/diff_new_pack.laHbiF/_new  2015-10-03 20:21:02.000000000 +0200
@@ -23,7 +23,7 @@
 License:        GPL-2.0+
 Group:          Amusements/Games/Action/Arcade
 Url:            http://www.kde.org
-Version:        15.04.3
+Version:        15.08.1
 Release:        0
 Source0:        kgoldrunner-%{version}.tar.xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ kgoldrunner-15.04.3.tar.xz -> kgoldrunner-15.08.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgoldrunner-15.04.3/src/kgoldrunner.cpp 
new/kgoldrunner-15.08.1/src/kgoldrunner.cpp
--- old/kgoldrunner-15.04.3/src/kgoldrunner.cpp 2015-05-23 10:14:45.000000000 
+0200
+++ new/kgoldrunner-15.08.1/src/kgoldrunner.cpp 2015-09-08 06:09:58.000000000 
+0200
@@ -117,7 +117,7 @@
     // Get catalog for translation.
     KGlobal::locale()->insertCatalog ( QLatin1String( "libkdegames" ));
 
-    // Tell the KMainWindow that the KGrCanvas object is the main widget.
+    // Tell the KMainWindow that the KGrView object is the main widget.
     setCentralWidget (view);
 
     scene       = view->gameScene ();
@@ -165,6 +165,9 @@
     // Besides, we cannot render it until after the initial resize event (s).
     toolBar ("editToolbar")->hide();
 
+    // This is needed to make the arrow keys control the hero properly.
+    setUpKeyboardControl();
+
     // Do NOT paint main widget yet (title bar, menu, blank playfield).
     // Instead, queue a call to the "KGoldrunner_2" constructor extension.
     QMetaObject::invokeMethod (this, "KGoldrunner_2", Qt::QueuedConnection);
@@ -653,13 +656,13 @@
     KAction * a = actionCollection()->addAction (name);
     a->setText (text);
     a->setShortcut (shortcut);
+    a->setAutoRepeat (false);          // Avoid repeats of signals by QAction.
 
     // If this is a move-key, let keyPressEvent() through, instead of signal.
     if (mover) {
         a->setEnabled (false);
-    }
-    else {
-        a->setAutoRepeat (false);      // Else, prevent QAction signal repeat.
+       addAction (a);
+       return;
     }
 
     connect (a, SIGNAL (triggered(bool)), tempMapper, SLOT (map()));
@@ -667,6 +670,20 @@
     addAction (a);
 }
 
+void KGoldrunner::setUpKeyboardControl()
+{
+    // This is needed to ensure that the press and release of Up, Down, Left 
and
+    // Right keys (arrow-keys) are all received as required.
+    //
+    // If the KGoldrunner widget does not have the keyboard focus, arrow-keys
+    // provide only key-release events, which do not control the hero properly.
+    // Other keys provide both press and release events, regardless of focus.
+
+    this->setFocusPolicy (Qt::StrongFocus); // Tab or click gets the focus.
+    view->setFocusProxy (this);                    // So does a click on the 
play-area.
+    this->setFocus (Qt::OtherFocusReason);  // And we start by having the 
focus.
+}
+
 void KGoldrunner::keyPressEvent (QKeyEvent * event)
 {
     // For movement keys, all presses and releases are processed, thus allowing
@@ -686,28 +703,35 @@
 
 bool KGoldrunner::identifyMoveAction (QKeyEvent * event, bool pressed)
 {
-    bool result = false;
-    if (! event->isAutoRepeat()) {
-        QKeySequence keystroke (event->key() + event->modifiers());
-        result = true;
-
-        if ((ACTION ("move_left"))->shortcuts().contains(keystroke)) {
-            game->kbControl (LEFT, pressed);
-        }
-        else if ((ACTION ("move_right"))->shortcuts().contains(keystroke)) {
-            game->kbControl (RIGHT, pressed);
-        }
-        else if ((ACTION ("move_up"))->shortcuts().contains(keystroke)) {
-            game->kbControl (UP, pressed);
-        }
-        else if ((ACTION ("move_down"))->shortcuts().contains(keystroke)) {
-            game->kbControl (DOWN, pressed);
-        }
-        else {
-            result = false;
-        }
+    if (event->isAutoRepeat()) {
+        return false;          // Use only the release and the initial press.
+    }
+    Direction dirn = STAND;
+    // The arrow keys show the "Keypad" modifier as being set, even if the
+    // computer does NOT have a keypad (see Qt::KeypadModifier doco). It is
+    // OK to ignore the Keypad modifier (see the code for "qevent.cpp" at
+    // "bool QKeyEvent::matches(QKeySequence::StandardKey matchKey)"). The
+    // keys on the keypad usually have equivalents on the main keyboard.
+    QKeySequence keystroke (~(Qt::KeypadModifier) &
+                             (event->key() | event->modifiers()));
+    if ((ACTION ("move_left"))->shortcuts().contains(keystroke)) {
+        dirn = LEFT;
+    }
+    else if ((ACTION ("move_right"))->shortcuts().contains(keystroke)) {
+        dirn = RIGHT;
+    }
+    else if ((ACTION ("move_up"))->shortcuts().contains(keystroke)) {
+        dirn = UP;
+    }
+    else if ((ACTION ("move_down"))->shortcuts().contains(keystroke)) {
+        dirn = DOWN;
+    }
+    else {
+        return false;
     }
-    return result;
+    // Use this event to control the hero, if KEYBOARD mode is selected.
+    game->kbControl (dirn, pressed);
+    return true;
 }
 
 void KGoldrunner::viewFullScreen (bool activation)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgoldrunner-15.04.3/src/kgoldrunner.h 
new/kgoldrunner-15.08.1/src/kgoldrunner.h
--- old/kgoldrunner-15.04.3/src/kgoldrunner.h   2015-05-23 10:14:45.000000000 
+0200
+++ new/kgoldrunner-15.08.1/src/kgoldrunner.h   2015-09-08 06:09:58.000000000 
+0200
@@ -68,6 +68,7 @@
     void keyReleaseEvent (QKeyEvent * event);
 
 private:
+    void setUpKeyboardControl();
     bool identifyMoveAction (QKeyEvent * event, bool pressed);
 
 protected:


Reply via email to