Commit 0cdf9a48 authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-miner: Drop tracker_file_notifier_query_file_exists()

This function is now unused.
parent 3f05bfe6
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment