[gnome-notes] tracker: Remove unused code



commit f8e7cc975b4895486f4f9e1e8235fc6fb1fb9dac
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Sat Jun 5 13:15:30 2021 +0530

    tracker: Remove unused code

 src/libbiji/biji-tracker.c | 139 ---------------------------------------------
 src/libbiji/biji-tracker.h |  14 -----
 2 files changed, 153 deletions(-)
---
diff --git a/src/libbiji/biji-tracker.c b/src/libbiji/biji-tracker.c
index d89f8329..9b038dc0 100644
--- a/src/libbiji/biji-tracker.c
+++ b/src/libbiji/biji-tracker.c
@@ -760,142 +760,3 @@ biji_tracker_ensure_resource_from_info (BijiManager *manager,
 
   g_free (query);
 }
-
-
-
-
-
-void
-biji_tracker_ensure_datasource (BijiManager *manager,
-                                const gchar *datasource,
-                                const gchar *identifier,
-                                BijiBoolCallback cb,
-                                gpointer user_data)
-{
-  gchar *query;
-
-
-  query = g_strdup_printf (
-    "INSERT OR REPLACE INTO <%s> {"
-    "  <%s> a nie:DataSource ; nao:identifier \"%s\" }",
-    datasource,
-    datasource,
-    identifier);
-
-  biji_perform_update_async_and_free (
-    get_connection (manager), query, cb, user_data);
-}
-
-
-
-static void
-on_info_queried (GObject *source_object,
-                 GAsyncResult *res,
-                 gpointer user_data)
-{
-  TrackerSparqlConnection *connection;
-  TrackerSparqlCursor     *cursor;
-  BijiTrackerFinisher     *finisher;
-  GError                  *error;
-  BijiInfoSet             *retval;
-
-  connection = TRACKER_SPARQL_CONNECTION (source_object);
-  finisher = user_data;
-  error = NULL;
-  retval = NULL;
-  cursor = tracker_sparql_connection_query_finish (connection, res, &error);
-
-  if (error)
-  {
-    g_warning ("Check for Info : error %s", error->message);
-    g_error_free (error);
-
-    /* Something went wrong, callback and free memory
-       & leave tracker alone */
-    if (finisher->info_cb != NULL)
-      finisher->info_cb (retval, finisher->user_data);
-    biji_tracker_finisher_free (finisher);
-    return;
-  }
-
-  /* Queried resource found into tracker */
-  if (cursor)
-  {
-    if (tracker_sparql_cursor_next (cursor, NULL, NULL))
-    {
-      retval = biji_info_set_new ();
-
-      retval->url = g_strdup (tracker_sparql_cursor_get_string (cursor, 0, NULL));
-      retval->title = g_strdup (tracker_sparql_cursor_get_string (cursor, 1, NULL));
-      retval->mtime = iso8601_to_gint64 (tracker_sparql_cursor_get_string (cursor, 2, NULL));
-
-      retval->content = biji_str_replace (
-        tracker_sparql_cursor_get_string (cursor, 3, NULL), "b&lt;br/&gt", "\n");
-
-      retval->created = iso8601_to_gint64 (tracker_sparql_cursor_get_string (cursor, 4, NULL));
-
-
-      /* Check if the resource is up to date */
-
-      if (finisher->info->mtime != retval->mtime)
-        g_clear_pointer (&retval, biji_info_set_free);
-    }
-
-    g_object_unref (cursor);
-  }
-
-
-  /* No matter retval or not, we are supposed to callback
-   * (REMEMBER CALLER IS RESPONSIBLE FOR FREEING INFO SET) */
-  if (finisher->info_cb != NULL)
-    finisher->info_cb (retval, finisher->user_data);
-
-
-  biji_tracker_finisher_free (finisher);
-}
-
-
-void
-biji_tracker_check_for_info                (BijiManager *manager,
-                                            gchar *url,
-                                            gint64 mtime,
-                                            BijiInfoCallback callback,
-                                            gpointer user_data)
-{
-  BijiInfoSet *info;
-  BijiTrackerFinisher *finisher;
-  gchar *query;
-
-  query = g_strconcat (
-    " SELECT ?urn ?title ?time ?content ?created",
-    " WHERE { ?urn a nfo:Note ;",
-    "         nie:title ?title ;",
-    "         nie:contentLastModified ?time ;",
-    "         nie:plainTextContent ?content ;",
-    "         nie:contentCreated ?created ;",
-    "         nie:url '", url, "' }",
-    NULL);
-
-  /* No matter user callback or not,
-   * we'll need our own to push if needed */
-  info = biji_info_set_new ();
-  info->url = url;
-  info->mtime = mtime;
-
-  finisher = biji_tracker_finisher_new (
-               manager,
-               NULL,
-               info,
-               NULL,
-               callback,
-               NULL,
-               NULL,
-               NULL,
-               user_data);
-
-  tracker_sparql_connection_query_async (
-      get_connection (manager), query, NULL, on_info_queried, finisher);
-
-
-  g_free (query);
-}
diff --git a/src/libbiji/biji-tracker.h b/src/libbiji/biji-tracker.h
index 576a20f5..d10f4417 100644
--- a/src/libbiji/biji-tracker.h
+++ b/src/libbiji/biji-tracker.h
@@ -104,17 +104,3 @@ void        biji_tracker_trash_resource               (BijiManager *manager,
 
 void        biji_tracker_ensure_resource_from_info    (BijiManager     *manager,
                                                         BijiInfoSet *info);
-
-
-void        biji_tracker_ensure_datasource             (BijiManager *manager, 
-                                                        const gchar *datasource_id,
-                                                        const gchar *identifier,
-                                                        BijiBoolCallback cb,
-                                                        gpointer user_data);
-
-
-void        biji_tracker_check_for_info                (BijiManager *manager, 
-                                                        gchar *url,
-                                                        gint64 mtime,
-                                                        BijiInfoCallback callback,
-                                                        gpointer user_data);


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