[tracker-miners/wip/carlosg/speed-track: 12/40] libtracker-miner: Drop tracker_file_notifier_query_file_exists()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/speed-track: 12/40] libtracker-miner: Drop tracker_file_notifier_query_file_exists()
- Date: Sun, 18 Oct 2020 20:58:43 +0000 (UTC)
commit 0cdf9a48b2acabd58b9d3066711cb70c5ee68dba
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 4 19:06:42 2020 +0200
libtracker-miner: Drop tracker_file_notifier_query_file_exists()
This function is now unused.
src/libtracker-miner/tracker-file-notifier.c | 86 ----------------------------
src/libtracker-miner/tracker-file-notifier.h | 2 -
2 files changed, 88 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 7594800bb..067c5e026 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -83,7 +83,6 @@ typedef struct {
TrackerSparqlStatement *content_query;
TrackerSparqlStatement *urn_query;
- TrackerSparqlStatement *exists_query;
GTimer *timer;
@@ -706,30 +705,6 @@ sparql_urn_ensure_statement (TrackerFileNotifier *notifier,
return priv->urn_query;
}
-static TrackerSparqlStatement *
-sparql_exists_ensure_statement (TrackerFileNotifier *notifier,
- GError **error)
-{
- TrackerFileNotifierPrivate *priv;
-
- priv = tracker_file_notifier_get_instance_private (notifier);
-
- if (priv->exists_query)
- return priv->exists_query;
-
- priv->exists_query =
- tracker_sparql_connection_query_statement (priv->connection,
- "ASK "
- "{"
- " GRAPH tracker:FileSystem {"
- " ~file a nfo:FileDataObject ."
- " }"
- "}",
- priv->cancellable,
- error);
- return priv->exists_query;
-}
-
static void
query_execute_cb (TrackerSparqlStatement *statement,
GAsyncResult *res,
@@ -1556,7 +1531,6 @@ tracker_file_notifier_finalize (GObject *object)
g_clear_object (&priv->content_query);
g_clear_object (&priv->urn_query);
- g_clear_object (&priv->exists_query);
g_object_unref (priv->crawler);
g_object_unref (priv->monitor);
@@ -1974,66 +1948,6 @@ tracker_file_notifier_get_file_iri (TrackerFileNotifier *notifier,
return iri;
}
-gboolean
-tracker_file_notifier_query_file_exists (TrackerFileNotifier *notifier,
- GFile *file)
-{
- TrackerFileNotifierPrivate *priv;
- GFile *canonical;
- gboolean found;
-
- g_return_val_if_fail (TRACKER_IS_FILE_NOTIFIER (notifier), FALSE);
- g_return_val_if_fail (G_IS_FILE (file), FALSE);
-
- priv = tracker_file_notifier_get_instance_private (notifier);
-
- if (G_UNLIKELY (priv->connection == NULL)) {
- return FALSE;
- }
-
- canonical = tracker_file_system_get_file (priv->file_system,
- file,
- G_FILE_TYPE_REGULAR,
- NULL);
- if (!canonical) {
- return FALSE;
- }
-
- found = tracker_file_system_get_property_full (priv->file_system,
- canonical,
- quark_property_mimetype,
- NULL);
-
- if (!found) {
- TrackerSparqlCursor *cursor;
- TrackerSparqlStatement *statement;
- gchar *uri;
-
- /* Fetch data for this file synchronously */
- statement = sparql_exists_ensure_statement (notifier, NULL);
- if (!statement)
- return FALSE;
-
- uri = g_file_get_uri (file);
- tracker_sparql_statement_bind_string (statement, "file", uri);
- g_free (uri);
-
- cursor = tracker_sparql_statement_execute (statement, NULL, NULL);
- if (!cursor)
- return FALSE;
-
- if (!tracker_sparql_cursor_next (cursor, NULL, NULL)) {
- g_object_unref (cursor);
- return FALSE;
- }
-
- found = tracker_sparql_cursor_get_boolean (cursor, 0);
- g_object_unref (cursor);
- }
-
- return found;
-}
-
static gboolean
file_notifier_invalidate_file_iri_foreach (GFile *file,
gpointer user_data)
diff --git a/src/libtracker-miner/tracker-file-notifier.h b/src/libtracker-miner/tracker-file-notifier.h
index 615491205..371e0bfdd 100644
--- a/src/libtracker-miner/tracker-file-notifier.h
+++ b/src/libtracker-miner/tracker-file-notifier.h
@@ -92,8 +92,6 @@ const gchar * tracker_file_notifier_get_file_iri (TrackerFileNotifier *notif
void tracker_file_notifier_invalidate_file_iri (TrackerFileNotifier *notifier,
GFile *file,
gboolean recursive);
-gboolean tracker_file_notifier_query_file_exists (TrackerFileNotifier *notifier,
- GFile *file);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]