From 417491794161bd9ecc53003b9c5676cd96ca942b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 21 Aug 2012 12:20:34 -0500 Subject: Fix network device detection --- cmake | 2 +- tdecore/tdehardwaredevices.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake b/cmake index cd6c8614e..477d071b5 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit cd6c8614e972ea4ffbd7316d473b7b6e48ea67ff +Subproject commit 477d071b5db5544ace5449f0c2eea6d5c01d693b diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 100a24c8c..8fdbcf07e 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -3518,8 +3518,10 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD if (device->type() == TDEGenericDeviceType::Network) { // Network devices don't have devices nodes per se, but we can at least return the Linux network name... TQString potentialdevicenode = systempath; + if (potentialdevicenode.endsWith("/")) potentialdevicenode.truncate(potentialdevicenode.length()-1); potentialdevicenode.remove(0, potentialdevicenode.findRev("/")+1); TQString potentialparentnode = systempath; + if (potentialparentnode.endsWith("/")) potentialparentnode.truncate(potentialparentnode.length()-1); potentialparentnode.remove(0, potentialparentnode.findRev("/", potentialparentnode.findRev("/")-1)+1); if (potentialparentnode.startsWith("net/")) { devicenode = potentialdevicenode; -- cgit v1.2.1