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

List:       kde-commits
Subject:    [plasma-desktop/amourphious/keyboard] kcms/keyboard: removed addDevices from xinput_helper
From:       shivam makkar <amourphious1992 () gmail ! com>
Date:       2014-09-25 19:20:37
Message-ID: E1XXEaj-0004lO-K0 () scm ! kde ! org
[Download RAW message or body]

Git commit c6fd5ac22c302e32f67be41336f68026099e6bea by shivam makkar.
Committed on 01/06/2014 at 13:10.
Pushed by makkar into branch 'amourphious/keyboard'.

removed addDevices from xinput_helper

M  +3    -2    kcms/keyboard/kcm_keyboard_widget.cpp
M  +2    -8    kcms/keyboard/xinput_helper.cpp

http://commits.kde.org/plasma-desktop/c6fd5ac22c302e32f67be41336f68026099e6bea

diff --git a/kcms/keyboard/kcm_keyboard_widget.cpp b/kcms/keyboard/kcm_keyboard_widget.cpp
index 0a68938..b5a9ac0 100644
--- a/kcms/keyboard/kcm_keyboard_widget.cpp
+++ b/kcms/keyboard/kcm_keyboard_widget.cpp
@@ -20,7 +20,7 @@
 
 #include <kactioncollection.h>
 #include <kaction.h>
-#include <kdebug.h>
+#include <kaboutdata.h>
 #include <klocale.h>
 #include <kglobalsettings.h>
 #include <KGlobalAccel>
@@ -31,6 +31,7 @@
 #include <QPixmap>
 #include <QVBoxLayout>
 #include <QX11Info>
+#include <QDebug>
 
 #include "keyboard_config.h"
 #include "preview/keyboardpainter.h"
@@ -606,7 +607,7 @@ void KCMKeyboardWidget::updateXkbShortcutButton(const QString& groupName, QPushB
 		const OptionGroupInfo* optionGroupInfo = rules->getOptionGroupInfo(groupName);
 		const OptionInfo* optionInfo = optionGroupInfo->getOptionInfo(option);
 		if( optionInfo == NULL || optionInfo->description == NULL ) {
-			kError() << "Could not find option info for " << option;
+            qDebug() << "Could not find option info for " << option;
 			button->setText(grpOptions.first());
 		}
 		else {
diff --git a/kcms/keyboard/xinput_helper.cpp b/kcms/keyboard/xinput_helper.cpp
index a3c5395..9bcf442 100644
--- a/kcms/keyboard/xinput_helper.cpp
+++ b/kcms/keyboard/xinput_helper.cpp
@@ -38,7 +38,6 @@ static int DEVICE_NONE = 0;
 static int DEVICE_KEYBOARD = 1;
 static int DEVICE_POINTER = 2;
 static int connectedDevices;
-static int addedDevices = 0;
 
 XInputEventNotifier::XInputEventNotifier(QWidget* parent):
     XEventNotifier(parent), //TODO: destruct properly?
@@ -102,8 +101,7 @@ int XInputEventNotifier::getNewDeviceEventType(xcb_generic_event_t* event)
 	int newDeviceType = DEVICE_NONE;
     int ndevices;
     XDeviceInfo	*devices = XListInputDevices(QX11Info::display(), &ndevices);
-    if((ndevices > connectedDevices && addedDevices < 20)){
-        addedDevices++;
+    if((ndevices > connectedDevices)){
         qDebug() << "id:" << devices[ndevices - 1].id << "name:" << devices[ndevices - 1].name << "used \
                as:" << devices[ndevices-1].use;
         if( devices[ndevices - 1].use == IsXKeyboard || devices[ndevices - 1].use == \
IsXExtensionKeyboard ) {  if( isRealKeyboard(devices[ndevices - 1].name) ) {
@@ -115,14 +113,10 @@ int XInputEventNotifier::getNewDeviceEventType(xcb_generic_event_t* event)
             newDeviceType = DEVICE_POINTER;
             qDebug() << "new pointer device, id:" << devices[ndevices - 1].id << "name:" << \
devices[ndevices - 1].name << "used as:" << devices[ndevices - 1].use;  }
-    }
-    else{
         connectedDevices = ndevices;
-        addedDevices = 0;
     }
-    if(addedDevices == 20){
+    else{
         connectedDevices = ndevices;
-        addedDevices = 0;
     }
 	return newDeviceType;
 }


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

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