gnome-session r5184 - in trunk: . capplet



Author: lucasr
Date: Fri Jan  9 00:52:15 2009
New Revision: 5184
URL: http://svn.gnome.org/viewvc/gnome-session?rev=5184&view=rev

Log:
2009-01-09  Lucas Rocha  <lucasr gnome org>

	550726 â Apps with an icon not existing in the icon theme displayed
	with no icon

	* capplet (append_app): check if defined icon name actually exists
	in the icon theme. Use default icon otherwise.

Modified:
   trunk/ChangeLog
   trunk/capplet/gsm-properties-dialog.c

Modified: trunk/capplet/gsm-properties-dialog.c
==============================================================================
--- trunk/capplet/gsm-properties-dialog.c	(original)
+++ trunk/capplet/gsm-properties-dialog.c	Fri Jan  9 00:52:15 2009
@@ -136,15 +136,16 @@
 append_app (GsmPropertiesDialog *dialog,
             EggDesktopFile      *desktop_file)
 {
-        GtkTreeIter iter;
-        GFile      *source;
-        char       *basename;
-        char       *description;
-        char       *name;
-        char       *comment;
-        char       *command;
-        char       *icon_name;
-        gboolean    enabled = TRUE;
+        GtkIconTheme *theme;
+        GtkTreeIter   iter;
+        GFile        *source;
+        char         *basename;
+        char         *description;
+        char         *name;
+        char         *comment;
+        char         *command;
+        char         *icon_name;
+        gboolean      enabled = TRUE;
 
         source = g_file_new_for_uri (egg_desktop_file_get_source (desktop_file));
 
@@ -188,7 +189,14 @@
                                                      "Icon", NULL);
         }
 
-        if (icon_name == NULL || *icon_name == '\0') {
+        theme = gtk_icon_theme_get_default ();
+
+        if (icon_name == NULL || *icon_name == '\0' ||
+            !gtk_icon_theme_has_icon (theme, icon_name)) {
+                if (icon_name) {
+                        g_free (icon_name);
+                }
+
                 icon_name = g_strdup (STARTUP_APP_ICON);
         }
 



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