summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediamanager
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-02-03 18:58:02 +0100
committerSlávek Banko <slavek.banko@axis.cz>2016-02-03 18:58:15 +0100
commit5d07c230ed2aa6cf875967d664d85a7679b0bbcc (patch)
tree60c15c969dc8dd0ad86a93775dd6237594db4a68 /tdeioslave/media/mediamanager
parent8d23840b4d4ee6f7a33023ea2bc81cf7cf08c673 (diff)
downloadtdebase-5d07c230ed2aa6cf875967d664d85a7679b0bbcc.tar.gz
tdebase-5d07c230ed2aa6cf875967d664d85a7679b0bbcc.zip
Fix device icons in the media:/ tdeioslave to comply with XDG standards
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 99f5115dac933f1b32e1156425eafd371b50169b)
Diffstat (limited to 'tdeioslave/media/mediamanager')
-rw-r--r--tdeioslave/media/mediamanager/halbackend.cpp14
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.cpp14
2 files changed, 18 insertions, 10 deletions
diff --git a/tdeioslave/media/mediamanager/halbackend.cpp b/tdeioslave/media/mediamanager/halbackend.cpp
index 05cdae425..7829ab29e 100644
--- a/tdeioslave/media/mediamanager/halbackend.cpp
+++ b/tdeioslave/media/mediamanager/halbackend.cpp
@@ -48,6 +48,10 @@
(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") : "" ) \
+ )
/* Static instance of this class, for static HAL callbacks */
static HALBackend* s_HALBackend;
@@ -616,16 +620,16 @@ void HALBackend::setVolumeProperties(Medium* medium)
medium->needMounting();
switch (libhal_drive_get_type(halDrive)) {
case LIBHAL_DRIVE_TYPE_COMPACT_FLASH:
- medium->setIconName("compact_flash" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-compact_flash" + MOUNTED_ICON_SUFFIX);
break;
case LIBHAL_DRIVE_TYPE_MEMORY_STICK:
- medium->setIconName("memory_stick" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-memory_stick" + MOUNTED_ICON_SUFFIX);
break;
case LIBHAL_DRIVE_TYPE_SMART_MEDIA:
- medium->setIconName("smart_media" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-smart_media" + MOUNTED_ICON_SUFFIX);
break;
case LIBHAL_DRIVE_TYPE_SD_MMC:
- medium->setIconName("sd_mmc" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-sd_mmc" + MOUNTED_ICON_SUFFIX);
break;
case LIBHAL_DRIVE_TYPE_PORTABLE_AUDIO_PLAYER:
{
@@ -654,7 +658,7 @@ void HALBackend::setVolumeProperties(Medium* medium)
break;
}
case LIBHAL_DRIVE_TYPE_TAPE:
- medium->setIconName(TQString::null); //FIXME need icon
+ medium->setIconName("media-tape" + MOUNTED_ICON_SUFFIX);
break;
default:
medium->setIconName(TQString::null);
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index 89eb42479..be07a4aa4 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -45,6 +45,10 @@
(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 CHECK_FOR_AND_EXECUTE_AUTOMOUNT(udi, medium, allowNotification) { \
TQMap<TQString,TQString> options = MediaManagerUtils::splitOptions(mountoptions(udi)); \
@@ -739,16 +743,16 @@ void TDEBackend::setVolumeProperties(Medium* medium)
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::CompactFlash)) {
- medium->setIconName("compact_flash" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-compact_flash" + MOUNTED_ICON_SUFFIX);
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::MemoryStick)) {
- medium->setIconName("memory_stick" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-memory_stick" + MOUNTED_ICON_SUFFIX);
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::SmartMedia)) {
- medium->setIconName("smart_media" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-smart_media" + MOUNTED_ICON_SUFFIX);
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::SDMMC)) {
- medium->setIconName("sd_mmc" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-flash-sd_mmc" + MOUNTED_ICON_SUFFIX);
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::MediaDevice)) {
medium->setIconName("ipod" + MOUNT_ICON_SUFFIX);
@@ -758,7 +762,7 @@ void TDEBackend::setVolumeProperties(Medium* medium)
}
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::Tape)) {
- medium->setIconName("magnetic_tape" + MOUNT_ICON_SUFFIX);
+ medium->setIconName("media-tape" + MOUNTED_ICON_SUFFIX);
}
if (medium->isMounted() && TQFile::exists(medium->mountPoint() + "/dcim")) {
mimeType = "media/camera" + MOUNT_SUFFIX;