[Xfce4-commits] <thunar:jannis/new-shortcuts-pane> Only apply the ThunarFile icon to the shortcut if it's set.
Jannis Pohlmann
noreply at xfce.org
Fri Jul 15 21:10:34 CEST 2011
Updating branch refs/heads/jannis/new-shortcuts-pane
to df1ae476aa9403c912a602194be87d02cde4c893 (commit)
from e3bf9971d0478ec2c89531e42eb358e25f3b1e5a (commit)
commit df1ae476aa9403c912a602194be87d02cde4c893
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Thu Jun 9 18:26:43 2011 +0200
Only apply the ThunarFile icon to the shortcut if it's set.
thunar/thunar-shortcut.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/thunar/thunar-shortcut.c b/thunar/thunar-shortcut.c
index 5f6741b..a2ec353 100644
--- a/thunar/thunar-shortcut.c
+++ b/thunar/thunar-shortcut.c
@@ -535,10 +535,10 @@ thunar_shortcut_set_location (ThunarShortcut *shortcut,
g_free (uri);
/* use the folder icon as the default icon */
- if (shortcut->custom_icon == NULL)
+ if (shortcut->icon == NULL)
{
icon = g_themed_icon_new ("folder");
- thunar_shortcut_set_custom_icon (shortcut, icon);
+ thunar_shortcut_set_icon (shortcut, icon);
g_object_unref (icon);
}
@@ -565,6 +565,8 @@ void
thunar_shortcut_set_file (ThunarShortcut *shortcut,
ThunarFile *file)
{
+ GIcon *icon;
+
_thunar_return_if_fail (THUNAR_IS_SHORTCUT (shortcut));
_thunar_return_if_fail (file == NULL || THUNAR_IS_FILE (file));
@@ -592,7 +594,10 @@ thunar_shortcut_set_file (ThunarShortcut *shortcut,
/* update the name and icon of the shortcut */
thunar_shortcut_set_name (shortcut,
thunar_file_get_display_name (shortcut->file));
- thunar_shortcut_set_custom_icon (shortcut, thunar_file_get_icon (shortcut->file));
+
+ icon = thunar_file_get_icon (shortcut->file);
+ if (icon != NULL)
+ thunar_shortcut_set_icon (shortcut, icon);
}
}
@@ -645,7 +650,7 @@ thunar_shortcut_set_volume (ThunarShortcut *shortcut,
name = g_volume_get_name (shortcut->volume);
icon = g_volume_get_icon (shortcut->volume);
thunar_shortcut_set_name (shortcut, name);
- thunar_shortcut_set_custom_icon (shortcut, icon);
+ thunar_shortcut_set_icon (shortcut, icon);
g_object_unref (icon);
g_free (name);
}
@@ -699,7 +704,7 @@ thunar_shortcut_set_mount (ThunarShortcut *shortcut,
name = g_mount_get_name (shortcut->mount);
icon = g_mount_get_icon (shortcut->mount);
thunar_shortcut_set_name (shortcut, name);
- thunar_shortcut_set_custom_icon (shortcut, icon);
+ thunar_shortcut_set_icon (shortcut, icon);
g_object_unref (icon);
g_free (name);
}
More information about the Xfce4-commits
mailing list