aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-01-22 15:26:38 +0100
committerGravatar Christian Hesse <mail@eworm.de>2014-01-22 15:26:38 +0100
commit1f9b1e260f775c78b7a0c304b5f235ff030f24c0 (patch)
tree3a9206a40f3ff111749dd5ecdc1e84e2b7210651
parent3b6f40bfd1189cdf020bfa13d9b88bec47c6e29e (diff)
downloadudev-block-notify-1f9b1e260f775c78b7a0c304b5f235ff030f24c0.tar.gz
udev-block-notify-1f9b1e260f775c78b7a0c304b5f235ff030f24c0.tar.zst
rework icon handling for unknown devices
-rw-r--r--udev-block-notify.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/udev-block-notify.c b/udev-block-notify.c
index 521291b..89c1a25 100644
--- a/udev-block-notify.c
+++ b/udev-block-notify.c
@@ -218,6 +218,10 @@ int main (int argc, char ** argv) {
/* get a notification */
notification = get_notification(notifications, devnum);
+ /* this is a fallback and should be replaced below
+ * if it is not... what drive is it? */
+ icon = ICON_UNKNOWN;
+
/* decide about what icon to use */
value = udev_device_get_property_value(dev, "ID_BUS");
if (udev_device_get_property_value(dev, "ID_CDROM") != NULL) { /* optical drive */
@@ -254,9 +258,7 @@ int main (int argc, char ** argv) {
} else if (strcmp(value, "ieee1394") == 0) { /* firewire hard disk */
icon = ICON_DRIVE_HARDDISK_IEEE1394;
}
- } else
- /* we should never get here... what drive is it? */
- icon = ICON_UNKNOWN;
+ }
notify_notification_update(notification, TEXT_TOPIC, notifystr, icon);
notify_notification_set_timeout(notification, NOTIFICATION_TIMEOUT);