diff options
author | Michele Calgaro <[email protected]> | 2019-08-25 14:34:16 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-10-17 10:48:29 +0800 |
commit | 7c6e00a43ce3626e0450954ab1234c78048fcb58 (patch) | |
tree | b732915f07a411b97c02734de6be5f68827e7198 /tdeioslave/media/mediamanager | |
parent | b54fcda719b94c629c11e9b3462f2c9a2c5a9666 (diff) | |
download | tdebase-7c6e00a43ce3626e0450954ab1234c78048fcb58.tar.gz tdebase-7c6e00a43ce3626e0450954ab1234c78048fcb58.zip |
tdeioslave media: added LOCKED property to Medium class.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdeioslave/media/mediamanager')
-rw-r--r-- | tdeioslave/media/mediamanager/halbackend.cpp | 5 | ||||
-rw-r--r-- | tdeioslave/media/mediamanager/medialist.cpp | 2 | ||||
-rw-r--r-- | tdeioslave/media/mediamanager/tdehardwarebackend.cpp | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/tdeioslave/media/mediamanager/halbackend.cpp b/tdeioslave/media/mediamanager/halbackend.cpp index 6badc33c3..190dda774 100644 --- a/tdeioslave/media/mediamanager/halbackend.cpp +++ b/tdeioslave/media/mediamanager/halbackend.cpp @@ -517,6 +517,7 @@ void HALBackend::setVolumeProperties(Medium* medium) if (halClearVolume) { + medium->setLocked(false); medium->setMountable(true); medium->setDeviceNode(libhal_volume_get_device_file(halVolume)); medium->setClearDeviceUdi(clearUdiString); @@ -526,7 +527,8 @@ void HALBackend::setVolumeProperties(Medium* medium) } else { - medium->setMountable(true); + medium->setLocked(true); + medium->setMountable(false); medium->setDeviceNode(libhal_volume_get_device_file(halVolume)); medium->setClearDeviceUdi(TQString::null); medium->setMountPoint(TQString::null); @@ -537,6 +539,7 @@ void HALBackend::setVolumeProperties(Medium* medium) else { kdDebug(1219) << "HALBackend::setVolumeProperties : normal volume" << endl; + medium->setEncrypted(false); medium->setMountable(true); medium->setDeviceNode(libhal_volume_get_device_file(halVolume)); medium->setMountPoint(TQString::fromUtf8(libhal_volume_get_mount_point(halVolume))); diff --git a/tdeioslave/media/mediamanager/medialist.cpp b/tdeioslave/media/mediamanager/medialist.cpp index b2dd84c60..8ea9aec50 100644 --- a/tdeioslave/media/mediamanager/medialist.cpp +++ b/tdeioslave/media/mediamanager/medialist.cpp @@ -132,6 +132,8 @@ bool MediaList::changeMediumState(const Medium &medium, bool allowNotification) Medium *m = m_idMap[medium.id()]; + m->setEncrypted(medium.isEncrypted()); + m->setLocked(medium.isLocked()); m->setMountable(medium.isMountable()); if (medium.isMountable()) { diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp index 74180ca9a..bcd610ef4 100644 --- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp +++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp @@ -460,6 +460,7 @@ void TDEBackend::setVolumeProperties(Medium* medium) medium->setName(generateName(sdevice->deviceNode())); if (sdevice->isDiskOfType(TDEDiskDeviceType::LUKS) || sdevice->isDiskOfType(TDEDiskDeviceType::OtherCrypted)) { medium->setEncrypted(true); + medium->setLocked(!sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt)); } else { medium->setEncrypted(false); @@ -831,6 +832,7 @@ bool TDEBackend::setFloppyProperties(Medium* medium) medium->setName(generateName(sdevice->deviceNode())); if (sdevice->isDiskOfType(TDEDiskDeviceType::LUKS) || sdevice->isDiskOfType(TDEDiskDeviceType::OtherCrypted)) { medium->setEncrypted(true); + medium->setLocked(!sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt)); } else { medium->setEncrypted(false); |