[nautilus/gnome-3-6] file: don't add a thumbnail border around desktop file launchers
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-6] file: don't add a thumbnail border around desktop file launchers
- Date: Tue, 13 Nov 2012 13:20:14 +0000 (UTC)
commit 6cde4c5a6d639c85df09b8992a307f91d6b056a6
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Nov 13 08:16:17 2012 -0500
file: don't add a thumbnail border around desktop file launchers
https://bugzilla.gnome.org/show_bug.cgi?id=688237
libnautilus-private/nautilus-file.c | 49 +++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 13 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index e9b7715..d554376 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3953,6 +3953,18 @@ get_custom_icon_metadata_name (NautilusFile *file)
}
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)
{
char *custom_icon_uri, *custom_icon_name;
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]