summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdehardwaredevices.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-08-24 10:35:16 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-08-24 10:35:16 -0500
commit5fdf839b35497b5470dc9e27e8503083f0b55266 (patch)
tree7d2a87df9b6f815ba231f7eafd6c18135da689cc /tdecore/tdehw/tdehardwaredevices.cpp
parent8545b92094cab2bbfdd2a67642fa5931b0d548e3 (diff)
downloadtdelibs-5fdf839b35497b5470dc9e27e8503083f0b55266.tar.gz
tdelibs-5fdf839b35497b5470dc9e27e8503083f0b55266.zip
Add cryptographic card device type
Add hub device type Fix incorrect USB subclass read
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.cpp')
-rw-r--r--tdecore/tdehw/tdehardwaredevices.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index b0162f6fe..d2fd7e2f3 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -1383,12 +1383,18 @@ TDEGenericDeviceType::TDEGenericDeviceType readGenericDeviceTypeFromString(TQStr
else if (query == "Bridge") {
ret = TDEGenericDeviceType::Bridge;
}
+ else if (query == "Hub") {
+ ret = TDEGenericDeviceType::Hub;
+ }
else if (query == "Platform") {
ret = TDEGenericDeviceType::Platform;
}
else if (query == "Cryptography") {
ret = TDEGenericDeviceType::Cryptography;
}
+ else if (query == "CryptographicCard") {
+ ret = TDEGenericDeviceType::CryptographicCard;
+ }
else if (query == "Event") {
ret = TDEGenericDeviceType::Event;
}
@@ -2261,7 +2267,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
TQFile ifaceprotofile(current_path + "/bInterfaceClass");
if (ifaceprotofile.open(IO_ReadOnly)) {
TQTextStream stream( &ifaceprotofile );
- usbInterfaceClass = stream.readLine().toUInt();
+ usbInterfaceClass = stream.readLine().toUInt(NULL, 16);
ifaceprotofile.close();
}
}
@@ -2271,7 +2277,7 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
TQFile ifaceprotofile(current_path + "/bInterfaceSubClass");
if (ifaceprotofile.open(IO_ReadOnly)) {
TQTextStream stream( &ifaceprotofile );
- usbInterfaceSubClass = stream.readLine().toUInt();
+ usbInterfaceSubClass = stream.readLine().toUInt(NULL, 16);
ifaceprotofile.close();
}
}
@@ -2281,10 +2287,18 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
TQFile ifaceprotofile(current_path + "/bInterfaceProtocol");
if (ifaceprotofile.open(IO_ReadOnly)) {
TQTextStream stream( &ifaceprotofile );
- usbInterfaceProtocol = stream.readLine().toUInt();
+ usbInterfaceProtocol = stream.readLine().toUInt(NULL, 16);
ifaceprotofile.close();
}
}
+ if (usbInterfaceClass == 9) {
+ // Hub
+ if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Hub);
+ }
+ if (usbInterfaceClass == 11) {
+ // Smart Card Reader
+ if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::CryptographicCard);
+ }
if ((usbInterfaceClass == 6) && (usbInterfaceSubClass == 1) && (usbInterfaceProtocol == 1)) {
// PictBridge
if (!device) {
@@ -4069,12 +4083,18 @@ TQString TDEHardwareDevices::getFriendlyDeviceTypeStringFromType(TDEGenericDevic
else if (query == TDEGenericDeviceType::Bridge) {
ret = i18n("Bridge");
}
+ else if (query == TDEGenericDeviceType::Hub) {
+ ret = i18n("Hub");
+ }
else if (query == TDEGenericDeviceType::Platform) {
ret = i18n("Platform");
}
else if (query == TDEGenericDeviceType::Cryptography) {
ret = i18n("Cryptography");
}
+ else if (query == TDEGenericDeviceType::CryptographicCard) {
+ ret = i18n("Cryptographic Card");
+ }
else if (query == TDEGenericDeviceType::Event) {
ret = i18n("Platform Event");
}
@@ -4224,12 +4244,18 @@ TQPixmap TDEHardwareDevices::getDeviceTypeIconFromType(TDEGenericDeviceType::TDE
else if (query == TDEGenericDeviceType::Bridge) {
ret = DesktopIcon("kcmpci", size);
}
+ else if (query == TDEGenericDeviceType::Hub) {
+ ret = DesktopIcon("usb", size);
+ }
else if (query == TDEGenericDeviceType::Platform) {
ret = DesktopIcon("preferences-system", size);
}
else if (query == TDEGenericDeviceType::Cryptography) {
ret = DesktopIcon("password", size);
}
+ else if (query == TDEGenericDeviceType::CryptographicCard) {
+ ret = DesktopIcon("password", size);
+ }
else if (query == TDEGenericDeviceType::Event) {
ret = DesktopIcon("preferences-system", size);
}