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/libmediacommon/medium.cpp | |
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/libmediacommon/medium.cpp')
-rw-r--r-- | tdeioslave/media/libmediacommon/medium.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tdeioslave/media/libmediacommon/medium.cpp b/tdeioslave/media/libmediacommon/medium.cpp index c185a8c9f..cb06a5eb8 100644 --- a/tdeioslave/media/libmediacommon/medium.cpp +++ b/tdeioslave/media/libmediacommon/medium.cpp @@ -43,6 +43,7 @@ void Medium::initMedium() m_properties += TQString::null; // CLEAR_DEVICE_UDI m_properties += "false"; // HIDDEN m_properties += "false"; // SOFT_HIDDEN + m_properties += "false"; // LOCKED } Medium::Medium(const TQString id, TQString uuid, const TQString name) @@ -86,6 +87,7 @@ const Medium Medium::create(const TQStringList &properties) m.m_properties[CLEAR_DEVICE_UDI] = properties[CLEAR_DEVICE_UDI]; m.m_properties[HIDDEN] = properties[HIDDEN]; m.m_properties[SOFT_HIDDEN] = properties[SOFT_HIDDEN]; + m.m_properties[LOCKED] = properties[LOCKED]; } return m; @@ -221,9 +223,13 @@ void Medium::setIconName(const TQString &iconName) m_properties[ICON_NAME] = iconName; } -void Medium::setEncrypted(bool state) +void Medium::setEncrypted(bool encrypted) { - m_properties[ENCRYPTED] = ( state ? "true" : "false" ); + m_properties[ENCRYPTED] = encrypted ? "true" : "false"; + if (!encrypted) + { + setLocked(false); + } } void Medium::setClearDeviceUdi(const TQString &clearDeviceUdi) @@ -233,12 +239,17 @@ void Medium::setClearDeviceUdi(const TQString &clearDeviceUdi) void Medium::setHidden(bool state) { - m_properties[HIDDEN] = ( state ? "true" : "false" ); + m_properties[HIDDEN] = state ? "true" : "false"; } void Medium::setSoftHidden(bool state) { - m_properties[SOFT_HIDDEN] = ( state ? "true" : "false" ); + m_properties[SOFT_HIDDEN] = state ? "true" : "false"; +} + +void Medium::setLocked(bool locked) +{ + m_properties[LOCKED] = locked ? "true" : "false"; } bool Medium::needMounting() const @@ -246,9 +257,9 @@ bool Medium::needMounting() const return isMountable() && !isMounted(); } -bool Medium::needDecryption() const +bool Medium::needUnlocking() const { - return isEncrypted() && clearDeviceUdi().isEmpty(); + return isEncrypted() && isLocked(); } KURL Medium::prettyBaseURL() const |