[nautilus] file: remove unused icon flag
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file: remove unused icon flag
- Date: Tue, 9 Sep 2014 22:52:17 +0000 (UTC)
commit 53d657ccc04be0d2003100f82c962d4b1f173aa8
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Sep 9 14:16:16 2014 -0700
file: remove unused icon flag
This is not needed anymore.
libnautilus-private/nautilus-file.c | 37 ++++++++++------------------------
libnautilus-private/nautilus-file.h | 13 +++++------
2 files changed, 17 insertions(+), 33 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 29882c9..9f4e04f 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -4302,7 +4302,7 @@ nautilus_file_get_gicon (NautilusFile *file,
GPtrArray *prepend_array;
GIcon *icon, *emblemed_icon;
int i;
- gboolean is_folder = FALSE, is_preview = FALSE, is_inode_directory = FALSE;
+ gboolean is_folder = FALSE, is_inode_directory = FALSE;
if (file == NULL) {
return NULL;
@@ -4331,8 +4331,7 @@ nautilus_file_get_gicon (NautilusFile *file,
if (file->details->icon) {
icon = NULL;
- if (((flags & NAUTILUS_FILE_ICON_FLAGS_EMBEDDING_TEXT) ||
- (flags & NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT) ||
+ if (((flags & NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT) ||
(flags & NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER) ||
(flags & NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON) ||
(flags & NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS) ||
@@ -4351,17 +4350,10 @@ nautilus_file_get_gicon (NautilusFile *file,
if (strcmp (name, "inode-directory") == 0) {
is_inode_directory = TRUE;
}
- if (strcmp (name, "text-x-generic") == 0 &&
- (flags & NAUTILUS_FILE_ICON_FLAGS_EMBEDDING_TEXT)) {
- is_preview = TRUE;
- }
}
/* Here, we add icons in reverse order of precedence,
* because they are later prepended */
- if (is_preview) {
- g_ptr_array_add (prepend_array, "text-x-preview");
- }
/* "folder" should override "inode-directory", not the other way around */
if (is_inode_directory) {
@@ -4393,34 +4385,27 @@ nautilus_file_get_gicon (NautilusFile *file,
if (icon == NULL) {
icon = g_object_ref (file->details->icon);
}
+ }
- if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS) {
- emblemed_icon = apply_emblems_to_icon (file, icon, flags);
- g_object_unref (icon);
- icon = emblemed_icon;
- }
-
- return icon;
+ out:
+ if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS) {
+ emblemed_icon = apply_emblems_to_icon (file, icon, flags);
+ g_object_unref (icon);
+ icon = emblemed_icon;
}
return g_themed_icon_new ("text-x-generic");
}
static GIcon *
-get_default_file_icon (NautilusFileIconFlags flags)
+get_default_file_icon (void)
{
static GIcon *fallback_icon = NULL;
- static GIcon *fallback_icon_preview = NULL;
if (fallback_icon == NULL) {
fallback_icon = g_themed_icon_new ("text-x-generic");
- fallback_icon_preview = g_themed_icon_new ("text-x-preview");
- g_themed_icon_append_name (G_THEMED_ICON (fallback_icon_preview), "text-x-generic");
- }
- if (flags & NAUTILUS_FILE_ICON_FLAGS_EMBEDDING_TEXT) {
- return fallback_icon_preview;
- } else {
- return fallback_icon;
}
+
+ return fallback_icon;
}
char *
diff --git a/libnautilus-private/nautilus-file.h b/libnautilus-private/nautilus-file.h
index 5d8cee2..c5f4546 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -72,16 +72,15 @@ typedef enum {
NAUTILUS_FILE_ICON_FLAGS_NONE = 0,
NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS = (1<<0),
NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING = (1<<1),
- NAUTILUS_FILE_ICON_FLAGS_EMBEDDING_TEXT = (1<<2),
- NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT = (1<<3),
- NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER = (1<<4),
+ NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT = (1<<2),
+ NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER = (1<<3),
/* whether the thumbnail size must match the display icon size */
- NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE = (1<<5),
+ NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE = (1<<4),
/* uses the icon of the mount if present */
- NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<6),
+ NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<5),
/* render emblems */
- NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS = (1<<7),
- NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM = (1<<8)
+ NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS = (1<<6),
+ NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM = (1<<7)
} NautilusFileIconFlags;
/* Emblems sometimes displayed for NautilusFiles. Do not localize. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]