diff options
Diffstat (limited to 'tdecore/tdehardwaredevices.cpp')
-rw-r--r-- | tdecore/tdehardwaredevices.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 55a5b4817..c98c21a48 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -1395,6 +1395,21 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD } } + // Most of the timeudev doesn't barf up a device driver either, so go after it manually... + if (devicedriver.isNull()) { + TQString driverSymlink = udev_device_get_syspath(dev); + TQString driverSymlinkDir = driverSymlink; + driverSymlink.append("/device/driver"); + driverSymlinkDir.append("/device/"); + TQFileInfo dirfi(driverSymlink); + if (dirfi.isSymLink()) { + char* collapsedPath = realpath((driverSymlinkDir + dirfi.readLink()).ascii(), NULL); + devicedriver = TQString(collapsedPath); + free(collapsedPath); + devicedriver.remove(0, devicedriver.findRev("/")+1); + } + } + // Classify generic device type and create appropriate object if ((devicetype == "disk") || (devicetype == "partition") |