From d15fe834b1c98aa86c2f24602552ec58a9e16f93 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 23 Jul 2016 18:28:25 -0500 Subject: Add nvmem device type --- tdecore/tdehw/tdehardwaredevices.cpp | 12 ++++++++++++ tdecore/tdehw/tdehwcommontypes.h | 1 + 2 files changed, 13 insertions(+) (limited to 'tdecore') diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index e9c7daff1..ff5484a59 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -1336,6 +1336,9 @@ TDEGenericDeviceType::TDEGenericDeviceType readGenericDeviceTypeFromString(TQStr else if (query == "Network") { ret = TDEGenericDeviceType::Network; } + else if (query == "NonvolatileMemory") { + ret = TDEGenericDeviceType::NonvolatileMemory; + } else if (query == "Printer") { ret = TDEGenericDeviceType::Printer; } @@ -2218,6 +2221,9 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Platform); } } + if (devicesubsystem == "nvmem") { + if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::NonvolatileMemory); + } if (devicesubsystem == "serio") { if (devicedriver.contains("atkbd")) { if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Keyboard); @@ -4170,6 +4176,9 @@ TQString TDEHardwareDevices::getFriendlyDeviceTypeStringFromType(TDEGenericDevic else if (query == TDEGenericDeviceType::Network) { ret = i18n("Network"); } + else if (query == TDEGenericDeviceType::NonvolatileMemory) { + ret = i18n("Nonvolatile Memory"); + } else if (query == TDEGenericDeviceType::Printer) { ret = i18n("Printer"); } @@ -4340,6 +4349,9 @@ TQPixmap TDEHardwareDevices::getDeviceTypeIconFromType(TDEGenericDeviceType::TDE else if (query == TDEGenericDeviceType::Network) { ret = DesktopIcon("kcmpci", size); } + else if (query == TDEGenericDeviceType::NonvolatileMemory) { + ret = DesktopIcon("memory", size); + } else if (query == TDEGenericDeviceType::Printer) { ret = DesktopIcon("printer", size); } diff --git a/tdecore/tdehw/tdehwcommontypes.h b/tdecore/tdehw/tdehwcommontypes.h index dd32b9a2d..bc4eaeecf 100644 --- a/tdecore/tdehw/tdehwcommontypes.h +++ b/tdecore/tdehw/tdehwcommontypes.h @@ -41,6 +41,7 @@ enum TDEGenericDeviceType { Modem, Monitor, Network, + NonvolatileMemory, Printer, Scanner, Sound, -- cgit v1.2.1