[nautilus] file: always override file type for saved search files
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file: always override file type for saved search files
- Date: Tue, 2 Oct 2012 17:08:41 +0000 (UTC)
commit f98caf0086dabfe9f12acf7bdde1242f1205d435
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Oct 2 12:14:40 2012 -0400
file: always override file type for saved search files
And not only when first creating it from a GFileInfo, or we'll lose such
information when e.g. browsing the history list.
https://bugzilla.gnome.org/show_bug.cgi?id=685155
libnautilus-private/nautilus-file.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 7a8dad2..3cae5d6 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -639,9 +639,7 @@ nautilus_file_new_from_info (NautilusDirectory *directory,
g_return_val_if_fail (info != NULL, NULL);
mime_type = g_file_info_get_content_type (info);
- if (mime_type &&
- strcmp (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0) {
- g_file_info_set_file_type (info, G_FILE_TYPE_DIRECTORY);
+ if (g_strcmp0 (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0) {
file = NAUTILUS_FILE (g_object_new (NAUTILUS_TYPE_SAVED_SEARCH_FILE, NULL));
} else {
file = NAUTILUS_FILE (g_object_new (NAUTILUS_TYPE_VFS_FILE, NULL));
@@ -2154,7 +2152,12 @@ update_info_internal (NautilusFile *file,
g_file_info_get_display_name (info),
g_file_info_get_edit_name (info),
FALSE);
-
+
+ mime_type = g_file_info_get_content_type (info);
+ if (g_strcmp0 (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0) {
+ g_file_info_set_file_type (info, G_FILE_TYPE_DIRECTORY);
+ }
+
file_type = g_file_info_get_file_type (info);
if (file->details->type != file_type) {
changed = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]