diff options
author | Carlos Soriano <carlos.sorian89@gmail.com> | 2015-01-05 14:02:19 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-01-24 02:06:03 +0100 |
commit | 7f16bffe19ae65a97b6e1396517a2d92c0c8835e (patch) | |
tree | 35d883686f9be24ee510402da72ef1be991dabed /libnautilus-private | |
parent | 2a6da28db757da74316e4a8e5cb5b9d82f74edae (diff) | |
download | nautilus-7f16bffe19ae65a97b6e1396517a2d92c0c8835e.tar.gz |
nautilus-view: drop save search
Seacrhing normally is a matter of just typing at the moment what you
want to search. Probably saving a search and opening it again is more
time cost and a burden than just type what you want to search.
So drop this action.
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-directory.c | 7 | ||||
-rw-r--r-- | libnautilus-private/nautilus-search-directory.c | 64 | ||||
-rw-r--r-- | libnautilus-private/nautilus-search-directory.h | 3 |
3 files changed, 2 insertions, 72 deletions
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c index 9b94c265a..1ab1e51c4 100644 --- a/libnautilus-private/nautilus-directory.c +++ b/libnautilus-private/nautilus-directory.c @@ -546,14 +546,12 @@ nautilus_directory_new (GFile *location) NautilusDirectory *directory; GType type; char *uri; - gboolean is_saved_search; uri = g_file_get_uri (location); - is_saved_search = g_str_has_suffix (uri, NAUTILUS_SAVED_SEARCH_EXTENSION); if (eel_uri_is_desktop (uri)) { type = NAUTILUS_TYPE_DESKTOP_DIRECTORY; - } else if (eel_uri_is_search (uri) || is_saved_search) { + } else if (eel_uri_is_search (uri)) { type = NAUTILUS_TYPE_SEARCH_DIRECTORY; } else { type = NAUTILUS_TYPE_VFS_DIRECTORY; @@ -562,9 +560,6 @@ nautilus_directory_new (GFile *location) g_free (uri); directory = g_object_new (type, "location", location, NULL); - if (is_saved_search) { - nautilus_search_directory_set_saved_search (NAUTILUS_SEARCH_DIRECTORY (directory), location); - } return directory; } diff --git a/libnautilus-private/nautilus-search-directory.c b/libnautilus-private/nautilus-search-directory.c index 3f9144c82..0ec70e0e7 100644 --- a/libnautilus-private/nautilus-search-directory.c +++ b/libnautilus-private/nautilus-search-directory.c @@ -38,7 +38,6 @@ struct NautilusSearchDirectoryDetails { NautilusQuery *query; - char *saved_search_uri; gboolean modified; NautilusSearchEngine *engine; @@ -752,7 +751,6 @@ search_finalize (GObject *object) NautilusSearchDirectory *search; search = NAUTILUS_SEARCH_DIRECTORY (object); - g_free (search->details->saved_search_uri); g_hash_table_destroy (search->details->files_hash); @@ -893,7 +891,7 @@ nautilus_search_directory_set_query (NautilusSearchDirectory *search, } file = nautilus_directory_get_existing_corresponding_file (NAUTILUS_DIRECTORY (search)); - if ((file != NULL) && (search->details->saved_search_uri == NULL)) { + if (file != NULL) { nautilus_search_directory_file_update_display_name (NAUTILUS_SEARCH_DIRECTORY_FILE (file)); } nautilus_file_unref (file); @@ -909,68 +907,8 @@ nautilus_search_directory_get_query (NautilusSearchDirectory *search) return NULL; } -void -nautilus_search_directory_set_saved_search (NautilusSearchDirectory *search, - GFile *saved_search) -{ - NautilusQuery *query; - char *file; - - search->details->saved_search_uri = g_file_get_uri (saved_search); - file = g_file_get_path (saved_search); - - if (file != NULL) { - query = nautilus_query_load (file); - if (query != NULL) { - nautilus_search_directory_set_query (search, query); - g_object_unref (query); - } - g_free (file); - } else { - g_warning ("Non-local saved searches not supported"); - } - - search->details->modified = FALSE; -} - -gboolean -nautilus_search_directory_is_saved_search (NautilusSearchDirectory *search) -{ - return search->details->saved_search_uri != NULL; -} - gboolean nautilus_search_directory_is_modified (NautilusSearchDirectory *search) { return search->details->modified; } - -void -nautilus_search_directory_save_to_file (NautilusSearchDirectory *search, - const char *save_file_uri) -{ - char *file; - - file = g_filename_from_uri (save_file_uri, NULL, NULL); - if (file == NULL) { - return; - } - - if (search->details->query != NULL) { - nautilus_query_save (search->details->query, file); - } - - g_free (file); -} - -void -nautilus_search_directory_save_search (NautilusSearchDirectory *search) -{ - if (search->details->saved_search_uri == NULL) { - return; - } - - nautilus_search_directory_save_to_file (search, - search->details->saved_search_uri); - search->details->modified = FALSE; -} diff --git a/libnautilus-private/nautilus-search-directory.h b/libnautilus-private/nautilus-search-directory.h index fe56cfd3d..6eb7e534c 100644 --- a/libnautilus-private/nautilus-search-directory.h +++ b/libnautilus-private/nautilus-search-directory.h @@ -57,9 +57,6 @@ void nautilus_search_directory_set_saved_search (NautilusSearchDirecto GFile *saved_search); gboolean nautilus_search_directory_is_saved_search (NautilusSearchDirectory *search); gboolean nautilus_search_directory_is_modified (NautilusSearchDirectory *search); -void nautilus_search_directory_save_search (NautilusSearchDirectory *search); -void nautilus_search_directory_save_to_file (NautilusSearchDirectory *search, - const char *save_file_uri); NautilusQuery *nautilus_search_directory_get_query (NautilusSearchDirectory *search); void nautilus_search_directory_set_query (NautilusSearchDirectory *search, |