[gnome-disk-utility] Fix icon name computation for GduVolume objects



commit a5f4cf7a633898bfaa71107bc601f29508fd7a95
Author: David Zeuthen <davidz redhat com>
Date:   Tue Dec 8 14:05:53 2009 -0500

    Fix icon name computation for GduVolume objects
    
    We currently don't use volume icon names anywhere in the new
    Palimpsest UI so this was only detectable when using GVfs.

 src/gdu/gdu-volume.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/gdu/gdu-volume.c b/src/gdu/gdu-volume.c
index d363ccf..5239cae 100644
--- a/src/gdu/gdu-volume.c
+++ b/src/gdu/gdu-volume.c
@@ -525,7 +525,18 @@ gdu_volume_get_icon (GduPresentable *presentable)
                 goto out;
         }
 
-        p = gdu_presentable_get_toplevel (presentable);
+        p = gdu_presentable_get_enclosing_presentable (GDU_PRESENTABLE (presentable));
+        /* handle logical partitions enclosed by an extented partition */
+        if (GDU_IS_VOLUME (p)) {
+                GduPresentable *temp;
+                temp = p;
+                p = gdu_presentable_get_enclosing_presentable (p);
+                g_object_unref (temp);
+                if (!GDU_IS_DRIVE (p)) {
+                        g_object_unref (p);
+                        p = NULL;
+                }
+        }
         if (p == NULL)
                 goto out;
 



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