[gnome-disk-utility] Remove gdu-enclosure icon and hard-coded references to it



commit b61f38c07f8304f1f0a8c658e55948d1b7601a5d
Author: David Zeuthen <zeuthen gmail com>
Date:   Wed Nov 28 15:48:48 2012 -0500

    Remove gdu-enclosure icon and hard-coded references to it
    
    ... instead, just use the information from the UDisksObjectInfo
    object. Also, see
    
     http://cgit.freedesktop.org/udisks/commit/?id=8260d99419f97a06aa1e60d16d576ecbe735635b
    
    for the change where udisks will now return drive-multidisk instead of
    gdu-enclosure.
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 data/icons/16x16/Makefile.am          |    1 -
 data/icons/16x16/gdu-enclosure.png    |  Bin 626 -> 0 bytes
 data/icons/22x22/Makefile.am          |    1 -
 data/icons/22x22/gdu-enclosure.png    |  Bin 925 -> 0 bytes
 data/icons/48x48/Makefile.am          |    1 -
 data/icons/48x48/gdu-enclosure.png    |  Bin 2485 -> 0 bytes
 data/icons/scalable/Makefile.am       |    1 -
 data/icons/scalable/gdu-enclosure.svg | 2215 ---------------------------------
 src/disks/gdudevicetreemodel.c        |   11 +-
 src/disks/gduwindow.c                 |   10 +-
 10 files changed, 10 insertions(+), 2230 deletions(-)
---
diff --git a/data/icons/16x16/Makefile.am b/data/icons/16x16/Makefile.am
index 90c31d2..254ddcd 100644
--- a/data/icons/16x16/Makefile.am
+++ b/data/icons/16x16/Makefile.am
@@ -2,7 +2,6 @@ NULL =
 
 icondir = $(datadir)/icons/hicolor/16x16/apps
 icon_DATA =				\
-	gdu-enclosure.png		\
 	gnome-disks.png			\
 	$(NULL)
 
diff --git a/data/icons/22x22/Makefile.am b/data/icons/22x22/Makefile.am
index ccb5c50..6277f68 100644
--- a/data/icons/22x22/Makefile.am
+++ b/data/icons/22x22/Makefile.am
@@ -2,7 +2,6 @@ NULL =
 
 icondir = $(datadir)/icons/hicolor/22x22/apps
 icon_DATA =				\
-	gdu-enclosure.png		\
 	gnome-disks.png			\
 	$(NULL)
 
diff --git a/data/icons/48x48/Makefile.am b/data/icons/48x48/Makefile.am
index ac046e4..e8e2adc 100644
--- a/data/icons/48x48/Makefile.am
+++ b/data/icons/48x48/Makefile.am
@@ -2,7 +2,6 @@ NULL =
 
 icondir = $(datadir)/icons/hicolor/48x48/apps
 icon_DATA = 				\
-	gdu-enclosure.png		\
 	gnome-disks.png			\
 	$(NULL)
 
diff --git a/data/icons/scalable/Makefile.am b/data/icons/scalable/Makefile.am
index 65c5928..753e566 100644
--- a/data/icons/scalable/Makefile.am
+++ b/data/icons/scalable/Makefile.am
@@ -2,7 +2,6 @@ NULL =
 
 icondir = $(datadir)/icons/hicolor/scalable/apps
 icon_DATA =					\
-	gdu-enclosure.svg			\
 	gnome-disks-state-standby-symbolic.svg	\
 	$(NULL)
 
diff --git a/src/disks/gdudevicetreemodel.c b/src/disks/gdudevicetreemodel.c
index d281f69..47a1327 100644
--- a/src/disks/gdudevicetreemodel.c
+++ b/src/disks/gdudevicetreemodel.c
@@ -1055,10 +1055,10 @@ update_mdraid (GduDeviceTreeModel *model,
                UDisksObject       *object,
                gboolean            from_timer)
 {
+  UDisksObjectInfo *info = NULL;
   UDisksMDRaid *mdraid = NULL;
   UDisksBlock *block = NULL;
   const gchar *name;
-  GIcon *icon = NULL;
   gchar *desc = NULL;
   gchar *desc2 = NULL;
   gchar *s = NULL;
@@ -1079,8 +1079,8 @@ update_mdraid (GduDeviceTreeModel *model,
     }
 
   mdraid = udisks_object_peek_mdraid (object);
-
   block = udisks_client_get_block_for_mdraid (model->client, mdraid);
+  info = udisks_client_get_object_info (model->client, object);
 
   sort_key = g_strdup_printf ("01_mdraid_1_%s", udisks_mdraid_get_uuid (mdraid)); /* TODO: sort_key? */
 
@@ -1123,9 +1123,6 @@ update_mdraid (GduDeviceTreeModel *model,
       desc2 = gdu_utils_format_mdraid_level (udisks_mdraid_get_level (mdraid), FALSE, FALSE);
     }
 
-
-  icon = g_themed_icon_new ("gdu-enclosure");
-
   if (udisks_mdraid_get_degraded (mdraid) > 0)
     warning = TRUE;
 
@@ -1161,7 +1158,7 @@ update_mdraid (GduDeviceTreeModel *model,
 
   gtk_tree_store_set (GTK_TREE_STORE (model),
                       &iter,
-                      GDU_DEVICE_TREE_MODEL_COLUMN_ICON, icon,
+                      GDU_DEVICE_TREE_MODEL_COLUMN_ICON, udisks_object_info_get_icon (info),
                       GDU_DEVICE_TREE_MODEL_COLUMN_NAME, s,
                       GDU_DEVICE_TREE_MODEL_COLUMN_SORT_KEY, sort_key,
                       GDU_DEVICE_TREE_MODEL_COLUMN_WARNING, warning,
@@ -1181,7 +1178,7 @@ update_mdraid (GduDeviceTreeModel *model,
     }
 
  out:
-  g_clear_object (&icon);
+  g_clear_object (&info);
   g_free (sort_key);
   g_free (s);
   g_free (desc);
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index f97e652..dce9338 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -2129,7 +2129,7 @@ update_device_page_for_mdraid (GduWindow      *window,
                                UDisksMDRaid   *mdraid,
                                ShowFlags      *show_flags)
 {
-  GIcon *icon = NULL;
+  UDisksObjectInfo *info = NULL;
   gchar *s = NULL, *s2, *s3;
   gchar *desc = NULL;
   gchar *device_desc = NULL;
@@ -2164,7 +2164,7 @@ update_device_page_for_mdraid (GduWindow      *window,
   bitmap_location = udisks_mdraid_get_bitmap_location (mdraid);
   chunk_size = udisks_mdraid_get_chunk_size (mdraid);
 
-  icon = g_themed_icon_new ("gdu-enclosure");
+  info = udisks_client_get_object_info (window->client, object);
 
   if (size > 0)
     {
@@ -2199,7 +2199,9 @@ update_device_page_for_mdraid (GduWindow      *window,
   if (block != NULL)
     update_drive_part_for_block (window, block, show_flags);
 
-  gtk_image_set_from_gicon (GTK_IMAGE (window->devtab_drive_image), icon, GTK_ICON_SIZE_DIALOG);
+  gtk_image_set_from_gicon (GTK_IMAGE (window->devtab_drive_image),
+                            udisks_object_info_get_icon (info),
+                            GTK_ICON_SIZE_DIALOG);
   gtk_widget_show (window->devtab_drive_image);
 
   s = g_strdup_printf ("<big><b>%s</b></big>", desc);
@@ -2477,7 +2479,7 @@ update_device_page_for_mdraid (GduWindow      *window,
   g_free (name);
   g_free (device_desc);
   g_free (desc);
-  g_clear_object (&icon);
+  g_clear_object (&info);
 
   g_clear_object (&block);
 }



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