glib r6992 - trunk/gio
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r6992 - trunk/gio
- Date: Tue, 10 Jun 2008 16:56:26 +0000 (UTC)
Author: matthiasc
Date: Tue Jun 10 16:56:25 2008
New Revision: 6992
URL: http://svn.gnome.org/viewvc/glib?rev=6992&view=rev
Log:
Bug 537546 â 'desktop' shortcut in file chooser looks like a generic
folder
* glocalfileinfo.c (_g_local_file_info_get): Return user-desktop
as icon for the desktop directory, also make user-home and
user-desktop the preferred icons.
Modified:
trunk/gio/ChangeLog
trunk/gio/glocalfileinfo.c
Modified: trunk/gio/glocalfileinfo.c
==============================================================================
--- trunk/gio/glocalfileinfo.c (original)
+++ trunk/gio/glocalfileinfo.c Tue Jun 10 16:56:25 2008
@@ -1570,19 +1570,24 @@
{
if (G_IS_THEMED_ICON (icon))
{
- const char *type_icon;
+ const char *preferred_icon = NULL;
+ const char *type_icon = NULL;
- /* TODO: Special case desktop dir? That could be expensive with xdg dirs... */
if (strcmp (path, g_get_home_dir ()) == 0)
- type_icon = "user-home";
- else if (S_ISDIR (statbuf.st_mode))
+ preferred_icon = "user-home";
+ else if (strcmp (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0)
+ preferred_icon = "user-desktop";
+ if (S_ISDIR (statbuf.st_mode))
type_icon = "folder";
else if (statbuf.st_mode & S_IXUSR)
type_icon = "application-x-executable";
else
type_icon = "text-x-generic";
- g_themed_icon_append_name (G_THEMED_ICON (icon), type_icon);
+ if (preferred_icon)
+ g_themed_icon_prepend_name (G_THEMED_ICON (icon), preferred_icon);
+ if (type_icon)
+ g_themed_icon_append_name (G_THEMED_ICON (icon), type_icon);
}
g_file_info_set_icon (info, icon);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]