@@ -101,8 +101,6 @@ void QInputDeviceInfoPrivate::init()
101 if (!iDevice)
101 if (!iDevice)
102 continue;
102 continue;
104− qDebug() << "*** ADDING DEVICE" << eventPath;
106 iDevice->setTypes(getInputTypes(dev));
104 iDevice->setTypes(getInputTypes(dev));
108 if (iDevice->switches().count() > 0 && iDevice->buttons().count() == 0)
106 if (iDevice->switches().count() > 0 && iDevice->buttons().count() == 0)
@@ -125,12 +123,6 @@ void QInputDeviceInfoPrivate::init()
126QInputDeviceInfo::InputTypes QInputDeviceInfoPrivate::getInputTypes( struct udev_device *dev)
124QInputDeviceInfo::InputTypes QInputDeviceInfoPrivate::getInputTypes( struct udev_device *dev)
128− qDebug() << "******* have input type Keyboard" << udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD");
129− qDebug() << "******* have input type Mouse" << udev_device_get_property_value(dev, "ID_INPUT_MOUSE");
130− qDebug() << "******* have input type Touchpad" << udev_device_get_property_value(dev, "ID_INPUT_TOUCHPAD");
131− qDebug() << "******* have input type Touchscreen" << udev_device_get_property_value(dev, "ID_INPUT_TOUCHSCREEN");
132− qDebug() << "******* have input type Tablet" << udev_device_get_property_value(dev, "ID_INPUT_TABLET");
133− qDebug() << "******* have input type joystick" << udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK");
134 QInputDeviceInfo::InputTypes types = QInputDeviceInfo::Unknown;
126 QInputDeviceInfo::InputTypes types = QInputDeviceInfo::Unknown;
135 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 )
127 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 )
136 types |= QInputDeviceInfo::Keyboard;
128 types |= QInputDeviceInfo::Keyboard;
@@ -151,6 +143,7 @@ QInputDeviceInfo::InputTypes QInputDeviceInfoPrivate::getInputTypes( struct udev
151QInputDevice *QInputDeviceInfoPrivate::addDevice(const QString &path)
143QInputDevice *QInputDeviceInfoPrivate::addDevice(const QString &path)
153 QInputDevice *inputDevice = new QInputDevice(this);
145 QInputDevice *inputDevice = new QInputDevice(this);
146+ inputDevice->setDevicePath(path);
155 struct libevdev *dev = NULL;
148 struct libevdev *dev = NULL;
@@ -158,17 +151,15 @@ QInputDevice *QInputDeviceInfoPrivate::addDevice(const QString &path)
158 fd = open(path.toLatin1(), O_RDONLY|O_NONBLOCK);
151 fd = open(path.toLatin1(), O_RDONLY|O_NONBLOCK);
160 if (fd == -1) {
153 if (fd == -1) {
161− qDebug() << "Failed to open";
162 return inputDevice;
154 return inputDevice;
164 rc = libevdev_new_from_fd(fd, &dev);
156 rc = libevdev_new_from_fd(fd, &dev);
165 if (rc < 0) {
157 if (rc < 0) {
166− qDebug() << "Failed to init libevdev ("<< strerror(-rc) << ")";
158+ qWarning() << "Failed to init libevdev ("<< strerror(-rc) << ")";
167 return inputDevice;
159 return inputDevice;
170 inputDevice->setName(QString::fromLatin1(libevdev_get_name(dev)));
162 inputDevice->setName(QString::fromLatin1(libevdev_get_name(dev)));
171− inputDevice->setDevicePath(path);
172 for (int i = 0; i < EV_MAX; i++) {
163 for (int i = 0; i < EV_MAX; i++) {
173 if (i == EV_KEY || i == EV_SW || i == EV_REL
164 if (i == EV_KEY || i == EV_SW || i == EV_REL
174 || i == EV_REL || i == EV_ABS) {
165 || i == EV_REL || i == EV_ABS) {