diff options
author | Michele Calgaro <[email protected]> | 2019-06-16 22:55:14 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2019-07-09 10:19:34 +0900 |
commit | d2da293eaecf382e2fd2b6517b90df62ae21e127 (patch) | |
tree | d19288a7ffe4b2f85cb5a3a136a2e834ae93c738 /tdeioslave/media/mediamanager/halbackend.cpp | |
parent | bd9913481762ac2dd5677479197c7ed4c2152d5e (diff) | |
download | tdebase-d2da293eaecf382e2fd2b6517b90df62ae21e127.tar.gz tdebase-d2da293eaecf382e2fd2b6517b90df62ae21e127.zip |
Adjusted to new icon names and renamed media types related to encrypted drives in a better way.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdeioslave/media/mediamanager/halbackend.cpp')
-rw-r--r-- | tdeioslave/media/mediamanager/halbackend.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/tdeioslave/media/mediamanager/halbackend.cpp b/tdeioslave/media/mediamanager/halbackend.cpp index ae14a580f..9c1382bf8 100644 --- a/tdeioslave/media/mediamanager/halbackend.cpp +++ b/tdeioslave/media/mediamanager/halbackend.cpp @@ -40,18 +40,15 @@ #include <kstandarddirs.h> #include <kprocess.h> -#define MOUNT_SUFFIX ( \ - (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")) + \ - (medium->isEncrypted() ? (halClearVolume ? "_decrypted" : "_encrypted") : "" ) \ - ) -#define MOUNT_ICON_SUFFIX ( \ - (medium->isMounted() ? TQString("_mount") : TQString("_unmount")) + \ - (medium->isEncrypted() ? (halClearVolume ? "_decrypt" : "_encrypt") : "" ) \ - ) -#define MOUNTED_ICON_SUFFIX ( \ - (medium->isMounted() ? TQString("-mounted") : TQString("")) + \ - (medium->isEncrypted() ? (halClearVolume ? "-decrypted" : "-encrypted") : "" ) \ - ) +#define MOUNT_SUFFIX (medium->isEncrypted() ? \ + (TQString("_encrypted") + (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_unlocked" : "_locked")) : \ + (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted"))) + +#define MOUNT_ICON_SUFFIX (medium->isMounted() ? TQString("_mount") : TQString("_unmount")) + +#define MOUNTED_ICON_SUFFIX (medium->isEncrypted() ? \ + (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "-unlocked" : "-locked") : \ + (medium->isMounted() ? TQString("-mounted") : TQString(""))) /* Static instance of this class, for static HAL callbacks */ static HALBackend* s_HALBackend; @@ -515,7 +512,7 @@ void HALBackend::setVolumeProperties(Medium* medium) if (clearUdi != NULL) { kdDebug(1219) << "HALBackend::setVolumeProperties : crypto clear volume avail - " << clearUdi << endl; halClearVolume = libhal_volume_from_udi(m_halContext, clearUdi); - // ignore if halClearVolume is NULL -> just not decrypted in this case + // ignore if halClearVolume is NULL -> just not unlocked in this case clearUdiString = clearUdi; libhal_free_string(clearUdi); } @@ -928,7 +925,7 @@ TQStringList HALBackend::mountoptions(const TQString &name) volume_udi = clearUdi; libhal_free_string(clearUdi); } else { - // if not decrypted yet then no mountoptions + // if not unlocked yet then no mountoptions return TQStringList(); } libhal_volume_free(halVolume); @@ -1569,7 +1566,7 @@ TQStringVariantMap HALBackend::mount(const Medium *medium) qerror = mount_priv(medium->id().latin1(), mount_point.utf8(), options, noptions, dbus_connection); } else { // see if we have a clear volume - error = i18n("Cannot mount encrypted drives!"); + error = i18n("Cannot mount encrypted locked drives!"); LibHalVolume* halVolume = libhal_volume_from_udi(m_halContext, medium->id().latin1()); if (halVolume) { char* clearUdi = libhal_volume_crypto_get_clear_volume_udi(m_halContext, halVolume); |