From b54fcda719b94c629c11e9b3462f2c9a2c5a9666 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 25 Aug 2019 11:21:21 +0900 Subject: tdeioslave media: fixed handling of mountable state for encrypted devices. Signed-off-by: Michele Calgaro --- tdeioslave/media/mediamanager/medialist.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tdeioslave/media/mediamanager/medialist.cpp') 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 ); -- cgit v1.2.1