summaryrefslogtreecommitdiffstats
path: root/kioslave/media/mediamanager
diff options
context:
space:
mode:
Diffstat (limited to 'kioslave/media/mediamanager')
-rw-r--r--kioslave/media/mediamanager/fstabbackend.cpp2
-rw-r--r--kioslave/media/mediamanager/halbackend.cpp8
-rw-r--r--kioslave/media/mediamanager/removablebackend.cpp2
-rw-r--r--kioslave/media/mediamanager/tdehardwarebackend.cpp24
4 files changed, 21 insertions, 15 deletions
diff --git a/kioslave/media/mediamanager/fstabbackend.cpp b/kioslave/media/mediamanager/fstabbackend.cpp
index 189f52aee..0ae99228e 100644
--- a/kioslave/media/mediamanager/fstabbackend.cpp
+++ b/kioslave/media/mediamanager/fstabbackend.cpp
@@ -281,7 +281,7 @@ void FstabBackend::handleFstabChange(bool allowNotification)
{
TQString name = generateName(dev, fs);
- Medium *m = new Medium(id, name);
+ Medium *m = new Medium(id, id, name);
m->mountableState(dev, mp, fs, false);
diff --git a/kioslave/media/mediamanager/halbackend.cpp b/kioslave/media/mediamanager/halbackend.cpp
index 575d7f729..ca0c4e26c 100644
--- a/kioslave/media/mediamanager/halbackend.cpp
+++ b/kioslave/media/mediamanager/halbackend.cpp
@@ -265,7 +265,7 @@ void HALBackend::AddDevice(const char *udi, bool allowNotification)
libhal_volume_free(halVolume);
/* Create medium */
- Medium* medium = new Medium(udi, "");
+ Medium* medium = new Medium(udi, udi, "");
setVolumeProperties(medium);
if ( isInFstab( medium ).isNull() )
@@ -304,7 +304,7 @@ void HALBackend::AddDevice(const char *udi, bool allowNotification)
if (! libhal_device_get_property_bool(m_halContext, udi, "storage.removable.media_available", NULL) )
allowNotification = false;
/* Create medium */
- Medium* medium = new Medium(udi, "");
+ Medium* medium = new Medium(udi, udi, "");
// if the storage has a volume, we ignore it
if ( setFloppyProperties(medium) )
m_mediaList.addMedium(medium, allowNotification);
@@ -322,7 +322,7 @@ void HALBackend::AddDevice(const char *udi, bool allowNotification)
)
{
/* Create medium */
- Medium* medium = new Medium(udi, "");
+ Medium* medium = new Medium(udi, udi, "");
setCameraProperties(medium);
m_mediaList.addMedium(medium, allowNotification);
return;
@@ -460,7 +460,7 @@ void HALBackend::ResetProperties(const char* mediumUdi, bool allowNotification)
}
}
- Medium* m = new Medium(mediumUdi, "");
+ Medium* m = new Medium(mediumUdi, mediumUdi, "");
if (libhal_device_query_capability(m_halContext, mediumUdi, "volume", NULL))
setVolumeProperties(m);
diff --git a/kioslave/media/mediamanager/removablebackend.cpp b/kioslave/media/mediamanager/removablebackend.cpp
index f307ee2f8..6b83ae1ea 100644
--- a/kioslave/media/mediamanager/removablebackend.cpp
+++ b/kioslave/media/mediamanager/removablebackend.cpp
@@ -62,7 +62,7 @@ bool RemovableBackend::plug(const TQString &devNode, const TQString &label)
if (!m_removableIds.contains(id))
{
- Medium *medium = new Medium(id, name);
+ Medium *medium = new Medium(id, id, name);
medium->mountableState(devNode, TQString::null,
TQString::null, false);
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 == "") {