66 lines
2.4 KiB
Diff
66 lines
2.4 KiB
Diff
--- gtk+-2.10.1/gtk/gtkfilesystem.c.orig 2006-08-07 22:23:22.436475760 +0200
|
|
+++ gtk+-2.10.1/gtk/gtkfilesystem.c 2006-08-07 22:25:38.673764544 +0200
|
|
@@ -301,15 +301,21 @@
|
|
GtkIconTheme *icon_theme;
|
|
|
|
icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
|
|
- pixbuf = gtk_icon_theme_load_icon (icon_theme, info->icon_name,
|
|
- pixel_size, 0, NULL);
|
|
+ if (gtk_icon_theme_has_icon (icon_theme, info->icon_name))
|
|
+ pixbuf = gtk_icon_theme_load_icon (icon_theme, info->icon_name,
|
|
+ pixel_size, 0, NULL);
|
|
}
|
|
}
|
|
|
|
if (!pixbuf)
|
|
{
|
|
/* load a fallback icon */
|
|
- pixbuf = gtk_widget_render_icon (widget, GTK_STOCK_FILE, GTK_ICON_SIZE_SMALL_TOOLBAR, NULL);
|
|
+ pixbuf = gtk_widget_render_icon (widget,
|
|
+ gtk_file_info_get_is_folder (info)
|
|
+ ? GTK_STOCK_DIRECTORY : GTK_STOCK_FILE,
|
|
+ GTK_ICON_SIZE_SMALL_TOOLBAR,
|
|
+ NULL);
|
|
+
|
|
if (!pixbuf && error)
|
|
g_set_error (error,
|
|
GTK_FILE_SYSTEM_ERROR,
|
|
@@ -648,7 +654,7 @@
|
|
GError **error)
|
|
{
|
|
gchar *icon_name;
|
|
- GdkPixbuf *pixbuf;
|
|
+ GdkPixbuf *pixbuf = NULL;
|
|
|
|
g_return_val_if_fail (GTK_IS_FILE_SYSTEM (file_system), NULL);
|
|
g_return_val_if_fail (volume != NULL, NULL);
|
|
@@ -658,15 +664,22 @@
|
|
|
|
icon_name = gtk_file_system_volume_get_icon_name (file_system, volume,
|
|
error);
|
|
- if (!icon_name)
|
|
+ if (icon_name)
|
|
{
|
|
- return NULL;
|
|
+ GtkIconTheme *icon_theme;
|
|
+
|
|
+ icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
|
|
+ if (gtk_icon_theme_has_icon (icon_theme, icon_name))
|
|
+ pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
|
+ icon_name, pixel_size, 0, NULL);
|
|
+ g_free (icon_name);
|
|
}
|
|
|
|
- pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget)),
|
|
- icon_name, pixel_size, 0, NULL);
|
|
- g_free (icon_name);
|
|
-
|
|
+ if (!pixbuf)
|
|
+ pixbuf = gtk_widget_render_icon (widget,
|
|
+ GTK_STOCK_HARDDISK,
|
|
+ GTK_ICON_SIZE_SMALL_TOOLBAR,
|
|
+ NULL);
|
|
return pixbuf;
|
|
}
|
|
|