[gtk/kill-simple-search: 2/2] Remove simple search engine



commit 79c8a16b8d293a7a52e55ff0a5d165607e591bd8
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 31 16:52:03 2020 +0100

    Remove simple search engine

 gtk/gtksearchengine.c       |  47 +-----
 gtk/gtksearchenginesimple.c | 386 --------------------------------------------
 gtk/gtksearchenginesimple.h |  52 ------
 gtk/meson.build             |   1 -
 4 files changed, 1 insertion(+), 485 deletions(-)
---
diff --git a/gtk/gtksearchengine.c b/gtk/gtksearchengine.c
index 74496c9695..3f7ba58a3a 100644
--- a/gtk/gtksearchengine.c
+++ b/gtk/gtksearchengine.c
@@ -21,7 +21,6 @@
 
 #include "config.h"
 #include "gtksearchengine.h"
-#include "gtksearchenginesimple.h"
 #include "gtksearchenginetracker.h"
 #include "gtksearchenginemodel.h"
 #include "gtksearchenginequartz.h"
@@ -38,10 +37,6 @@ struct _GtkSearchEnginePrivate {
   gboolean native_running;
   gchar *native_error;
 
-  GtkSearchEngine *simple;
-  gboolean simple_running;
-  gchar *simple_error;
-
   GtkSearchEngine *model;
   gboolean model_running;
   gchar *model_error;
@@ -74,9 +69,6 @@ set_query (GtkSearchEngine *engine,
   if (engine->priv->native)
     _gtk_search_engine_set_query (engine->priv->native, query);
 
-  if (engine->priv->simple)
-    _gtk_search_engine_set_query (engine->priv->simple, query);
-
   if (engine->priv->model)
     _gtk_search_engine_set_query (engine->priv->model, query);
 }
@@ -93,13 +85,6 @@ start (GtkSearchEngine *engine)
       engine->priv->native_running = TRUE;
     }
 
-  if (engine->priv->simple)
-    {
-      g_clear_pointer (&engine->priv->simple_error, g_free);
-      _gtk_search_engine_start (engine->priv->simple);
-      engine->priv->simple_running = TRUE;
-    }
-
   if (engine->priv->model)
     {
       g_clear_pointer (&engine->priv->model_error, g_free);
@@ -119,12 +104,6 @@ stop (GtkSearchEngine *engine)
       engine->priv->native_running = FALSE;
     }
 
-  if (engine->priv->simple)
-    {
-      _gtk_search_engine_stop (engine->priv->simple);
-      engine->priv->simple_running = FALSE;
-    }
-
   if (engine->priv->model)
     {
       _gtk_search_engine_stop (engine->priv->model);
@@ -144,9 +123,6 @@ finalize (GObject *object)
   g_clear_object (&engine->priv->native);
   g_free (engine->priv->native_error);
 
-  g_clear_object (&engine->priv->simple);
-  g_free (engine->priv->simple_error);
-
   g_clear_object (&engine->priv->model);
   g_free (engine->priv->model_error);
 
@@ -241,7 +217,7 @@ update_status (GtkSearchEngine *engine)
 {
   gboolean running;
 
-  running = engine->priv->native_running || engine->priv->simple_running;
+  running = engine->priv->native_running;
 
   if (running != engine->priv->running)
     {
@@ -251,8 +227,6 @@ update_status (GtkSearchEngine *engine)
         {
           if (engine->priv->native_error)
             _gtk_search_engine_error (engine, engine->priv->native_error);
-          else if (engine->priv->simple_error)
-            _gtk_search_engine_error (engine, engine->priv->simple_error);
           else if (engine->priv->model_error)
             _gtk_search_engine_error (engine, engine->priv->model_error);
           else
@@ -269,8 +243,6 @@ finished (GtkSearchEngine *engine,
 
   if (engine == composite->priv->native)
     composite->priv->native_running = FALSE;
-  else if (engine == composite->priv->simple)
-    composite->priv->simple_running = FALSE;
   else if (engine == composite->priv->model)
     composite->priv->model_running = FALSE;
 
@@ -290,12 +262,6 @@ error (GtkSearchEngine *engine,
       composite->priv->native_error = g_strdup (message);
       composite->priv->native_running = FALSE;
     }
-  else if (engine == composite->priv->simple)
-    {
-      g_free (composite->priv->simple_error);
-      composite->priv->simple_error = g_strdup (message);
-      composite->priv->simple_running = FALSE;
-    }
   else if (engine == composite->priv->model)
     {
       g_free (composite->priv->model_error);
@@ -363,20 +329,12 @@ _gtk_search_engine_new (void)
 
   engine = g_object_new (GTK_TYPE_SEARCH_ENGINE, NULL);
 
-  engine->priv->simple = _gtk_search_engine_simple_new ();
-  g_debug ("Using simple search engine");
-  connect_engine_signals (engine->priv->simple, engine);
-
 #ifdef HAVE_TRACKER
   engine->priv->native = _gtk_search_engine_tracker_new ();
   if (engine->priv->native)
     {
       g_debug ("Using Tracker search engine");
       connect_engine_signals (engine->priv->native, engine);
-      _gtk_search_engine_simple_set_indexed_cb (GTK_SEARCH_ENGINE_SIMPLE (engine->priv->simple),
-                                                _gtk_search_engine_tracker_is_indexed,
-                                                g_object_ref (engine->priv->native),
-                                                g_object_unref);
     }
 #endif
 
@@ -461,9 +419,6 @@ _gtk_search_engine_set_recursive (GtkSearchEngine *engine,
 
   if (engine->priv->native)
     _gtk_search_engine_set_recursive (engine->priv->native, recursive);
-
-  if (engine->priv->simple)
-    _gtk_search_engine_set_recursive (engine->priv->simple, recursive);
 }
 
 gboolean
diff --git a/gtk/meson.build b/gtk/meson.build
index 17156b001a..bd162d1be5 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -134,7 +134,6 @@ gtk_private_sources = files([
   'gtkscaler.c',
   'gtksearchengine.c',
   'gtksearchenginemodel.c',
-  'gtksearchenginesimple.c',
   'gtksizerequestcache.c',
   'gtkstyleanimation.c',
   'gtkstylecascade.c',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]