Update to use the GtkIconTheme API instead of the deprecated

2005-07-10  Rodney Dawes  <dobey@novell.com>

	* capplet-util.c (capplet_set_icon): Update to use the GtkIconTheme
	API instead of the deprecated GnomeIconTheme API
	Based on patch from Jan de Groot

	Fixes #171679
This commit is contained in:
Rodney Dawes 2005-07-10 21:10:56 +00:00 committed by Rodney Dawes
parent e7819d9175
commit ea7222e775
2 changed files with 16 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2005-07-10 Rodney Dawes <dobey@novell.com>
* capplet-util.c (capplet_set_icon): Update to use the GtkIconTheme
API instead of the deprecated GnomeIconTheme API
Based on patch from Jan de Groot
Fixes #171679
2005-06-30 William Jon McCann <mccann@jhu.edu> 2005-06-30 William Jon McCann <mccann@jhu.edu>
* file-transfer-dialog.c: Don't include gnome.h * file-transfer-dialog.c: Don't include gnome.h

View file

@ -356,21 +356,22 @@ capplet_set_icon (GtkWidget *window, char const *icon_file_name)
char *tmp; char *tmp;
char *p; char *p;
GdkPixbuf *icon_pixbuf = NULL; GdkPixbuf *icon_pixbuf = NULL;
GnomeIconTheme *icon_theme; GtkIconTheme *icon_theme;
GtkIconInfo *icon_info;
/* First look up from the icon theme */ /* First look up from the icon theme */
icon_theme = gnome_icon_theme_new (); icon_theme = gtk_icon_theme_get_default ();
tmp = g_strdup (icon_file_name); tmp = g_strdup (icon_file_name);
p = strrchr (tmp, '.'); p = strrchr (tmp, '.');
if (p) if (p)
p[0] = '\0'; p[0] = '\0';
path = gnome_icon_theme_lookup_icon (icon_theme, tmp, 48, NULL, NULL); icon_info = gtk_icon_theme_lookup_icon (icon_theme, tmp, 48, 0);
if (path != NULL) { if (icon_info != NULL) {
icon_pixbuf = gdk_pixbuf_new_from_file (path, NULL); icon_pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
g_free (path); gtk_icon_info_free (icon_info);
} }
g_free (tmp); g_free (tmp);