[grilo-plugins/wip/carlosg/tracker3: 2/41] tracker3: Drop checks for special UPnP ontology



commit 32d47e70fb305d5f0da16e0f8841b9052be4bc58
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon May 11 12:37:16 2020 +0200

    tracker3: Drop checks for special UPnP ontology
    
    This ontology was never upstreamed, probably belonged somewhere
    to maemo/moblin. Anyhow, it seems like dead code today, drop this.

 src/tracker3/grl-tracker-source-priv.h |  1 -
 src/tracker3/grl-tracker.c             | 58 ++++++----------------------------
 2 files changed, 9 insertions(+), 50 deletions(-)
---
diff --git a/src/tracker3/grl-tracker-source-priv.h b/src/tracker3/grl-tracker-source-priv.h
index 95dc5d7f..f396ae1c 100644
--- a/src/tracker3/grl-tracker-source-priv.h
+++ b/src/tracker3/grl-tracker-source-priv.h
@@ -78,7 +78,6 @@ extern GrlPlugin *grl_tracker_plugin;
 
 /* shared data across  */
 extern GrlTrackerCache *grl_tracker_item_cache;
-extern gboolean grl_tracker_upnp_present;
 
 /* tracker plugin config */
 extern gboolean grl_tracker_browse_filesystem;
diff --git a/src/tracker3/grl-tracker.c b/src/tracker3/grl-tracker.c
index 652e77bd..6b613f19 100644
--- a/src/tracker3/grl-tracker.c
+++ b/src/tracker3/grl-tracker.c
@@ -52,13 +52,6 @@ GRL_LOG_DOMAIN_STATIC(tracker_general_log_domain);
   "FILTER(fn:ends-with(?urn,\"nfo#Folder\")) " \
   "}"
 
-#define TRACKER_UPNP_CLASS_REQUEST                      \
-  "SELECT ?urn WHERE "                                  \
-  "{ "                                                  \
-  "?urn a rdfs:Class . "                                \
-  "FILTER(fn:ends-with(?urn,\"upnp#UPnPDataObject\")) " \
-  "}"
-
 #define TRACKER_NOTIFY_FOLDER_UPDATE            \
   "INSERT "                                     \
   "{ "                                          \
@@ -76,7 +69,6 @@ gboolean grl_tracker3_plugin_init (GrlRegistry *registry,
 TrackerSparqlConnection *grl_tracker_connection = NULL;
 GrlPlugin *grl_tracker_plugin;
 GCancellable *grl_tracker_plugin_init_cancel = NULL;
-gboolean grl_tracker_upnp_present = FALSE;
 GrlTrackerQueue *grl_tracker_queue = NULL;
 
 /* tracker plugin config */
@@ -152,41 +144,6 @@ tracker_get_folder_class_cb (GObject      *object,
   g_object_unref (cursor);
 }
 
-static void
-tracker_get_upnp_class_cb (GObject      *object,
-                           GAsyncResult *result,
-                           gpointer      data)
-{
-  GError *error = NULL;
-  TrackerSparqlCursor *cursor;
-
-  GRL_DEBUG ("%s", G_STRFUNC);
-
-  cursor = tracker_sparql_connection_query_finish (grl_tracker_connection,
-                                                   result, &error);
-  if (error) {
-    GRL_INFO ("Could not execute sparql query for upnp class: %s",
-              error->message);
-    g_error_free (error);
-  } else {
-    if (tracker_sparql_cursor_next (cursor, NULL, NULL)) {
-      GRL_DEBUG ("\tUPnP ontology present");
-      grl_tracker_upnp_present = TRUE;
-    }
-  }
-
-  g_clear_object (&cursor);
-
-  if (grl_tracker_browse_filesystem)
-    tracker_sparql_connection_query_async (grl_tracker_connection,
-                                           TRACKER_FOLDER_CLASS_REQUEST,
-                                           grl_tracker_plugin_init_cancel,
-                                           tracker_get_folder_class_cb,
-                                           NULL);
-  else
-    init_sources ();
-}
-
 static void
 tracker_new_connection_cb (GObject      *object,
                            GAsyncResult *res,
@@ -204,13 +161,16 @@ tracker_new_connection_cb (GObject      *object,
     return;
   }
 
-  GRL_DEBUG ("\trequest : '%s'", TRACKER_UPNP_CLASS_REQUEST);
+  GRL_DEBUG ("\trequest : '%s'", TRACKER_FOLDER_CLASS_REQUEST);
 
-  tracker_sparql_connection_query_async (grl_tracker_connection,
-                                         TRACKER_UPNP_CLASS_REQUEST,
-                                         grl_tracker_plugin_init_cancel,
-                                         tracker_get_upnp_class_cb,
-                                         NULL);
+  if (grl_tracker_browse_filesystem)
+    tracker_sparql_connection_query_async (grl_tracker_connection,
+                                           TRACKER_FOLDER_CLASS_REQUEST,
+                                           grl_tracker_plugin_init_cancel,
+                                           tracker_get_folder_class_cb,
+                                           NULL);
+  else
+    init_sources ();
 }
 
 gboolean


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