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

List:       kde-commits
Subject:    [gluon] /
From:       Laszlo Papp <djszapi () archlinux ! us>
Date:       2011-01-23 8:18:37
Message-ID: 20110123081837.0E41AA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 4933350684adf1555d7c07218a5152071e989fb8 by Laszlo Papp
Pushed by lpapp into branch master

Add a deviceType() switch in the buttonName method and leftover cleanup.

M  +1    -0    engine/components/input/keyboardinput/keyboardinputcomponent.cpp     
M  +1    -3    engine/components/input/keyboardinput/keyboardinputcomponent.h     
M  +1    -0    engine/components/input/mouseinput/mouseinputcomponent.cpp     
M  +1    -3    engine/components/input/mouseinput/mouseinputcomponent.h     
M  +1    -3    engine/components/input/touchinput/touchinputcomponent.cpp     
M  +1    -5    engine/components/input/touchinput/touchinputcomponent.h     
M  +0    -1    input/inputbuffer.h     
M  +1    -2    input/inputbufferprivate.h     
M  +7    -3    input/inputdevice.cpp     

http://commits.kde.org/fad2ae7b/4933350684adf1555d7c07218a5152071e989fb8

diff --git a/engine/components/input/keyboardinput/keyboardinputcomponent.cpp \
b/engine/components/input/keyboardinput/keyboardinputcomponent.cpp index \
                2887264..01be1e3 100644
--- a/engine/components/input/keyboardinput/keyboardinputcomponent.cpp
+++ b/engine/components/input/keyboardinput/keyboardinputcomponent.cpp
@@ -2,6 +2,7 @@
  * This file is part of the Gluon Development Platform
  * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
  * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
+ * Copyright (c) 2010 Laszlo Papp <djszapi@archlinux.us>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/engine/components/input/keyboardinput/keyboardinputcomponent.h \
b/engine/components/input/keyboardinput/keyboardinputcomponent.h index \
                dfdc654..cb00daa 100644
--- a/engine/components/input/keyboardinput/keyboardinputcomponent.h
+++ b/engine/components/input/keyboardinput/keyboardinputcomponent.h
@@ -2,6 +2,7 @@
  * This file is part of the Gluon Development Platform
  * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
  * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
+ * Copyright (c) 2010 Laszlo Papp <djszapi@archlinux.us>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,14 +19,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
 #ifndef KEYBOARDINPUTCOMPONENT_H
 #define KEYBOARDINPUTCOMPONENT_H
 
 #include "component.h"
 
-#include "gluonbuttons.h"
-
 namespace GluonInput
 {
     class Keyboard;
diff --git a/engine/components/input/mouseinput/mouseinputcomponent.cpp \
b/engine/components/input/mouseinput/mouseinputcomponent.cpp index d726afe..11f8667 \
                100644
--- a/engine/components/input/mouseinput/mouseinputcomponent.cpp
+++ b/engine/components/input/mouseinput/mouseinputcomponent.cpp
@@ -2,6 +2,7 @@
  * This file is part of the Gluon Development Platform
  * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
  * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
+ * Copyright (c) 2010 Laszlo Papp <djszapi@archlinux.us>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/engine/components/input/mouseinput/mouseinputcomponent.h \
b/engine/components/input/mouseinput/mouseinputcomponent.h index b64d923..b4ad0bf \
                100644
--- a/engine/components/input/mouseinput/mouseinputcomponent.h
+++ b/engine/components/input/mouseinput/mouseinputcomponent.h
@@ -2,6 +2,7 @@
  * This file is part of the Gluon Development Platform
  * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
  * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
+ * Copyright (c) 2010 Laszlo Papp <djszapi@archlinux.us>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,14 +19,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
 #ifndef MOUSEINPUTCOMPONENT_H
 #define MOUSEINPUTCOMPONENT_H
 
 #include "component.h"
 
-#include "gluonbuttons.h"
-
 namespace GluonInput
 {
     class Mouse;
diff --git a/engine/components/input/touchinput/touchinputcomponent.cpp \
b/engine/components/input/touchinput/touchinputcomponent.cpp index 824ea88..19e0930 \
                100644
--- a/engine/components/input/touchinput/touchinputcomponent.cpp
+++ b/engine/components/input/touchinput/touchinputcomponent.cpp
@@ -1,7 +1,6 @@
 /******************************************************************************
  * This file is part of the Gluon Development Platform
- * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
- * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
+ * Copyright (c) 2010 Laszlo Papp <djszapi@archlinux.us>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,7 +17,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
 #include "touchinputcomponent.h"
 #include "input/inputmanager.h"
 
diff --git a/engine/components/input/touchinput/touchinputcomponent.h \
b/engine/components/input/touchinput/touchinputcomponent.h index e1c13a8..f22b41c \
                100644
--- a/engine/components/input/touchinput/touchinputcomponent.h
+++ b/engine/components/input/touchinput/touchinputcomponent.h
@@ -1,7 +1,6 @@
 /******************************************************************************
  * This file is part of the Gluon Development Platform
- * Copyright (C) 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
- * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
+ * Copyright (c) 2010 Laszlo Papp <djszapi@archlinux.us>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,14 +17,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
 #ifndef TOUCHINPUTCOMPONENT_H
 #define TOUCHINPUTCOMPONENT_H
 
 #include "component.h"
 
-#include "gluonbuttons.h"
-
 namespace GluonInput
 {
     class Touch;
diff --git a/input/inputbuffer.h b/input/inputbuffer.h
index 0245fa7..cd083d7 100644
--- a/input/inputbuffer.h
+++ b/input/inputbuffer.h
@@ -21,7 +21,6 @@
 #define INPUTBUFFER_H
 
 #include "gluon_input_export.h"
-#include "gluonbuttons.h"
 
 #include <QtCore/QObject>
 #include <QtCore/QSharedData>
diff --git a/input/inputbufferprivate.h b/input/inputbufferprivate.h
index 63cbcb5..471c9ec 100644
--- a/input/inputbufferprivate.h
+++ b/input/inputbufferprivate.h
@@ -17,6 +17,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
+
 #ifndef INPUTBUFFERPRIVATE_H
 #define INPUTBUFFERPRIVATE_H
 
@@ -24,8 +25,6 @@
 #include <QtCore/QHash>
 #include <QtCore/QQueue>
 
-//#include "keydefinitions.h"
-
 namespace GluonInput
 {
     class InputBufferPrivate : public QSharedData
diff --git a/input/inputdevice.cpp b/input/inputdevice.cpp
index 73dd64f..926bce3 100644
--- a/input/inputdevice.cpp
+++ b/input/inputdevice.cpp
@@ -162,7 +162,13 @@ bool InputDevice::buttonPressed( int code ) const
 
 QString InputDevice::buttonName( int code ) const
 {
-    return QKeySequence(code).toString();
+    switch (deviceType())
+    {
+        case KeyboardDevice:
+            return QKeySequence(code).toString();
+        default:
+            return "Unknown";
+    }
 }
 
 QString InputDevice::axisName( int code ) const
@@ -172,10 +178,8 @@ QString InputDevice::axisName( int code ) const
         case MouseDevice:
         case JoystickDevice:
             return GluonButtons::instance()->axisName( deviceType(), code );
-            break;
         default:
             return "Unknown";
-            break;
     }
 }
 


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

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