[totem] Fix crash when a (storage) volume has an emblem



commit 3d97dc944581146ae81ca20f9b7e43d2780c89bf
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jul 31 19:03:04 2009 +0100

    Fix crash when a (storage) volume has an emblem
    
    See https://bugzilla.redhat.com/show_bug.cgi?id=514914

 src/totem-menu.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/totem-menu.c b/src/totem-menu.c
index dddedd3..ff92161 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -808,12 +808,22 @@ add_drive_to_menu (GDrive *drive, guint position, Totem *totem)
 		/* Work out an icon to display */
 		icon = g_volume_get_icon (i->data);
 		icon_name = NULL;
-		icon_names = g_themed_icon_get_names (G_THEMED_ICON (icon));
 
-		for (j = 0; icon_names[j] != NULL; j++) {
-			icon_name = icon_names[j];
-			if (gtk_icon_theme_has_icon (theme, icon_name) != FALSE)
-				break;
+		if (G_IS_EMBLEMED_ICON (icon) != FALSE) {
+			GIcon *new_icon;
+			new_icon = g_emblemed_icon_get_icon (G_EMBLEMED_ICON (icon));
+			g_object_unref (icon);
+			icon = new_icon;
+		}
+
+		if (G_IS_THEMED_ICON (icon)) {
+			icon_names = g_themed_icon_get_names (G_THEMED_ICON (icon));
+
+			for (j = 0; icon_names[j] != NULL; j++) {
+				icon_name = icon_names[j];
+				if (gtk_icon_theme_has_icon (theme, icon_name) != FALSE)
+					break;
+			}
 		}
 
 		/* Get the volume's pretty name for the menu label */



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