diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2018-05-23 18:45:56 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2018-07-26 02:49:37 +0200 |
commit | 9cb63ff9a659cb92ffc6cc93850b3702335610b2 (patch) | |
tree | b830c3afbacc957f200e1b114347ff40ef12384e /src/nautilus-search-engine-simple.c | |
parent | 002d6513eeffe04dad7b5ac7b7abb173d5c21aba (diff) | |
download | nautilus-9cb63ff9a659cb92ffc6cc93850b3702335610b2.tar.gz |
search-engine-simple: remove recursive property using query flag instead
Compute the recursive parameter depending on the query flag for recursivity,
enabling it only if the query recursive flag is NAUTILUS_QUERY_RECURSIVE_ALWAYS,
while should be disabled otherwise.
At this point the "recursive" property that was set only for this search engine
doesn't make any sense anymore and we can safely drop it, together with the
calls that were done at search-engine level to handle this special case.
We move now the responsibility to to the engine itself, more than to the model.
Diffstat (limited to 'src/nautilus-search-engine-simple.c')
-rw-r--r-- | src/nautilus-search-engine-simple.c | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/src/nautilus-search-engine-simple.c b/src/nautilus-search-engine-simple.c index bdcdd24ae..2b400ac4a 100644 --- a/src/nautilus-search-engine-simple.c +++ b/src/nautilus-search-engine-simple.c @@ -35,7 +35,7 @@ enum { - PROP_RECURSIVE = 1, + PROP_0, PROP_RUNNING, NUM_PROPERTIES }; @@ -437,9 +437,10 @@ nautilus_search_engine_simple_set_query (NautilusSearchProvider *provider, { NautilusSearchEngineSimple *simple = NAUTILUS_SEARCH_ENGINE_SIMPLE (provider); - g_object_ref (query); g_clear_object (&simple->query); - simple->query = query; + + simple->query = g_object_ref (query); + simple->recursive = nautilus_query_get_recursive (query) == NAUTILUS_QUERY_RECURSIVE_ALWAYS; } static gboolean @@ -453,30 +454,6 @@ nautilus_search_engine_simple_is_running (NautilusSearchProvider *provider) } static void -nautilus_search_engine_simple_set_property (GObject *object, - guint arg_id, - const GValue *value, - GParamSpec *pspec) -{ - NautilusSearchEngineSimple *engine = NAUTILUS_SEARCH_ENGINE_SIMPLE (object); - - switch (arg_id) - { - case PROP_RECURSIVE: - { - engine->recursive = g_value_get_boolean (value); - } - break; - - default: - { - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, arg_id, pspec); - } - break; - } -} - -static void nautilus_search_engine_simple_get_property (GObject *object, guint arg_id, GValue *value, @@ -491,12 +468,6 @@ nautilus_search_engine_simple_get_property (GObject *object, g_value_set_boolean (value, nautilus_search_engine_simple_is_running (NAUTILUS_SEARCH_PROVIDER (engine))); } break; - - case PROP_RECURSIVE: - { - g_value_set_boolean (value, engine->recursive); - } - break; } } @@ -517,20 +488,6 @@ nautilus_search_engine_simple_class_init (NautilusSearchEngineSimpleClass *class gobject_class = G_OBJECT_CLASS (class); gobject_class->finalize = finalize; gobject_class->get_property = nautilus_search_engine_simple_get_property; - gobject_class->set_property = nautilus_search_engine_simple_set_property; - - /** - * NautilusSearchEngineSimple::recursive: - * - * Whether the search is recursive or not. - */ - g_object_class_install_property (gobject_class, - PROP_RECURSIVE, - g_param_spec_boolean ("recursive", - "recursive", - "recursive", - FALSE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); /** * NautilusSearchEngine::running: |