Commit e15c330a authored by Carlos Garnacho's avatar Carlos Garnacho

Remove ignore_next_update() API

It's been deprecated for a long time, it stands in the middle of
detaching TrackerMiner from DBus, and it's one less piece of
ontology-dependent libtracker-miner code. Enough reasons to
finally remove this.
parent ac84484d
......@@ -25,7 +25,6 @@ tracker_miner_manager_index_file_finish
tracker_miner_manager_index_file_for_process
tracker_miner_manager_index_file_for_process_async
tracker_miner_manager_index_file_for_process_finish
tracker_miner_manager_ignore_next_update
<SUBSECTION Standard>
TRACKER_IS_MINER_MANAGER
TRACKER_IS_MINER_MANAGER_CLASS
......
......@@ -232,7 +232,6 @@ TrackerMinerError
tracker_miner_error_quark
tracker_miner_start
tracker_miner_stop
tracker_miner_ignore_next_update
tracker_miner_is_started
tracker_miner_is_paused
tracker_miner_get_n_pause_reasons
......
......@@ -36,10 +36,6 @@ class MyMiner (TrackerMiner.Miner):
def progress (self):
print "override progress"
def ignore_next_update (self):
print "override ignore next updated"
if __name__ == "__main__":
m = MyMiner ()
m.start ()
......
......@@ -14,8 +14,6 @@ namespace Tracker {
public unowned string get_display_name (string miner);
public GLib.SList<string>? get_running ();
public bool get_status (string miner, out string status, out double progress, out int remaining_time);
[Deprecated (since = "0.12")]
public bool ignore_next_update (string miner, string urls);
public bool index_file (GLib.File file) throws GLib.Error;
public async bool index_file_async (GLib.File file, GLib.Cancellable? cancellable = null) throws GLib.Error;
public bool is_active (string miner);
......
......@@ -1391,65 +1391,6 @@ tracker_miner_manager_get_description (TrackerMinerManager *manager,
return NULL;
}
#ifndef TRACKER_DISABLE_DEPRECATED
/**
* tracker_miner_manager_ignore_next_update:
* @manager: a #TrackerMinerManager
* @miner: miner reference
* @urls: (in): the subjects to ignore the next updates of
*
* Tells the @miner to ignore any events for the next @urls. This is
* used for cases where a file is updated by Tracker by the
* tracker-writeback service. This API is used to avoid signalling up
* the stack the changes to @urls.
*
* Returns: %TRUE on success, otherwise %FALSE.
*
* Since: 0.8
*
* Deprecated: 0.12
**/
gboolean
tracker_miner_manager_ignore_next_update (TrackerMinerManager *manager,
const gchar *miner,
const gchar **urls)
{
GDBusProxy *proxy;
GError *error = NULL;
GVariant *v;
g_return_val_if_fail (TRACKER_IS_MINER_MANAGER (manager), FALSE);
g_return_val_if_fail (miner != NULL, FALSE);
proxy = find_miner_proxy (manager, miner, TRUE);
if (!proxy) {
g_warning ("No D-Bus proxy found for miner '%s'", miner);
return FALSE;
}
v = g_dbus_proxy_call_sync (proxy,
"IgnoreNextUpdate",
g_variant_new ("(^as)", urls),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);
if (error) {
g_warning ("Could not ignore next update for miner '%s': %s", miner, error->message);
g_error_free (error);
return FALSE;
}
g_variant_unref (v);
return TRUE;
}
#endif /* TRACKER_DISABLE_DEPRECATED */
/**
* tracker_miner_manager_error_quark:
*
......
......@@ -155,12 +155,6 @@ gboolean tracker_miner_manager_index_file_for_process_finish (Tracke
GAsyncResult *result,
GError **error);
#ifndef TRACKER_DISABLE_DEPRECATED
gboolean tracker_miner_manager_ignore_next_update (TrackerMinerManager *manager,
const gchar *miner,
const gchar **urls) G_GNUC_DEPRECATED;
#endif /* TRACKER_DISABLE_DEPRECATED */
G_END_DECLS
#endif /* __LIBTRACKER_CONTROL_MANAGER_H__ */
......@@ -9,7 +9,6 @@ Miner
MinerFS
.finished_root#virtual_method skip
.ignore_next_update_file.builder type="Tracker.Sparql.Builder"
.process_file.builder type="Tracker.Sparql.Builder"
.process_file_attributes.builder type="Tracker.Sparql.Builder"
.writeback_file#method skip
......
......@@ -181,7 +181,6 @@ struct _TrackerMinerFSPrivate {
guint item_queues_handler_id;
GFile *item_queue_blocker;
GHashTable *items_ignore_next_update;
#ifdef EVENT_QUEUE_ENABLE_TRACE
guint queue_status_timeout_id;
......@@ -257,7 +256,6 @@ typedef enum {
QUEUE_UPDATED,
QUEUE_DELETED,
QUEUE_MOVED,
QUEUE_IGNORE_NEXT_UPDATE,
QUEUE_WAIT,
QUEUE_WRITEBACK
} QueueState;
......@@ -265,7 +263,6 @@ typedef enum {
enum {
PROCESS_FILE,
PROCESS_FILE_ATTRIBUTES,
IGNORE_NEXT_UPDATE_FILE,
FINISHED,
WRITEBACK_FILE,
FINISHED_ROOT,
......@@ -305,8 +302,6 @@ static void miner_started (TrackerMiner
static void miner_stopped (TrackerMiner *miner);
static void miner_paused (TrackerMiner *miner);
static void miner_resumed (TrackerMiner *miner);
static void miner_ignore_next_update (TrackerMiner *miner,
const GStrv subjects);
static ItemMovedData *item_moved_data_new (GFile *file,
GFile *source_file);
static void item_moved_data_free (ItemMovedData *data);
......@@ -389,7 +384,6 @@ tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
miner_class->stopped = miner_stopped;
miner_class->paused = miner_paused;
miner_class->resumed = miner_resumed;
miner_class->ignore_next_update = miner_ignore_next_update;
g_object_class_install_property (object_class,
PROP_THROTTLE,
......@@ -514,36 +508,6 @@ tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
G_TYPE_BOOLEAN,
3, G_TYPE_FILE, TRACKER_SPARQL_TYPE_BUILDER, G_TYPE_CANCELLABLE);
/**
* TrackerMinerFS::ignore-next-update-file:
* @miner_fs: the #TrackerMinerFS
* @file: a #GFile
* @builder: a #TrackerSparqlBuilder
* @cancellable: a #GCancellable
*
* The ::ignore-next-update-file signal is emitted whenever a file should
* be marked as to ignore on next update, and it's metadata prepared for that.
*
* @builder is the #TrackerSparqlBuilder where all sparql updates
* to be performed for @file will be appended.
*
* Returns: %TRUE on success
* %FALSE on failure
*
* Since: 0.8
*
* Deprecated: 0.12
**/
signals[IGNORE_NEXT_UPDATE_FILE] =
g_signal_new ("ignore-next-update-file",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TrackerMinerFSClass, ignore_next_update_file),
NULL, NULL,
NULL,
G_TYPE_BOOLEAN,
3, G_TYPE_FILE, TRACKER_SPARQL_TYPE_BUILDER, G_TYPE_CANCELLABLE);
/**
* TrackerMinerFS::finished:
* @miner_fs: the #TrackerMinerFS
......@@ -706,10 +670,6 @@ tracker_miner_fs_init (TrackerMinerFS *object)
object);
#endif /* PROCESSING_POOL_ENABLE_TRACE */
priv->items_ignore_next_update = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) NULL);
/* Create processing pools */
priv->task_pool = tracker_task_pool_new (DEFAULT_WAIT_POOL_LIMIT);
g_signal_connect (priv->task_pool, "notify::limit-reached",
......@@ -891,8 +851,6 @@ fs_finalize (GObject *object)
NULL);
tracker_priority_queue_unref (priv->items_writeback);
g_hash_table_unref (priv->items_ignore_next_update);
if (priv->indexing_tree) {
g_object_unref (priv->indexing_tree);
}
......@@ -1110,23 +1068,6 @@ miner_resumed (TrackerMiner *miner)
}
static void
miner_ignore_next_update (TrackerMiner *miner, const GStrv urls)
{
TrackerMinerFS *fs;
guint n;
fs = TRACKER_MINER_FS (miner);
for (n = 0; urls[n] != NULL; n++) {
g_hash_table_insert (fs->priv->items_ignore_next_update,
g_strdup (urls[n]),
GINT_TO_POINTER (TRUE));
}
item_queue_handlers_set_up (fs);
}
static void
notify_roots_finished (TrackerMinerFS *fs,
gboolean check_queues)
......@@ -1717,99 +1658,6 @@ item_remove (TrackerMinerFS *fs,
return TRUE;
}
static gboolean
item_ignore_next_update (TrackerMinerFS *fs,
GFile *file,
GFile *source_file)
{
TrackerSparqlBuilder *sparql;
gchar *uri;
gboolean success = FALSE;
GCancellable *cancellable;
GFile *working_file;
/* While we are in ignore-on-next-update:
* o. We always ignore deletes because it's never the final operation
* of a write. We have a delete when both are null.
* o. A create means the write used rename(). This is the final
* operation of a write and thus we make the update query.
* We have a create when file == null and source_file != null
* o. A move means the write used rename(). This is the final
* operation of a write and thus we make the update query.
* We have a move when both file and source_file aren't null.
* o. A update means the write didn't use rename(). This is the
* final operation of a write and thus we make the update query.
* An update means that file != null and source_file == null. */
/* Happens on delete while in write */
if (!file && !source_file) {
return TRUE;
}
/* Create or update, we are the final one so we make the update query */
if (!file && source_file) {
/* Happens on create while in write */
working_file = source_file;
} else {
/* Happens on update while in write */
working_file = file;
}
uri = g_file_get_uri (working_file);
g_debug ("Updating item: '%s' (IgnoreNextUpdate event)", uri);
cancellable = g_cancellable_new ();
sparql = tracker_sparql_builder_new_update ();
g_object_ref (working_file);
/* IgnoreNextUpdate */
g_signal_emit (fs, signals[IGNORE_NEXT_UPDATE_FILE], 0,
working_file, sparql, cancellable, &success);
if (success) {
gchar *query;
/* Perhaps we should move the DELETE to tracker-miner-files.c?
* Or we add support for DELETE to TrackerSparqlBuilder ofcrs */
query = g_strdup_printf ("DELETE { GRAPH <%s> { "
" ?u nfo:fileSize ?unknown1 ; "
" nfo:fileLastModified ?unknown2 ; "
" nfo:fileLastAccessed ?unknown3 ; "
" nie:mimeType ?unknown4 } "
"} WHERE { GRAPH <%s> { "
" ?u nfo:fileSize ?unknown1 ; "
" nfo:fileLastModified ?unknown2 ; "
" nfo:fileLastAccessed ?unknown3 ; "
" nie:mimeType ?unknown4 ; "
" nie:url \"%s\" } "
"} %s", TRACKER_OWN_GRAPH_URN,
TRACKER_OWN_GRAPH_URN, uri,
tracker_sparql_builder_get_result (sparql));
tracker_sparql_connection_update_async (tracker_miner_get_connection (TRACKER_MINER (fs)),
query,
G_PRIORITY_DEFAULT,
NULL,
NULL,
NULL);
g_free (query);
}
g_hash_table_remove (fs->priv->items_ignore_next_update, uri);
g_object_unref (sparql);
g_object_unref (working_file);
g_object_unref (cancellable);
g_free (uri);
return FALSE;
}
static void
move_thumbnails_cb (GObject *object,
GAsyncResult *result,
......@@ -2059,18 +1907,6 @@ item_move (TrackerMinerFS *fs,
return TRUE;
}
static gboolean
check_ignore_next_update (TrackerMinerFS *fs, GFile *queue_file)
{
gchar *uri = g_file_get_uri (queue_file);
if (g_hash_table_lookup (fs->priv->items_ignore_next_update, uri)) {
g_free (uri);
return TRUE;
}
g_free (uri);
return FALSE;
}
static gboolean
should_wait (TrackerMinerFS *fs,
GFile *file)
......@@ -2192,8 +2028,7 @@ item_queue_get_next_file (TrackerMinerFS *fs,
trace_eq_pop_head ("DELETED", queue_file);
/* Do not ignore DELETED event even if file is marked as
IgnoreNextUpdate. We should never see DELETED on update
/* Do not ignore DELETED event. We should never see DELETED on update
(atomic rename or in-place update) but we may see DELETED
due to actual file deletion right after update. */
......@@ -2220,32 +2055,6 @@ item_queue_get_next_file (TrackerMinerFS *fs,
trace_eq_pop_head ("CREATED", queue_file);
/* Note:
* We won't be considering an IgnoreNextUpdate request if
* the event being processed is a CREATED event and the
* file was still unknown to tracker.
*/
if (check_ignore_next_update (fs, queue_file)) {
gchar *uri;
uri = g_file_get_uri (queue_file);
if (lookup_file_urn (fs, queue_file, FALSE) != NULL) {
g_debug ("CREATED event ignored on file '%s' as it already existed, "
" processing as IgnoreNextUpdate...",
uri);
g_free (uri);
return QUEUE_IGNORE_NEXT_UPDATE;
} else {
/* Just remove the IgnoreNextUpdate request */
g_debug ("Skipping the IgnoreNextUpdate request on CREATED event for '%s', file is actually new",
uri);
g_hash_table_remove (fs->priv->items_ignore_next_update, uri);
g_free (uri);
}
}
/* If the same item OR its first parent is currently being processed,
* we need to wait for this event */
if (should_wait (fs, queue_file)) {
......@@ -2270,18 +2079,6 @@ item_queue_get_next_file (TrackerMinerFS *fs,
trace_eq_pop_head ("UPDATED", queue_file);
if (check_ignore_next_update (fs, queue_file)) {
gchar *uri;
uri = g_file_get_uri (queue_file);
g_debug ("UPDATED event ignored on file '%s', "
" processing as IgnoreNextUpdate...",
uri);
g_free (uri);
return QUEUE_IGNORE_NEXT_UPDATE;
}
/* If the same item OR its first parent is currently being processed,
* we need to wait for this event */
if (should_wait (fs, queue_file)) {
......@@ -2303,24 +2100,6 @@ item_queue_get_next_file (TrackerMinerFS *fs,
if (data) {
trace_eq_pop_head_2 ("MOVED", data->file, data->source_file);
if (check_ignore_next_update (fs, data->file)) {
gchar *uri;
gchar *source_uri;
uri = g_file_get_uri (queue_file);
source_uri = g_file_get_uri (data->source_file);
g_debug ("MOVED event ignored on files '%s->%s', "
" processing as IgnoreNextUpdate on '%s'",
source_uri, uri, uri);
g_free (uri);
g_free (source_uri);
*file = g_object_ref (data->file);
*source_file = g_object_ref (data->source_file);
item_moved_data_free (data);
return QUEUE_IGNORE_NEXT_UPDATE;
}
/* If the same item OR its first parent is currently being processed,
* we need to wait for this event */
if (should_wait (fs, data->file) ||
......@@ -2593,9 +2372,6 @@ item_queue_handlers_cb (gpointer user_data)
g_object_unref (parent);
}
break;
case QUEUE_IGNORE_NEXT_UPDATE:
keep_processing = item_ignore_next_update (fs, file, source_file);
break;
case QUEUE_WRITEBACK:
/* Nothing to do here */
......
......@@ -60,8 +60,6 @@ struct _TrackerMinerFS {
* @parent: parent object class
* @process_file: Called when the metadata associated to a file is
* requested.
* @ignore_next_update_file: Called after a writeback event happens on
* a file (deprecated since 0.12).
* @finished: Called when all processing has been performed.
* @process_file_attributes: Called when the metadata associated with
* a file's attributes changes, for example, the mtime.
......@@ -80,10 +78,6 @@ typedef struct {
GFile *file,
TrackerSparqlBuilder *builder,
GCancellable *cancellable);
gboolean (* ignore_next_update_file) (TrackerMinerFS *fs,
GFile *file,
TrackerSparqlBuilder *builder,
GCancellable *cancellable);
void (* finished) (TrackerMinerFS *fs,
gdouble elapsed,
gint directories_found,
......
......@@ -96,9 +96,6 @@ static const gchar miner_introspection_xml[] =
" <method name='Resume'>"
" <arg type='i' name='cookie' direction='in' />"
" </method>"
" <method name='IgnoreNextUpdate'>"
" <arg type='as' name='urls' direction='in' />"
" </method>"
" <signal name='Started' />"
" <signal name='Stopped' />"
" <signal name='Paused' />"
......@@ -157,7 +154,6 @@ enum {
PAUSED,
RESUMED,
PROGRESS,
IGNORE_NEXT_UPDATE,
LAST_SIGNAL
};
......@@ -339,27 +335,6 @@ tracker_miner_class_init (TrackerMinerClass *klass)
G_TYPE_DOUBLE,
G_TYPE_INT);
/**
* TrackerMiner::ignore-next-update:
* @miner: the #TrackerMiner
* @urls: the urls to mark as ignore on next update
*
* the ::ignore-next-update signal is emitted in the miner
* right after it has been asked to mark @urls as to ignore on next update
* through tracker_miner_ignore_next_update().
*
* Since: 0.8
**/
signals[IGNORE_NEXT_UPDATE] =
g_signal_new ("ignore-next-update",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TrackerMinerClass, ignore_next_update),
NULL, NULL,
NULL,
G_TYPE_NONE, 1,
G_TYPE_STRV);
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
......@@ -857,24 +832,6 @@ tracker_miner_stop (TrackerMiner *miner)
}
}
/**
* tracker_miner_ignore_next_update:
* @miner: a #TrackerMiner
* @urls: (in): the urls to mark as to ignore on next update
*
* Tells the miner to mark @urls are to ignore on next update.
*
* Since: 0.8
**/
void
tracker_miner_ignore_next_update (TrackerMiner *miner,
const GStrv urls)
{
g_return_if_fail (TRACKER_IS_MINER (miner));
g_signal_emit (miner, signals[IGNORE_NEXT_UPDATE], 0, urls);
}
/**
* tracker_miner_is_started:
* @miner: a #TrackerMiner
......@@ -1239,26 +1196,6 @@ handle_method_call_start (TrackerMiner *miner,
g_dbus_method_invocation_return_value (invocation, NULL);
}
static void
handle_method_call_ignore_next_update (TrackerMiner *miner,
GDBusMethodInvocation *invocation,
GVariant *parameters)
{
GStrv urls = NULL;
TrackerDBusRequest *request;
g_variant_get (parameters, "(^a&s)", &urls);
request = tracker_g_dbus_request_begin (invocation,
"%s", __PRETTY_FUNCTION__);
tracker_miner_ignore_next_update (miner, urls);
tracker_dbus_request_end (request, NULL);
g_dbus_method_invocation_return_value (invocation, NULL);
g_free (urls);
}
static void
handle_method_call_resume (TrackerMiner *miner,
GDBusMethodInvocation *invocation,
......@@ -1465,9 +1402,7 @@ handle_method_call (GDBusConnection *connection,
tracker_gdbus_async_return_if_fail (miner != NULL, invocation);
if (g_strcmp0 (method_name, "IgnoreNextUpdate") == 0) {
handle_method_call_ignore_next_update (miner, invocation, parameters);
} else if (g_strcmp0 (method_name, "Start") == 0) {
if (g_strcmp0 (method_name, "Start") == 0) {
handle_method_call_start (miner, invocation, parameters);
} else if (g_strcmp0 (method_name, "Resume") == 0) {
handle_method_call_resume (miner, invocation, parameters);
......
......@@ -113,7 +113,6 @@ struct _TrackerMiner {
* @paused: Called when the miner is told to pause.
* @resumed: Called when the miner is told to resume activity.
* @progress: progress.
* @ignore_next_update: Called after ignore on next update event happens.
* @padding: Reserved for future API improvements.
*
* Virtual methods left to implement.
......@@ -132,9 +131,6 @@ typedef struct {
const gchar *status,
gdouble progress);
void (* ignore_next_update) (TrackerMiner *miner,
const GStrv urls);
/* <Private> */
gpointer padding[10];
} TrackerMinerClass;
......@@ -175,8 +171,6 @@ GQuark tracker_miner_error_quark (void);
void tracker_miner_start (TrackerMiner *miner);
void tracker_miner_stop (TrackerMiner *miner);
void tracker_miner_ignore_next_update (TrackerMiner *miner,
const GStrv urls);
gboolean tracker_miner_is_started (TrackerMiner *miner);
gboolean tracker_miner_is_paused (TrackerMiner *miner);
......
......@@ -100,7 +100,6 @@ namespace Tracker {
[NoAccessorMethod]
public string status { owned get; set construct; }
[HasEmitter]
public virtual signal void ignore_next_update ([CCode (array_length = false, array_null_terminated = true)] string[] urls);
public virtual signal void paused ();
public virtual signal void resumed ();
public virtual signal void started ();
......@@ -148,7 +147,6 @@ namespace Tracker {
public virtual signal void finished (double elapsed, uint directories_found, uint directories_ignored, uint files_found, uint files_ignored);
public virtual signal void finished_root (GLib.File root);
[Deprecated (since = "0.12")]
public virtual signal bool ignore_next_update_file (GLib.File file, Tracker.Sparql.Builder builder, GLib.Cancellable? cancellable = null);
public virtual signal bool process_file (GLib.File file, Tracker.Sparql.Builder builder, GLib.Cancellable? cancellable = null);
public virtual signal bool process_file_attributes (GLib.File file, Tracker.Sparql.Builder builder, GLib.Cancellable? cancellable = null);
public signal bool writeback_file (GLib.File file, [CCode (array_length = false, array_null_terminated = true)] string[] rdf_types, GLib.GenericArray<string[]> results, GLib.Cancellable? cancellable = null);
......
......@@ -40,12 +40,6 @@
<arg type="i" name="cookie" direction="in" />
</method>
<!-- Deprecated since 0.12 -->
<method name="IgnoreNextUpdate">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="as" name="urls" direction="in" />
</method>
<!-- Signals -->
<signal name="Started" />
<signal name="Stopped">
......
......@@ -180,10 +180,6 @@ static gboolean miner_files_process_file_attributes (TrackerMinerFS *f
GFile *file,
TrackerSparqlBuilder *sparql,
GCancellable *cancellable);
static gboolean miner_files_ignore_next_update_file (TrackerMinerFS *fs,
GFile *file,
TrackerSparqlBuilder *sparql,
GCancellable *cancellable);
static void miner_files_finished (TrackerMinerFS *fs,
gdouble elapsed,
gint directories_found,
......@@ -228,7 +224,6 @@ tracker_miner_files_class_init (TrackerMinerFilesClass *klass)
miner_fs_class->process_file = miner_files_process_file;
miner_fs_class->process_file_attributes = miner_files_process_file_attributes;
miner_fs_class->ignore_next_update_file = miner_files_ignore_next_update_file;
miner_fs_class->finished = miner_files_finished;
g_object_class_install_property (object_class,
......@@ -2422,79 +2417,6 @@ miner_files_process_file_attributes (TrackerMinerFS *fs,
return TRUE;
}
static gboolean
miner_files_ignore_next_update_file (TrackerMinerFS *fs,
GFile *file,
TrackerSparqlBuilder *sparql,
GCancellable *cancellable)
{
const gchar *attrs;
const gchar *mime_type;
GFileInfo *file_info;
guint64 time_;
gchar *uri;
GError *error = NULL;
attrs = G_FILE_ATTRIBUTE_STANDARD_TYPE ","
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME ","
G_FILE_ATTRIBUTE_STANDARD_SIZE ","
G_FILE_ATTRIBUTE_TIME_MODIFIED ","
G_FILE_ATTRIBUTE_TIME_ACCESS;
file_info = g_file_query_info (file, attrs,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
cancellable, &error);
if (error) {
g_warning ("Can't ignore-next-update: '%s'", error->message);
g_clear_error (&error);
return FALSE;
}
uri = g_file_get_uri (file);
mime_type = g_file_info_get_content_type (file_info);
/* For ignore-next-update we only write a few properties back. These properties
* should NEVER be marked as tracker:writeback in the ontology! (else you break
* the tracker-writeback feature) */
tracker_sparql_builder_insert_silent_open (sparql, TRACKER_OWN_GRAPH_URN);
tracker_sparql_builder_subject_variable (sparql, "urn");
tracker_sparql_builder_predicate (sparql, "a");
tracker_sparql_builder_object (sparql, "nfo:FileDataObject");
tracker_sparql_builder_predicate (sparql, "nfo:fileSize");
tracker_sparql_builder_object_int64 (sparql, g_file_info_get_size (file_info));
time_ = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
tracker_sparql_builder_predicate (sparql, "nfo:fileLastModified");
tracker_sparql_builder_object_date (sparql, (time_t *) &time_);
time_ = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_ACCESS);
tracker_sparql_builder_predicate (sparql, "nfo:fileLastAccessed");
tracker_sparql_builder_object_date (sparql, (time_t *) &time_);
tracker_sparql_builder_predicate (sparql, "nie:mimeType");
tracker_sparql_builder_object_string (sparql, mime_type);
tracker_sparql_builder_insert_close (sparql);
tracker_sparql_builder_where_open (sparql);
tracker_sparql_builder_subject_variable (sparql, "urn");
tracker_sparql_builder_predicate (sparql, "nie:url");
tracker_sparql_builder_object_string (sparql, uri);
tracker_sparql_builder_where_close (sparql);