diff options
author | Michele Calgaro <[email protected]> | 2019-08-25 11:21:21 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-10-17 10:48:29 +0800 |
commit | b54fcda719b94c629c11e9b3462f2c9a2c5a9666 (patch) | |
tree | b3541609fd0e5aca04427b1c4ff759a9390c77b9 /tdeioslave/media/mediamanager/medialist.cpp | |
parent | d34f23f403e82f352e4c5d4e20966bcba2bec8c6 (diff) | |
download | tdebase-b54fcda719b94c629c11e9b3462f2c9a2c5a9666.tar.gz tdebase-b54fcda719b94c629c11e9b3462f2c9a2c5a9666.zip |
tdeioslave media: fixed handling of mountable state for encrypted devices.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdeioslave/media/mediamanager/medialist.cpp')
-rw-r--r-- | tdeioslave/media/mediamanager/medialist.cpp | 10 |
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 ); |