From 1f9b1e260f775c78b7a0c304b5f235ff030f24c0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 22 Jan 2014 15:26:38 +0100 Subject: rework icon handling for unknown devices --- udev-block-notify.c | 8 +++++--- 1 file 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); -- cgit v1.2.3-54-g00ecf