[totem/gnome-2-26] Fix crash when a (storage) volume has an emblem
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [totem/gnome-2-26] Fix crash when a (storage) volume has an emblem
- Date: Fri, 31 Jul 2009 18:05:11 +0000 (UTC)
commit bfc5f434cd87b0d3f933f602eef13dbb1a91f580
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 28b8b73..ec59fea 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -802,12 +802,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]