Commit 6cde4c5a authored by Cosimo Cecchi's avatar Cosimo Cecchi

file: don't add a thumbnail border around desktop file launchers

https://bugzilla.gnome.org/show_bug.cgi?id=688237
parent 838c7751
......@@ -3952,6 +3952,18 @@ get_custom_icon_metadata_name (NautilusFile *file)
return icon_name;
}
static GIcon *
get_link_icon (NautilusFile *file)
{
GIcon *icon = NULL;
if (file->details->got_link_info && file->details->custom_icon != NULL) {
icon = g_object_ref (file->details->custom_icon);
}
return icon;
}
static GIcon *
get_custom_icon (NautilusFile *file)
{
......@@ -3985,11 +3997,7 @@ get_custom_icon (NautilusFile *file)
g_free (custom_icon_name);
}
}
if (icon == NULL && file->details->got_link_info && file->details->custom_icon != NULL) {
icon = g_object_ref (file->details->custom_icon);
}
return icon;
}
......@@ -4086,6 +4094,12 @@ nautilus_file_get_gicon (NautilusFile *file,
return icon;
}
icon = get_link_icon (file);
if (icon != NULL) {
return icon;
}
if (file->details->icon) {
icon = NULL;
......@@ -4218,27 +4232,36 @@ nautilus_file_get_icon (NautilusFile *file,
{
NautilusIconInfo *icon;
GIcon *gicon;
gboolean custom_icon;
GdkPixbuf *raw_pixbuf, *scaled_pixbuf;
int modified_size;
if (file == NULL) {
return NULL;
}
custom_icon = FALSE;
gicon = get_custom_icon (file);
if (gicon) {
GdkPixbuf *pixbuf;
custom_icon = TRUE;
} else {
gicon = get_link_icon (file);
}
if (gicon) {
icon = nautilus_icon_info_lookup (gicon, size);
g_object_unref (gicon);
pixbuf = nautilus_icon_info_get_pixbuf (icon);
if (pixbuf != NULL) {
nautilus_ui_frame_image (&pixbuf);
g_object_unref (icon);
if (custom_icon) {
raw_pixbuf = nautilus_icon_info_get_pixbuf (icon);
if (raw_pixbuf != NULL) {
nautilus_ui_frame_image (&raw_pixbuf);
g_object_unref (icon);
icon = nautilus_icon_info_new_for_pixbuf (pixbuf);
g_object_unref (pixbuf);
icon = nautilus_icon_info_new_for_pixbuf (raw_pixbuf);
g_object_unref (raw_pixbuf);
}
}
return icon;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment