mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 10:16:17 +01:00
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. svn path=/trunk/; revision=6992
This commit is contained in:
parent
0f370f9a04
commit
0e51f02ccb
@ -1,3 +1,12 @@
|
||||
2008-06-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
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.
|
||||
|
||||
2008-06-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gio.symbols:
|
||||
|
@ -1570,19 +1570,24 @@ _g_local_file_info_get (const char *basename,
|
||||
{
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user