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/tdehardwarebackend.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/tdehardwarebackend.cpp')
-rw-r--r-- | tdeioslave/media/mediamanager/tdehardwarebackend.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp index 02971639d..c16be644c 100644 --- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp +++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp @@ -37,19 +37,15 @@ #include "dialog.h" -#define MOUNT_SUFFIX ( \ - (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")) + \ - (medium->isEncrypted() ? (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_decrypted" : "_encrypted") : "" ) \ - ) -#define MOUNT_ICON_SUFFIX ( \ - (medium->isMounted() ? TQString("_mount") : TQString("_unmount")) + \ - (medium->isEncrypted() ? (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_decrypt" : "_encrypt") : "" ) \ - ) -#define MOUNTED_ICON_SUFFIX ( \ - (medium->isMounted() ? TQString("-mounted") : TQString("")) + \ - (medium->isEncrypted() ? (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "-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(""))) /* Constructor */ TDEBackend::TDEBackend(MediaList &list, TQObject* parent) @@ -463,6 +459,8 @@ void TDEBackend::ResetProperties(TDEStorageDevice * sdevice, bool allowNotificat void TDEBackend::setVolumeProperties(Medium* medium) { + kdDebug(1219) << "TDEBackend::setVolumeProperties for " << medium->id() << endl; + TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); TDEStorageDevice * sdevice = hwdevices->findDiskByUID(medium->id()); @@ -1188,6 +1186,8 @@ void TDEBackend::slotPasswordCancel() { TQStringVariantMap TDEBackend::mount(const Medium *medium) { + kdDebug(1219) << "TDEBackend::mount for medium " << medium->name() << endl; + TQStringVariantMap result; if (medium->isMounted()) { result["result"] = true; @@ -1301,7 +1301,7 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium) if (mountedPath.isEmpty()) { if (mountResult.contains("retCode") && mountResult["retCode"].toInt() == 0) { // Mounting was successful - // Because the TDE hardware backend is event driven it might take a little while for the new unencrypted mapped device to show up + // Because the TDE hardware backend is event driven it might take a little while for the new enlock mapped device to show up // Wait up to 30 seconds for it to appear... for (int i=0;i<300;i++) { mountedPath = sdevice->mountPath(); @@ -1321,7 +1321,7 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium) continue_trying_to_decrypt = true; } else { - qerror = i18n("Cannot mount encrypted drives!"); + qerror = i18n("Cannot mount encrypted locked drives!"); qerror = i18n("Unable to mount this device."); TQString errStr = mountResult.contains("errStr") ? mountResult["errStr"].toString() : TQString::null; if (!errStr.isEmpty()) { @@ -1357,6 +1357,8 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium) TQStringVariantMap TDEBackend::mount(const TQString &id) { + kdDebug(1219) << "TDEBackend::mount for id " << id << endl; + const Medium *medium = m_mediaList.findById(id); if (!medium) { TQStringVariantMap result; @@ -1369,6 +1371,8 @@ TQStringVariantMap TDEBackend::mount(const TQString &id) TQStringVariantMap TDEBackend::unmount(const TQString &id) { + kdDebug(1219) << "TDEBackend::unmount for id " << id << endl; + TQStringVariantMap result; const Medium* medium = m_mediaList.findById(id); |