[gnome-multi-writer] Try to get the icon name hint from UDisks



commit a2913adcbcda7e4c6e3a28d1f5fd9de15e216ee2
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jan 9 15:34:19 2015 +0000

    Try to get the icon name hint from UDisks
    
    This allows us to show a more accurate device logo if if know the device type.

 src/gmw-device.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gmw-device.c b/src/gmw-device.c
index 3403b14..db95f76 100644
--- a/src/gmw-device.c
+++ b/src/gmw-device.c
@@ -230,6 +230,7 @@ const gchar *
 gmw_device_get_icon (GmwDevice *device)
 {
        GmwDevicePrivate *priv = gmw_device_get_instance_private (device);
+       const gchar *tmp;
 
        g_return_val_if_fail (GMW_IS_DEVICE (device), NULL);
 
@@ -237,6 +238,14 @@ gmw_device_get_icon (GmwDevice *device)
                return "emblem-default";
        if (priv->state == GMW_DEVICE_STATE_FAILED)
                return "drive-harddisk";
+
+       /* try to get from UDisks */
+       if (priv->udisks_block != NULL) {
+               tmp = udisks_block_get_hint_icon_name (priv->udisks_block);
+               if (tmp != NULL && tmp[0] != '\0')
+                       return tmp;
+       }
+
        return "drive-harddisk-usb";
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]