summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediamanager/medialist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeioslave/media/mediamanager/medialist.cpp')
-rw-r--r--tdeioslave/media/mediamanager/medialist.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tdeioslave/media/mediamanager/medialist.cpp b/tdeioslave/media/mediamanager/medialist.cpp
index dc0a108d6..b2dd84c60 100644
--- a/tdeioslave/media/mediamanager/medialist.cpp
+++ b/tdeioslave/media/mediamanager/medialist.cpp
@@ -135,7 +135,6 @@ bool MediaList::changeMediumState(const Medium &medium, bool allowNotification)
m->setMountable(medium.isMountable());
if (medium.isMountable())
{
- m->setMountable(true);
m->setDeviceNode(medium.deviceNode());
m->setClearDeviceUdi(medium.clearDeviceUdi());
m->setMountPoint(medium.mountPoint());
@@ -226,6 +225,11 @@ bool MediaList::changeMediumState(const TQString &id,
Medium *medium = m_idMap[id];
+ if (medium->deviceNode().isEmpty() || !medium->isMountable())
+ {
+ return false;
+ }
+
medium->setMountable(true);
medium->setDeviceNode(deviceNode);
medium->setMountPoint(mountPoint);
@@ -267,13 +271,13 @@ bool MediaList::changeMediumState(const TQString &id, bool mounted,
Medium *medium = m_idMap[id];
- medium->setMountable(true);
- medium->setMounted(mounted);
if (medium->deviceNode().isEmpty() || !medium->isMountable())
{
return false;
}
+ medium->setMounted(mounted);
+
if (!mimeType.isEmpty())
{
medium->setMimeType( mimeType );