diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-02 02:41:08 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-02 02:41:08 -0500 |
commit | d36f60966edf14f1420b8226951f6f26cd48c731 (patch) | |
tree | 3d88b60e0a0c0a011234a321253bb90fc3c47111 /kioslave/media/mediamanager/tdehardwarebackend.cpp | |
parent | 96bfcec9d751b7255163e548b0bbb91b7c7b3332 (diff) | |
download | tdebase-d36f60966edf14f1420b8226951f6f26cd48c731.tar.gz tdebase-d36f60966edf14f1420b8226951f6f26cd48c731.zip |
Fix TDEHWLib media backend user device labels
Diffstat (limited to 'kioslave/media/mediamanager/tdehardwarebackend.cpp')
-rw-r--r-- | kioslave/media/mediamanager/tdehardwarebackend.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/kioslave/media/mediamanager/tdehardwarebackend.cpp b/kioslave/media/mediamanager/tdehardwarebackend.cpp index 65f287305..189d0015e 100644 --- a/kioslave/media/mediamanager/tdehardwarebackend.cpp +++ b/kioslave/media/mediamanager/tdehardwarebackend.cpp @@ -155,7 +155,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification) } else { // Create medium - Medium* medium = new Medium(sdevice->uniqueID(), ""); + Medium* medium = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), ""); setVolumeProperties(medium); // Do not list the LUKS backend device if it has been unlocked elsewhere @@ -193,7 +193,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification) ) { // Create medium - Medium* medium = new Medium(sdevice->uniqueID(), ""); + Medium* medium = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), ""); setVolumeProperties(medium); // Insert medium into list @@ -228,7 +228,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification) } else { // Create medium - Medium* medium = new Medium(sdevice->uniqueID(), ""); + Medium* medium = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), ""); setFloppyProperties(medium); @@ -256,7 +256,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification) if (KProtocolInfo::isKnownProtocol( TQString("camera") ) ) { // Create medium - Medium* medium = new Medium(sdevice->uniqueID(), ""); + Medium* medium = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), ""); setCameraProperties(medium); m_mediaList.addMedium(medium, allowNotification); @@ -305,7 +305,7 @@ void TDEBackend::ResetProperties(TDEStorageDevice * sdevice, bool allowNotificat } } - Medium* m = new Medium(sdevice->uniqueID(), ""); + Medium* m = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), ""); // Keep these conditions in sync with ::AddDevice above, OR ELSE!!! // BEGIN @@ -1335,11 +1335,17 @@ TQString TDEBackend::driveUDIFromDeviceUID(TQString uuid) { TQString ret; if (sdevice) { ret = sdevice->diskUUID(); - if (ret == "") { - ret = sdevice->deviceNode(); + if (ret != "") { + ret = "volume_uuid_" + ret; } - if (ret == "") { - ret = sdevice->uniqueID(); + else { + ret = sdevice->deviceNode(); + if (ret != "") { + ret = "device_node_" + ret; + } + else { + ret = sdevice->uniqueID(); + } } } if (ret == "") { |