[tracker-miners/wip/carlosg/cli-improvements: 15/47] libtracker-miner: Drop tracker_decorator_fs_prepend_file()




commit f768229d9aa35f528a230f52da2c34d7fb102ed9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Aug 16 13:14:04 2020 +0200

    libtracker-miner: Drop tracker_decorator_fs_prepend_file()
    
    This is unused API, and taps on TrackerDecorator API that would be
    nice to remove.

 src/libtracker-miner/tracker-decorator-fs.c | 52 -----------------------------
 src/libtracker-miner/tracker-decorator-fs.h |  3 --
 src/libtracker-miner/tracker-miner.vapi     |  1 -
 3 files changed, 56 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-decorator-fs.c b/src/libtracker-miner/tracker-decorator-fs.c
index d849e2425..db5e4b762 100644
--- a/src/libtracker-miner/tracker-decorator-fs.c
+++ b/src/libtracker-miner/tracker-decorator-fs.c
@@ -273,55 +273,3 @@ tracker_decorator_fs_init (TrackerDecoratorFS *decorator)
 {
        decorator->priv = tracker_decorator_fs_get_instance_private (decorator);
 }
-
-/**
- * tracker_decorator_fs_prepend_file:
- * @decorator: a #TrackerDecoratorFS
- * @file: a #GFile to process
- *
- * Prepends a file for processing.
- *
- * Returns: the tracker:id of the element corresponding to the file
- *
- * Since: 1.2
- **/
-gint
-tracker_decorator_fs_prepend_file (TrackerDecoratorFS *decorator,
-                                   GFile              *file)
-{
-       TrackerSparqlConnection *sparql_conn;
-       TrackerSparqlCursor *cursor;
-       gchar *query, *uri;
-       gint id, class_id;
-
-       g_return_val_if_fail (TRACKER_IS_DECORATOR_FS (decorator), 0);
-       g_return_val_if_fail (G_IS_FILE (file), 0);
-
-       uri = g_file_get_uri (file);
-       query = g_strdup_printf ("SELECT tracker:id(?urn) tracker:id(?type) {"
-                                "  ?urn a ?type; nie:url \"%s\" "
-                                "}", uri);
-       g_free (uri);
-
-       sparql_conn = tracker_miner_get_connection (TRACKER_MINER (decorator));
-       cursor = tracker_sparql_connection_query (sparql_conn, query,
-                                                 NULL, NULL);
-       g_free (query);
-
-       if (!cursor)
-               return 0;
-
-       if (!tracker_sparql_cursor_next (cursor, NULL, NULL)) {
-               g_object_unref (cursor);
-               return 0;
-       }
-
-       id = tracker_sparql_cursor_get_integer (cursor, 0);
-       class_id = tracker_sparql_cursor_get_integer (cursor, 1);
-
-       tracker_decorator_prepend_id (TRACKER_DECORATOR (decorator),
-                                     id, class_id);
-       g_object_unref (cursor);
-
-       return id;
-}
diff --git a/src/libtracker-miner/tracker-decorator-fs.h b/src/libtracker-miner/tracker-decorator-fs.h
index 2afc205a8..984c81339 100644
--- a/src/libtracker-miner/tracker-decorator-fs.h
+++ b/src/libtracker-miner/tracker-decorator-fs.h
@@ -65,9 +65,6 @@ struct _TrackerDecoratorFSClass {
 
 GType              tracker_decorator_fs_get_type (void) G_GNUC_CONST;
 
-gint               tracker_decorator_fs_prepend_file (TrackerDecoratorFS *decorator,
-                                                      GFile              *file);
-
 G_END_DECLS
 
 #endif /* __LIBTRACKER_MINER_DECORATOR_FS_H__ */
diff --git a/src/libtracker-miner/tracker-miner.vapi b/src/libtracker-miner/tracker-miner.vapi
index 8e94eeedd..9daaabd7e 100644
--- a/src/libtracker-miner/tracker-miner.vapi
+++ b/src/libtracker-miner/tracker-miner.vapi
@@ -30,7 +30,6 @@ namespace Tracker {
        public abstract class DecoratorFS : Tracker.Decorator, GLib.Initable {
                [CCode (has_construct_function = false)]
                protected DecoratorFS ();
-               public int prepend_file (GLib.File file);
        }
        [CCode (cheader_filename = "libtracker-miner/tracker-miner.h", ref_function = 
"tracker_decorator_info_ref", type_id = "tracker_decorator_info_get_type ()", unref_function = 
"tracker_decorator_info_unref")]
        [Compact]


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