[nautilus/wip/antoniof/starred-tag: 6/8] query: Remove unused property
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/starred-tag: 6/8] query: Remove unused property
- Date: Tue, 13 Mar 2018 17:56:52 +0000 (UTC)
commit f7018ba597ad684ce838001b6ba1402da1bd05d6
Author: António Fernandes <antoniof gnome org>
Date: Mon Mar 5 14:41:39 2018 +0000
query: Remove unused property
search_starred is always FALSE, because we don't provide UI to filter
search for starred files.
Remove it and any related code. Doing so, we are dropping the only uses
of hardcoded tag ids outside src/nautilus-tag-manager.c, which makes it
possible to set the tag id as a private constant next commit.
src/nautilus-query.c | 19 -------------------
src/nautilus-query.h | 4 ----
src/nautilus-search-engine-model.c | 16 ----------------
src/nautilus-search-engine-simple.c | 16 ----------------
src/nautilus-search-engine-tracker.c | 5 -----
5 files changed, 60 deletions(-)
---
diff --git a/src/nautilus-query.c b/src/nautilus-query.c
index c3c6ea585..59600d195 100644
--- a/src/nautilus-query.c
+++ b/src/nautilus-query.c
@@ -46,7 +46,6 @@ struct _NautilusQuery
GPtrArray *date_range;
NautilusQuerySearchType search_type;
NautilusQuerySearchContent search_content;
- gboolean search_starred;
gboolean searching;
gboolean recursive;
@@ -344,7 +343,6 @@ nautilus_query_init (NautilusQuery *query)
query->location = g_file_new_for_path (g_get_home_dir ());
query->search_type = g_settings_get_enum (nautilus_preferences, "search-filter-time-type");
query->search_content = NAUTILUS_QUERY_SEARCH_CONTENT_SIMPLE;
- query->search_starred = FALSE;
g_mutex_init (&query->prepared_words_mutex);
}
@@ -552,23 +550,6 @@ nautilus_query_set_search_content (NautilusQuery *query,
}
}
-gboolean
-nautilus_query_get_search_starred (NautilusQuery *query)
-{
- g_return_val_if_fail (NAUTILUS_IS_QUERY (query), FALSE);
-
- return query->search_starred;
-}
-
-void
-nautilus_query_set_search_starred (NautilusQuery *query,
- gboolean search_starred)
-{
- g_return_if_fail (NAUTILUS_IS_QUERY (query));
-
- query->search_starred = search_starred;
-}
-
NautilusQuerySearchType
nautilus_query_get_search_type (NautilusQuery *query)
{
diff --git a/src/nautilus-query.h b/src/nautilus-query.h
index 91bc75467..2264f505f 100644
--- a/src/nautilus-query.h
+++ b/src/nautilus-query.h
@@ -59,10 +59,6 @@ NautilusQuerySearchContent nautilus_query_get_search_content (NautilusQuery *que
void nautilus_query_set_search_content (NautilusQuery *query,
NautilusQuerySearchContent content);
-gboolean nautilus_query_get_search_starred (NautilusQuery *query);
-void nautilus_query_set_search_starred (NautilusQuery *query,
- gboolean search_starred);
-
NautilusQuerySearchType nautilus_query_get_search_type (NautilusQuery *query);
void nautilus_query_set_search_type (NautilusQuery *query,
NautilusQuerySearchType type);
diff --git a/src/nautilus-search-engine-model.c b/src/nautilus-search-engine-model.c
index 7c303a864..c651d9507 100644
--- a/src/nautilus-search-engine-model.c
+++ b/src/nautilus-search-engine-model.c
@@ -27,7 +27,6 @@
#include "nautilus-directory-private.h"
#include "nautilus-file.h"
#include "nautilus-ui-utilities.h"
-#include "nautilus-tag-manager.h"
#define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH
#include "nautilus-debug.h"
@@ -140,7 +139,6 @@ model_directory_ready_cb (NautilusDirectory *directory,
GDateTime *initial_date;
GDateTime *end_date;
GPtrArray *date_range;
- NautilusTagManager *tag_manager;
files = nautilus_directory_get_file_list (directory);
mime_types = nautilus_query_get_mime_types (model->query);
@@ -193,20 +191,6 @@ model_directory_ready_cb (NautilusDirectory *directory,
g_ptr_array_unref (date_range);
}
- if (nautilus_query_get_search_starred (model->query))
- {
- tag_manager = nautilus_tag_manager_get ();
-
- uri = nautilus_file_get_uri (file);
-
- if (!nautilus_tag_manager_file_is_starred (tag_manager, uri))
- {
- found = FALSE;
- }
-
- g_free (uri);
- }
-
if (found)
{
uri = nautilus_file_get_uri (file);
diff --git a/src/nautilus-search-engine-simple.c b/src/nautilus-search-engine-simple.c
index 6752d653f..bdcdd24ae 100644
--- a/src/nautilus-search-engine-simple.c
+++ b/src/nautilus-search-engine-simple.c
@@ -24,7 +24,6 @@
#include "nautilus-search-provider.h"
#include "nautilus-search-engine-simple.h"
#include "nautilus-ui-utilities.h"
-#include "nautilus-tag-manager.h"
#define DEBUG_FLAG NAUTILUS_DEBUG_SEARCH
#include "nautilus-debug.h"
@@ -222,7 +221,6 @@ visit_directory (GFile *dir,
guint64 mtime;
GDateTime *initial_date;
GDateTime *end_date;
- NautilusTagManager *tag_manager;
gchar *uri;
enumerator = g_file_enumerate_children (dir,
@@ -301,20 +299,6 @@ visit_directory (GFile *dir,
end_date);
}
- if (nautilus_query_get_search_starred (data->query))
- {
- tag_manager = nautilus_tag_manager_get ();
-
- uri = g_file_get_uri (child);
-
- if (!nautilus_tag_manager_file_is_starred (tag_manager, uri))
- {
- found = FALSE;
- }
-
- g_free (uri);
- }
-
if (found)
{
NautilusSearchHit *hit;
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index 42f1cd101..2e701a9be 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -354,11 +354,6 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
g_string_append_printf (sparql, "; fts:match '\"%s\"*'", search_text);
}
- if (nautilus_query_get_search_starred (tracker->query))
- {
- g_string_append_printf (sparql, "; nao:hasTag nao:predefined-tag-favorite");
- }
-
if (mime_count > 0)
{
g_string_append (sparql, "; nie:mimeType ?mime");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]