[libgnomekbd] Fix for strange GtkIconInfo behaviour



commit 44e23960fbbf3762937a6f1115dea6c640b03fe8
Author: Sergey V. Udaltsov <svu gnome org>
Date:   Thu Jan 6 14:02:53 2011 +0000

    Fix for strange GtkIconInfo behaviour
    
    Sometimes you can get an icon without filename. Odd

 libgnomekbd/gkbd-indicator-config.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/libgnomekbd/gkbd-indicator-config.c b/libgnomekbd/gkbd-indicator-config.c
index 558b590..238ea3f 100644
--- a/libgnomekbd/gkbd-indicator-config.c
+++ b/libgnomekbd/gkbd-indicator-config.c
@@ -137,7 +137,7 @@ gkbd_indicator_config_refresh_style (GkbdIndicatorConfig * ind_config)
 	gkbd_indicator_config_load_colors (ind_config);
 }
 
-char *
+gchar *
 gkbd_indicator_config_get_images_file (GkbdIndicatorConfig *
 				       ind_config,
 				       GkbdKeyboardConfig *
@@ -162,6 +162,13 @@ gkbd_indicator_config_get_images_file (GkbdIndicatorConfig *
 				/* probably there is something in theme? */
 				icon_info = gtk_icon_theme_lookup_icon
 				    (ind_config->icon_theme, l, 48, 0);
+
+				/* Unbelievable but happens */
+				if (icon_info != NULL &&
+				    gtk_icon_info_get_filename (icon_info) == NULL) {
+					gtk_icon_info_free (icon_info);
+					icon_info = NULL;
+				}
 			}
 		}
 	}
@@ -193,7 +200,7 @@ gkbd_indicator_config_load_image_filenames (GkbdIndicatorConfig *
 
 	for (i = xkl_engine_get_max_num_groups (ind_config->engine);
 	     --i >= 0;) {
-		char *image_file =
+		gchar *image_file =
 		    gkbd_indicator_config_get_images_file (ind_config,
 							   kbd_config,
 							   i);



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