/* tracker-resources.c generated by valac 0.14.0, the Vala compiler
 * generated from tracker-resources.vala, do not modify */

/*
 * Copyright (C) 2006, Jamie McCracken <jamiemcc@gnome.org>
 * Copyright (C) 2008-2011, Nokia <ivan.frade@nokia.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <libtracker-common/tracker-common.h>
#include <libtracker-data/tracker-db-interface.h>
#include <libtracker-sparql/tracker-sparql.h>
#include <libtracker-data/tracker-data-query.h>
#include <libtracker-data/tracker-data-update.h>
#include <libtracker-data/tracker-data-backup.h>
#include <libtracker-data/tracker-class.h>
#include <tracker-store/tracker-events.h>
#include <tracker-store/tracker-writeback.h>


#define TRACKER_TYPE_RESOURCES (tracker_resources_get_type ())
#define TRACKER_RESOURCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_RESOURCES, TrackerResources))
#define TRACKER_RESOURCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_RESOURCES, TrackerResourcesClass))
#define TRACKER_IS_RESOURCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_RESOURCES))
#define TRACKER_IS_RESOURCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_RESOURCES))
#define TRACKER_RESOURCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_RESOURCES, TrackerResourcesClass))

typedef struct _TrackerResources TrackerResources;
typedef struct _TrackerResourcesClass TrackerResourcesClass;
typedef struct _TrackerResourcesPrivate TrackerResourcesPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TrackerResourcesLoadData TrackerResourcesLoadData;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))

#define TRACKER_STORE_TYPE_PRIORITY (tracker_store_priority_get_type ())
typedef struct _TrackerResourcesSparqlQueryData TrackerResourcesSparqlQueryData;
typedef struct _TrackerResourcesSparqlUpdateData TrackerResourcesSparqlUpdateData;
typedef struct _TrackerResourcesSparqlUpdateBlankData TrackerResourcesSparqlUpdateBlankData;
typedef struct _TrackerResourcesBatchSparqlUpdateData TrackerResourcesBatchSparqlUpdateData;
typedef struct _Block4Data Block4Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

struct _TrackerResources {
	GObject parent_instance;
	TrackerResourcesPrivate * priv;
};

struct _TrackerResourcesClass {
	GObjectClass parent_class;
};

struct _TrackerResourcesPrivate {
	GDBusConnection* connection;
	guint signal_timeout;
	gboolean regular_commit_pending;
};

struct _TrackerResourcesLoadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrackerResources* self;
	char* sender;
	gchar* uri;
	const char* _tmp0_;
	const gchar* _tmp1_;
	TrackerDBusRequest* _tmp2_;
	TrackerDBusRequest* request;
	const gchar* _tmp3_;
	GFile* _tmp4_;
	GFile* file;
	const char* _tmp5_;
	GError* ie;
	GError* _tmp6_;
	const gchar* _tmp7_;
	GError* _tmp8_;
	GError* e;
	GError* _tmp9_;
	GError* _tmp10_;
	GError* _tmp11_;
	GError* _tmp12_;
	GError* _tmp13_;
	const gchar* _tmp14_;
	GError* _tmp15_;
	GError * _inner_error_;
};

struct _Block3Data {
	int _ref_count_;
	TrackerResources * self;
	GVariantBuilder* builder;
};

typedef enum  {
	TRACKER_STORE_PRIORITY_HIGH,
	TRACKER_STORE_PRIORITY_LOW,
	TRACKER_STORE_PRIORITY_TURTLE,
	TRACKER_STORE_PRIORITY_N_PRIORITIES
} TrackerStorePriority;

typedef void (*TrackerStoreSparqlQueryInThread) (TrackerDBCursor* cursor, void* user_data, GError** error);
struct _TrackerResourcesSparqlQueryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrackerResources* self;
	char* sender;
	gchar* query;
	GVariant* result;
	const char* _tmp0_;
	TrackerDBusRequest* _tmp1_;
	TrackerDBusRequest* request;
	TrackerDBusRequest* _tmp2_;
	const gchar* _tmp3_;
	Block3Data* _data3_;
	GVariantBuilder* _tmp4_;
	const gchar* _tmp5_;
	const char* _tmp6_;
	GVariantBuilder* _tmp7_;
	GVariant* _tmp8_;
	GVariant* _tmp9_;
	GVariant* _result_;
	GVariant* _tmp10_;
	gsize _tmp11_;
	GError* _tmp12_;
	TrackerDBusRequest* _tmp13_;
	GError* e;
	TrackerDBusRequest* _tmp14_;
	GError* _tmp15_;
	GError* _tmp16_;
	GError* _tmp17_;
	GError* _tmp18_;
	GError* _tmp19_;
	const gchar* _tmp20_;
	GError* _tmp21_;
	GError * _inner_error_;
};

struct _TrackerResourcesSparqlUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrackerResources* self;
	char* sender;
	gchar* update;
	const char* _tmp0_;
	TrackerDBusRequest* _tmp1_;
	TrackerDBusRequest* request;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const char* _tmp4_;
	GError* ie;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GError* _tmp7_;
	GError* e;
	GError* _tmp8_;
	GError* _tmp9_;
	GError* _tmp10_;
	GError* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError* _tmp14_;
	GError * _inner_error_;
};

struct _TrackerResourcesSparqlUpdateBlankData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrackerResources* self;
	char* sender;
	gchar* update;
	GVariant* result;
	const char* _tmp0_;
	TrackerDBusRequest* _tmp1_;
	TrackerDBusRequest* request;
	TrackerDBusRequest* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const char* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	GError* ie;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError* _tmp10_;
	GError* e;
	TrackerDBusRequest* _tmp11_;
	GError* _tmp12_;
	GError* _tmp13_;
	GError* _tmp14_;
	GError* _tmp15_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	GError* _tmp18_;
	GError * _inner_error_;
};

struct _TrackerResourcesBatchSparqlUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrackerResources* self;
	char* sender;
	gchar* update;
	const char* _tmp0_;
	TrackerDBusRequest* _tmp1_;
	TrackerDBusRequest* request;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const char* _tmp4_;
	GError* ie;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GError* _tmp7_;
	GError* e;
	GError* _tmp8_;
	GError* _tmp9_;
	GError* _tmp10_;
	GError* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError* _tmp14_;
	GError * _inner_error_;
};

struct _Block4Data {
	int _ref_count_;
	TrackerResources * self;
	GVariantBuilder* builder;
};


static gpointer tracker_resources_parent_class = NULL;

GType tracker_resources_get_type (void) G_GNUC_CONST;
guint tracker_resources_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
#define TRACKER_RESOURCES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_RESOURCES, TrackerResourcesPrivate))
enum  {
	TRACKER_RESOURCES_DUMMY_PROPERTY
};
void tracker_resources_disable_signals (TrackerResources* self);
#define TRACKER_RESOURCES_PATH "/org/freedesktop/Tracker1/Resources"
#define TRACKER_RESOURCES_GRAPH_UPDATED_IMMEDIATE_EMIT_AT 50000
#define TRACKER_RESOURCES_SIGNALS_SECONDS_PER_EMIT 1
#define TRACKER_RESOURCES_DBUS_ARBITRARY_MAX_MSG_SIZE 10000000
TrackerResources* tracker_resources_new (GDBusConnection* connection);
TrackerResources* tracker_resources_construct (GType object_type, GDBusConnection* connection);
static void tracker_resources_load_data_free (gpointer _data);
void tracker_resources_load (TrackerResources* self, const char* sender, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
void tracker_resources_load_finish (TrackerResources* self, GAsyncResult* _res_, GError** error);
static gboolean tracker_resources_load_co (TrackerResourcesLoadData* _data_);
void tracker_store_queue_turtle_import (GFile* file, const gchar* client_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
void tracker_store_queue_turtle_import_finish (GAsyncResult* _res_, GError** error);
static void tracker_resources_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void tracker_resources_sparql_query_data_free (gpointer _data);
void tracker_resources_sparql_query (TrackerResources* self, const char* sender, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
GVariant* tracker_resources_sparql_query_finish (TrackerResources* self, GAsyncResult* _res_, GError** error);
static gboolean tracker_resources_sparql_query_co (TrackerResourcesSparqlQueryData* _data_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (Block3Data* _data3_);
GType tracker_store_priority_get_type (void) G_GNUC_CONST;
void tracker_store_sparql_query (const gchar* sparql, TrackerStorePriority priority, TrackerStoreSparqlQueryInThread in_thread, void* in_thread_target, const gchar* client_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
void tracker_store_sparql_query_finish (GAsyncResult* _res_, GError** error);
static void ___lambda2_ (Block3Data* _data3_, TrackerDBCursor* cursor, GError** error);
static void ____lambda2__tracker_store_sparql_query_in_thread (TrackerDBCursor* cursor, gpointer self, GError** error);
static void tracker_resources_sparql_query_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void tracker_resources_sparql_update_data_free (gpointer _data);
void tracker_resources_sparql_update (TrackerResources* self, const char* sender, const gchar* update, GAsyncReadyCallback _callback_, gpointer _user_data_);
void tracker_resources_sparql_update_finish (TrackerResources* self, GAsyncResult* _res_, GError** error);
static gboolean tracker_resources_sparql_update_co (TrackerResourcesSparqlUpdateData* _data_);
void tracker_store_sparql_update (const gchar* sparql, TrackerStorePriority priority, const gchar* client_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
void tracker_store_sparql_update_finish (GAsyncResult* _res_, GError** error);
static void tracker_resources_sparql_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void tracker_resources_sparql_update_blank_data_free (gpointer _data);
void tracker_resources_sparql_update_blank (TrackerResources* self, const char* sender, const gchar* update, GAsyncReadyCallback _callback_, gpointer _user_data_);
GVariant* tracker_resources_sparql_update_blank_finish (TrackerResources* self, GAsyncResult* _res_, GError** error);
static gboolean tracker_resources_sparql_update_blank_co (TrackerResourcesSparqlUpdateBlankData* _data_);
void tracker_store_sparql_update_blank (const gchar* sparql, TrackerStorePriority priority, const gchar* client_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
GVariant* tracker_store_sparql_update_blank_finish (GAsyncResult* _res_, GError** error);
static void tracker_resources_sparql_update_blank_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void tracker_resources_sync (TrackerResources* self, const char* sender);
void tracker_store_wal_checkpoint (void);
static void tracker_resources_batch_sparql_update_data_free (gpointer _data);
void tracker_resources_batch_sparql_update (TrackerResources* self, const char* sender, const gchar* update, GAsyncReadyCallback _callback_, gpointer _user_data_);
void tracker_resources_batch_sparql_update_finish (TrackerResources* self, GAsyncResult* _res_, GError** error);
static gboolean tracker_resources_batch_sparql_update_co (TrackerResourcesBatchSparqlUpdateData* _data_);
static void tracker_resources_batch_sparql_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void tracker_resources_batch_commit (TrackerResources* self);
static gboolean tracker_resources_emit_graph_updated (TrackerResources* self, TrackerClass* cl);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (Block4Data* _data4_);
static void ___lambda3_ (Block4Data* _data4_, gint graph_id, gint subject_id, gint pred_id, gint object_id);
static void ____lambda3__tracker_events_foreach (gint graph_id, gint subject_id, gint pred_id, gint object_id, gpointer self);
static void ___lambda4_ (Block4Data* _data4_, gint graph_id, gint subject_id, gint pred_id, gint object_id);
static void ____lambda4__tracker_events_foreach (gint graph_id, gint subject_id, gint pred_id, gint object_id, gpointer self);
static gboolean tracker_resources_on_emit_signals (TrackerResources* self);
static void tracker_resources_on_statements_committed (TrackerResources* self, TrackerDataCommitType commit_type);
static gboolean _tracker_resources_on_emit_signals_gsource_func (gpointer self);
static void tracker_resources_on_statements_rolled_back (TrackerResources* self, TrackerDataCommitType commit_type);
static void tracker_resources_check_graph_updated_signal (TrackerResources* self);
static void tracker_resources_on_statement_inserted (TrackerResources* self, gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint pred_id, gint object_id, const gchar* object, GPtrArray* rdf_types);
static void tracker_resources_on_statement_deleted (TrackerResources* self, gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint pred_id, gint object_id, const gchar* object, GPtrArray* rdf_types);
void tracker_resources_enable_signals (TrackerResources* self);
static void _tracker_resources_on_statement_inserted_tracker_statement_callback (gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint predicate_id, gint object_id, const gchar* object, GPtrArray* rdf_types, gpointer self);
static void _tracker_resources_on_statement_deleted_tracker_statement_callback (gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint predicate_id, gint object_id, const gchar* object, GPtrArray* rdf_types, gpointer self);
static void _tracker_resources_on_statements_committed_tracker_commit_callback (TrackerDataCommitType commit_type, gpointer self);
static void _tracker_resources_on_statements_rolled_back_tracker_commit_callback (TrackerDataCommitType commit_type, gpointer self);
void tracker_resources_unreg_batches (TrackerResources* self, const gchar* old_owner);
void tracker_store_unreg_batches (const gchar* client_id);
static void g_cclosure_user_marshal_VOID__VARIANT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__STRING_VARIANT_VARIANT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void tracker_resources_finalize (GObject* obj);
static void _dbus_tracker_resources_load (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_tracker_resources_load_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void _dbus_tracker_resources_sparql_query (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_tracker_resources_sparql_query_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void _dbus_tracker_resources_sparql_update (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_tracker_resources_sparql_update_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void _dbus_tracker_resources_sparql_update_blank (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_tracker_resources_sparql_update_blank_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void _dbus_tracker_resources_sync (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_tracker_resources_batch_sparql_update (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_tracker_resources_batch_sparql_update_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void _dbus_tracker_resources_batch_commit (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void tracker_resources_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* tracker_resources_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static gboolean tracker_resources_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _dbus_tracker_resources_writeback (GObject* _sender, GVariant* subjects, gpointer* _data);
static void _dbus_tracker_resources_graph_updated (GObject* _sender, const gchar* classname, GVariant* deletes, GVariant* inserts, gpointer* _data);
static void _tracker_resources_unregister_object (gpointer user_data);

static const GDBusArgInfo _tracker_resources_dbus_arg_info_load_uri = {-1, "uri", "s"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_load_in[] = {&_tracker_resources_dbus_arg_info_load_uri, NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_load_out[] = {NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_load = {-1, "Load", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_load_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_load_out)};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_sparql_query_query = {-1, "query", "s"};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_sparql_query_result = {-1, "result", "aas"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sparql_query_in[] = {&_tracker_resources_dbus_arg_info_sparql_query_query, NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sparql_query_out[] = {&_tracker_resources_dbus_arg_info_sparql_query_result, NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_sparql_query = {-1, "SparqlQuery", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sparql_query_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sparql_query_out)};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_sparql_update_update = {-1, "update", "s"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sparql_update_in[] = {&_tracker_resources_dbus_arg_info_sparql_update_update, NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sparql_update_out[] = {NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_sparql_update = {-1, "SparqlUpdate", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sparql_update_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sparql_update_out)};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_sparql_update_blank_update = {-1, "update", "s"};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_sparql_update_blank_result = {-1, "result", "aaa{ss}"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sparql_update_blank_in[] = {&_tracker_resources_dbus_arg_info_sparql_update_blank_update, NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sparql_update_blank_out[] = {&_tracker_resources_dbus_arg_info_sparql_update_blank_result, NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_sparql_update_blank = {-1, "SparqlUpdateBlank", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sparql_update_blank_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sparql_update_blank_out)};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sync_in[] = {NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_sync_out[] = {NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_sync = {-1, "Sync", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sync_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_sync_out)};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_batch_sparql_update_update = {-1, "update", "s"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_batch_sparql_update_in[] = {&_tracker_resources_dbus_arg_info_batch_sparql_update_update, NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_batch_sparql_update_out[] = {NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_batch_sparql_update = {-1, "BatchSparqlUpdate", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_batch_sparql_update_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_batch_sparql_update_out)};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_batch_commit_in[] = {NULL};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_batch_commit_out[] = {NULL};
static const GDBusMethodInfo _tracker_resources_dbus_method_info_batch_commit = {-1, "BatchCommit", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_batch_commit_in), (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_batch_commit_out)};
static const GDBusMethodInfo * const _tracker_resources_dbus_method_info[] = {&_tracker_resources_dbus_method_info_load, &_tracker_resources_dbus_method_info_sparql_query, &_tracker_resources_dbus_method_info_sparql_update, &_tracker_resources_dbus_method_info_sparql_update_blank, &_tracker_resources_dbus_method_info_sync, &_tracker_resources_dbus_method_info_batch_sparql_update, &_tracker_resources_dbus_method_info_batch_commit, NULL};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_writeback_subjects = {-1, "subjects", "a{iai}"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_writeback[] = {&_tracker_resources_dbus_arg_info_writeback_subjects, NULL};
static const GDBusSignalInfo _tracker_resources_dbus_signal_info_writeback = {-1, "Writeback", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_writeback)};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_graph_updated_classname = {-1, "classname", "s"};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_graph_updated_deletes = {-1, "deletes", "a(iiii)"};
static const GDBusArgInfo _tracker_resources_dbus_arg_info_graph_updated_inserts = {-1, "inserts", "a(iiii)"};
static const GDBusArgInfo * const _tracker_resources_dbus_arg_info_graph_updated[] = {&_tracker_resources_dbus_arg_info_graph_updated_classname, &_tracker_resources_dbus_arg_info_graph_updated_deletes, &_tracker_resources_dbus_arg_info_graph_updated_inserts, NULL};
static const GDBusSignalInfo _tracker_resources_dbus_signal_info_graph_updated = {-1, "GraphUpdated", (GDBusArgInfo **) (&_tracker_resources_dbus_arg_info_graph_updated)};
static const GDBusSignalInfo * const _tracker_resources_dbus_signal_info[] = {&_tracker_resources_dbus_signal_info_writeback, &_tracker_resources_dbus_signal_info_graph_updated, NULL};
static const GDBusPropertyInfo * const _tracker_resources_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _tracker_resources_dbus_interface_info = {-1, "org.freedesktop.Tracker1.Resources", (GDBusMethodInfo **) (&_tracker_resources_dbus_method_info), (GDBusSignalInfo **) (&_tracker_resources_dbus_signal_info), (GDBusPropertyInfo **) (&_tracker_resources_dbus_property_info)};
static const GDBusInterfaceVTable _tracker_resources_dbus_interface_vtable = {tracker_resources_dbus_interface_method_call, tracker_resources_dbus_interface_get_property, tracker_resources_dbus_interface_set_property};

static gpointer _g_object_ref0 (gpointer self) {
#line 61 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return self ? g_object_ref (self) : NULL;
#line 408 "tracker-resources.c"
}


TrackerResources* tracker_resources_construct (GType object_type, GDBusConnection* connection) {
	TrackerResources * self = NULL;
	GDBusConnection* _tmp0_;
	GDBusConnection* _tmp1_;
#line 60 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_val_if_fail (connection != NULL, NULL);
#line 60 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self = (TrackerResources*) g_object_new (object_type, NULL);
#line 61 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = connection;
#line 61 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 61 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (self->priv->connection);
#line 61 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self->priv->connection = _tmp1_;
#line 60 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return self;
#line 430 "tracker-resources.c"
}


TrackerResources* tracker_resources_new (GDBusConnection* connection) {
#line 60 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return tracker_resources_construct (TRACKER_TYPE_RESOURCES, connection);
#line 437 "tracker-resources.c"
}


static void tracker_resources_load_data_free (gpointer _data) {
	TrackerResourcesLoadData* _data_;
	_data_ = _data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->sender);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->uri);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (_data_->self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_slice_free (TrackerResourcesLoadData, _data_);
#line 452 "tracker-resources.c"
}


void tracker_resources_load (TrackerResources* self, const char* sender, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrackerResourcesLoadData* _data_;
	TrackerResources* _tmp0_;
	const char* _tmp1_;
	const char* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_slice_new0 (TrackerResourcesLoadData);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_resources_load);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_resources_load_data_free);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->self = _tmp0_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = sender;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->sender = _tmp2_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = uri;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->uri = _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_load_co (_data_);
#line 487 "tracker-resources.c"
}


void tracker_resources_load_finish (TrackerResources* self, GAsyncResult* _res_, GError** error) {
	TrackerResourcesLoadData* _data_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return;
#line 497 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 501 "tracker-resources.c"
}


static void tracker_resources_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrackerResourcesLoadData* _data_;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = _user_data_;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_source_object_ = source_object;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_res_ = _res_;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_load_co (_data_);
#line 515 "tracker-resources.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 77 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return self ? g_error_copy (self) : NULL;
#line 522 "tracker-resources.c"
}


static gboolean tracker_resources_load_co (TrackerResourcesLoadData* _data_) {
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	switch (_data_->_state_) {
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 0:
#line 531 "tracker-resources.c"
		goto _state_0;
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 1:
#line 535 "tracker-resources.c"
		goto _state_1;
		default:
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_assert_not_reached ();
#line 540 "tracker-resources.c"
	}
	_state_0:
#line 65 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp0_ = _data_->sender;
#line 65 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = _data_->uri;
#line 65 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp2_ = NULL;
#line 65 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp2_ = tracker_dbus_request_begin ((const gchar*) _data_->_tmp0_, "Resources.Load (uri: '%s')", _data_->_tmp1_, NULL);
#line 65 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->request = _data_->_tmp2_;
#line 553 "tracker-resources.c"
	{
#line 67 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp3_ = _data_->uri;
#line 67 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp4_ = NULL;
#line 67 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp4_ = g_file_new_for_uri (_data_->_tmp3_);
#line 67 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->file = _data_->_tmp4_;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp5_ = _data_->sender;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_state_ = 1;
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_queue_turtle_import (_data_->file, (const gchar*) _data_->_tmp5_, tracker_resources_load_ready, _data_);
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 571 "tracker-resources.c"
		_state_1:
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_queue_turtle_import_finish (_data_->_res_, &_data_->_inner_error_);
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_inner_error_ != NULL) {
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_object_unref0 (_data_->file);
#line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			if (g_error_matches (_data_->_inner_error_, TRACKER_DB_INTERFACE_ERROR, TRACKER_DB_NO_SPACE)) {
#line 581 "tracker-resources.c"
				goto __catch8_tracker_db_no_space;
			}
			goto __catch8_g_error;
		}
#line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->request, NULL);
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_object_unref0 (_data_->file);
#line 590 "tracker-resources.c"
	}
	goto __finally8;
	__catch8_tracker_db_no_space:
	{
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->ie = _data_->_inner_error_;
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 73 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp6_ = _data_->ie;
#line 73 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp7_ = _data_->_tmp6_->message;
#line 73 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp8_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_NO_SPACE, _data_->_tmp7_);
#line 73 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = _data_->_tmp8_;
#line 73 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->ie);
#line 609 "tracker-resources.c"
		goto __finally8;
	}
	goto __finally8;
	__catch8_g_error:
	{
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->e = _data_->_inner_error_;
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp9_ = _data_->e;
#line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->request, _data_->_tmp9_);
#line 76 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp10_ = _data_->e;
#line 76 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_tmp10_->domain == TRACKER_SPARQL_ERROR) {
#line 77 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp11_ = _data_->e;
#line 77 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp12_ = _g_error_copy0 (_data_->_tmp11_);
#line 77 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp12_;
#line 77 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 635 "tracker-resources.c"
			goto __finally8;
		} else {
#line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp13_ = _data_->e;
#line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp14_ = _data_->_tmp13_->message;
#line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp15_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_INTERNAL, _data_->_tmp14_);
#line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp15_;
#line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 648 "tracker-resources.c"
			goto __finally8;
		}
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->e);
#line 653 "tracker-resources.c"
	}
	__finally8:
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_inner_error_ != NULL) {
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_error_free (_data_->_inner_error_);
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_state_ == 0) {
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 666 "tracker-resources.c"
		} else {
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 670 "tracker-resources.c"
		}
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_object_unref (_data_->_async_result);
#line 66 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 676 "tracker-resources.c"
	}
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 682 "tracker-resources.c"
	} else {
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 686 "tracker-resources.c"
	}
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 64 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 692 "tracker-resources.c"
}


static void tracker_resources_sparql_query_data_free (gpointer _data) {
	TrackerResourcesSparqlQueryData* _data_;
	_data_ = _data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->sender);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->query);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_variant_unref0 (_data_->result);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (_data_->self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_slice_free (TrackerResourcesSparqlQueryData, _data_);
#line 709 "tracker-resources.c"
}


void tracker_resources_sparql_query (TrackerResources* self, const char* sender, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrackerResourcesSparqlQueryData* _data_;
	TrackerResources* _tmp0_;
	const char* _tmp1_;
	const char* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_slice_new0 (TrackerResourcesSparqlQueryData);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_resources_sparql_query);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_resources_sparql_query_data_free);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->self = _tmp0_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = sender;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->sender = _tmp2_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = query;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->query = _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_sparql_query_co (_data_);
#line 744 "tracker-resources.c"
}


GVariant* tracker_resources_sparql_query_finish (TrackerResources* self, GAsyncResult* _res_, GError** error) {
	GVariant* result;
	TrackerResourcesSparqlQueryData* _data_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return NULL;
#line 755 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	result = _data_->result;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->result = NULL;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return result;
#line 765 "tracker-resources.c"
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_atomic_int_inc (&_data3_->_ref_count_);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return _data3_;
#line 774 "tracker-resources.c"
}


static void block3_data_unref (Block3Data* _data3_) {
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_object_unref0 (_data3_->self);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_builder_unref0 (_data3_->builder);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_slice_free (Block3Data, _data3_);
#line 787 "tracker-resources.c"
	}
}


static void ___lambda2_ (Block3Data* _data3_, TrackerDBCursor* cursor, GError** error) {
	TrackerResources * self;
	GError * _inner_error_ = NULL;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self = _data3_->self;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (cursor != NULL);
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	while (TRUE) {
#line 801 "tracker-resources.c"
		TrackerDBCursor* _tmp0_;
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_;
		GVariantBuilder* _tmp3_;
		GVariantBuilder* _tmp17_;
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp0_ = cursor;
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp1_ = tracker_sparql_cursor_next ((TrackerSparqlCursor*) _tmp0_, NULL, &_inner_error_);
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp2_ = _tmp1_;
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_inner_error_ != NULL) {
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_propagate_error (error, _inner_error_);
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			return;
#line 819 "tracker-resources.c"
		}
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (!_tmp2_) {
#line 92 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			break;
#line 825 "tracker-resources.c"
		}
#line 93 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp3_ = _data3_->builder;
#line 93 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_variant_builder_open (_tmp3_, (const GVariantType*) "as");
#line 831 "tracker-resources.c"
		{
			gint i;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			i = 0;
#line 836 "tracker-resources.c"
			{
				gboolean _tmp4_;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				_tmp4_ = TRUE;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				while (TRUE) {
#line 843 "tracker-resources.c"
					gboolean _tmp5_;
					gint _tmp7_;
					TrackerDBCursor* _tmp8_;
					gint _tmp9_;
					gint _tmp10_;
					TrackerDBCursor* _tmp11_;
					gint _tmp12_;
					const gchar* _tmp13_ = NULL;
					const gchar* str;
					const gchar* _tmp14_;
					GVariantBuilder* _tmp15_;
					const gchar* _tmp16_;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp5_ = _tmp4_;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					if (!_tmp5_) {
#line 860 "tracker-resources.c"
						gint _tmp6_;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp6_ = i;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						i = _tmp6_ + 1;
#line 866 "tracker-resources.c"
					}
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp4_ = FALSE;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp7_ = i;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp8_ = cursor;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp9_ = tracker_sparql_cursor_get_n_columns ((TrackerSparqlCursor*) _tmp8_);
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp10_ = _tmp9_;
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					if (!(_tmp7_ < _tmp10_)) {
#line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						break;
#line 882 "tracker-resources.c"
					}
#line 96 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp11_ = cursor;
#line 96 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp12_ = i;
#line 96 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp13_ = tracker_sparql_cursor_get_string ((TrackerSparqlCursor*) _tmp11_, _tmp12_, NULL);
#line 96 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					str = _tmp13_;
#line 98 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp14_ = str;
#line 98 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					if (_tmp14_ == NULL) {
#line 99 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						str = "";
#line 898 "tracker-resources.c"
					}
#line 102 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp15_ = _data3_->builder;
#line 102 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp16_ = str;
#line 102 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					g_variant_builder_add (_tmp15_, "s", _tmp16_, NULL);
#line 906 "tracker-resources.c"
				}
			}
		}
#line 105 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp17_ = _data3_->builder;
#line 105 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_variant_builder_close (_tmp17_);
#line 914 "tracker-resources.c"
	}
}


static void ____lambda2__tracker_store_sparql_query_in_thread (TrackerDBCursor* cursor, gpointer self, GError** error) {
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	___lambda2_ (self, cursor, error);
#line 922 "tracker-resources.c"
}


static void tracker_resources_sparql_query_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrackerResourcesSparqlQueryData* _data_;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = _user_data_;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_source_object_ = source_object;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_res_ = _res_;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_sparql_query_co (_data_);
#line 936 "tracker-resources.c"
}


static gboolean tracker_resources_sparql_query_co (TrackerResourcesSparqlQueryData* _data_) {
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	switch (_data_->_state_) {
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 0:
#line 945 "tracker-resources.c"
		goto _state_0;
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 1:
#line 949 "tracker-resources.c"
		goto _state_1;
		default:
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_assert_not_reached ();
#line 954 "tracker-resources.c"
	}
	_state_0:
#line 86 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp0_ = _data_->sender;
#line 86 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = NULL;
#line 86 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = tracker_dbus_request_begin ((const gchar*) _data_->_tmp0_, "Resources.SparqlQuery", NULL);
#line 86 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->request = _data_->_tmp1_;
#line 87 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp2_ = _data_->request;
#line 87 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp3_ = _data_->query;
#line 87 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_dbus_request_debug (_data_->_tmp2_, "query: %s", _data_->_tmp3_, NULL);
#line 971 "tracker-resources.c"
	{
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_data3_ = g_slice_new0 (Block3Data);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_data3_->_ref_count_ = 1;
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_data3_->self = g_object_ref (_data_->self);
#line 89 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp4_ = g_variant_builder_new ((const GVariantType*) "aas");
#line 89 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_data3_->builder = _data_->_tmp4_;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp5_ = _data_->query;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp6_ = _data_->sender;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_state_ = 1;
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_query (_data_->_tmp5_, TRACKER_STORE_PRIORITY_HIGH, ____lambda2__tracker_store_sparql_query_in_thread, _data_->_data3_, (const gchar*) _data_->_tmp6_, tracker_resources_sparql_query_ready, _data_);
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 993 "tracker-resources.c"
		_state_1:
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_query_finish (_data_->_res_, &_data_->_inner_error_);
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_inner_error_ != NULL) {
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			block3_data_unref (_data_->_data3_);
#line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_data3_ = NULL;
#line 1003 "tracker-resources.c"
			goto __catch9_g_error;
		}
#line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp7_ = _data_->_data3_->builder;
#line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp8_ = NULL;
#line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp8_ = g_variant_builder_end (_data_->_tmp7_);
#line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp9_ = g_variant_ref_sink (_data_->_tmp8_);
#line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_result_ = _data_->_tmp9_;
#line 110 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp10_ = _data_->_result_;
#line 110 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp11_ = 0UL;
#line 110 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp11_ = g_variant_get_size (_data_->_tmp10_);
#line 110 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_tmp11_ > ((gsize) TRACKER_RESOURCES_DBUS_ARBITRARY_MAX_MSG_SIZE)) {
#line 111 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp12_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "result set of the query is too large");
#line 111 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp12_;
#line 111 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_variant_unref0 (_data_->_result_);
#line 111 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			block3_data_unref (_data_->_data3_);
#line 111 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_data3_ = NULL;
#line 1034 "tracker-resources.c"
			goto __catch9_g_error;
		}
#line 114 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp13_ = _data_->request;
#line 114 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->_tmp13_, NULL);
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->result = _data_->_result_;
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		block3_data_unref (_data_->_data3_);
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_data3_ = NULL;
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_state_ == 0) {
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1051 "tracker-resources.c"
		} else {
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1055 "tracker-resources.c"
		}
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_object_unref (_data_->_async_result);
#line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1061 "tracker-resources.c"
	}
	goto __finally9;
	__catch9_g_error:
	{
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->e = _data_->_inner_error_;
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 118 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp14_ = _data_->request;
#line 118 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp15_ = _data_->e;
#line 118 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->_tmp14_, _data_->_tmp15_);
#line 119 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp16_ = _data_->e;
#line 119 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_tmp16_->domain == TRACKER_SPARQL_ERROR) {
#line 120 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp17_ = _data_->e;
#line 120 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp18_ = _g_error_copy0 (_data_->_tmp17_);
#line 120 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp18_;
#line 120 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1088 "tracker-resources.c"
			goto __finally9;
		} else {
#line 122 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp19_ = _data_->e;
#line 122 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp20_ = _data_->_tmp19_->message;
#line 122 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp21_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_INTERNAL, _data_->_tmp20_);
#line 122 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp21_;
#line 122 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1101 "tracker-resources.c"
			goto __finally9;
		}
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->e);
#line 1106 "tracker-resources.c"
	}
	__finally9:
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_error_free (_data_->_inner_error_);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1117 "tracker-resources.c"
	} else {
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1121 "tracker-resources.c"
	}
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1131 "tracker-resources.c"
	} else {
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1135 "tracker-resources.c"
	}
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 85 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 1141 "tracker-resources.c"
}


static void tracker_resources_sparql_update_data_free (gpointer _data) {
	TrackerResourcesSparqlUpdateData* _data_;
	_data_ = _data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->sender);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->update);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (_data_->self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_slice_free (TrackerResourcesSparqlUpdateData, _data_);
#line 1156 "tracker-resources.c"
}


void tracker_resources_sparql_update (TrackerResources* self, const char* sender, const gchar* update, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrackerResourcesSparqlUpdateData* _data_;
	TrackerResources* _tmp0_;
	const char* _tmp1_;
	const char* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_slice_new0 (TrackerResourcesSparqlUpdateData);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_resources_sparql_update);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_resources_sparql_update_data_free);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->self = _tmp0_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = sender;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->sender = _tmp2_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = update;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->update = _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_sparql_update_co (_data_);
#line 1191 "tracker-resources.c"
}


void tracker_resources_sparql_update_finish (TrackerResources* self, GAsyncResult* _res_, GError** error) {
	TrackerResourcesSparqlUpdateData* _data_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return;
#line 1201 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 1205 "tracker-resources.c"
}


static void tracker_resources_sparql_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrackerResourcesSparqlUpdateData* _data_;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = _user_data_;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_source_object_ = source_object;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_res_ = _res_;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_sparql_update_co (_data_);
#line 1219 "tracker-resources.c"
}


static gboolean tracker_resources_sparql_update_co (TrackerResourcesSparqlUpdateData* _data_) {
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	switch (_data_->_state_) {
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 0:
#line 1228 "tracker-resources.c"
		goto _state_0;
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 1:
#line 1232 "tracker-resources.c"
		goto _state_1;
		default:
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_assert_not_reached ();
#line 1237 "tracker-resources.c"
	}
	_state_0:
#line 128 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp0_ = _data_->sender;
#line 128 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = NULL;
#line 128 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = tracker_dbus_request_begin ((const gchar*) _data_->_tmp0_, "Resources.SparqlUpdate", NULL);
#line 128 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->request = _data_->_tmp1_;
#line 129 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp2_ = _data_->update;
#line 129 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_dbus_request_debug (_data_->request, "query: %s", _data_->_tmp2_, NULL);
#line 1252 "tracker-resources.c"
	{
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp3_ = _data_->update;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp4_ = _data_->sender;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_state_ = 1;
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_update (_data_->_tmp3_, TRACKER_STORE_PRIORITY_HIGH, (const gchar*) _data_->_tmp4_, tracker_resources_sparql_update_ready, _data_);
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1264 "tracker-resources.c"
		_state_1:
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_update_finish (_data_->_res_, &_data_->_inner_error_);
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_inner_error_ != NULL) {
#line 131 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			if (g_error_matches (_data_->_inner_error_, TRACKER_DB_INTERFACE_ERROR, TRACKER_DB_NO_SPACE)) {
#line 1272 "tracker-resources.c"
				goto __catch10_tracker_db_no_space;
			}
			goto __catch10_g_error;
		}
#line 133 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->request, NULL);
#line 1279 "tracker-resources.c"
	}
	goto __finally10;
	__catch10_tracker_db_no_space:
	{
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->ie = _data_->_inner_error_;
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 135 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp5_ = _data_->ie;
#line 135 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp6_ = _data_->_tmp5_->message;
#line 135 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp7_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_NO_SPACE, _data_->_tmp6_);
#line 135 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = _data_->_tmp7_;
#line 135 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->ie);
#line 1298 "tracker-resources.c"
		goto __finally10;
	}
	goto __finally10;
	__catch10_g_error:
	{
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->e = _data_->_inner_error_;
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 137 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp8_ = _data_->e;
#line 137 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->request, _data_->_tmp8_);
#line 138 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp9_ = _data_->e;
#line 138 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_tmp9_->domain == TRACKER_SPARQL_ERROR) {
#line 139 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp10_ = _data_->e;
#line 139 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp11_ = _g_error_copy0 (_data_->_tmp10_);
#line 139 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp11_;
#line 139 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1324 "tracker-resources.c"
			goto __finally10;
		} else {
#line 141 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp12_ = _data_->e;
#line 141 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp13_ = _data_->_tmp12_->message;
#line 141 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp14_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_INTERNAL, _data_->_tmp13_);
#line 141 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp14_;
#line 141 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1337 "tracker-resources.c"
			goto __finally10;
		}
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->e);
#line 1342 "tracker-resources.c"
	}
	__finally10:
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_inner_error_ != NULL) {
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_error_free (_data_->_inner_error_);
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_state_ == 0) {
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1355 "tracker-resources.c"
		} else {
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1359 "tracker-resources.c"
		}
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_object_unref (_data_->_async_result);
#line 130 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1365 "tracker-resources.c"
	}
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1371 "tracker-resources.c"
	} else {
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1375 "tracker-resources.c"
	}
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 127 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 1381 "tracker-resources.c"
}


static void tracker_resources_sparql_update_blank_data_free (gpointer _data) {
	TrackerResourcesSparqlUpdateBlankData* _data_;
	_data_ = _data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->sender);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->update);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_variant_unref0 (_data_->result);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (_data_->self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_slice_free (TrackerResourcesSparqlUpdateBlankData, _data_);
#line 1398 "tracker-resources.c"
}


void tracker_resources_sparql_update_blank (TrackerResources* self, const char* sender, const gchar* update, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrackerResourcesSparqlUpdateBlankData* _data_;
	TrackerResources* _tmp0_;
	const char* _tmp1_;
	const char* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_slice_new0 (TrackerResourcesSparqlUpdateBlankData);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_resources_sparql_update_blank);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_resources_sparql_update_blank_data_free);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->self = _tmp0_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = sender;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->sender = _tmp2_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = update;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->update = _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_sparql_update_blank_co (_data_);
#line 1433 "tracker-resources.c"
}


GVariant* tracker_resources_sparql_update_blank_finish (TrackerResources* self, GAsyncResult* _res_, GError** error) {
	GVariant* result;
	TrackerResourcesSparqlUpdateBlankData* _data_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return NULL;
#line 1444 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	result = _data_->result;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->result = NULL;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return result;
#line 1454 "tracker-resources.c"
}


static void tracker_resources_sparql_update_blank_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrackerResourcesSparqlUpdateBlankData* _data_;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = _user_data_;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_source_object_ = source_object;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_res_ = _res_;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_sparql_update_blank_co (_data_);
#line 1468 "tracker-resources.c"
}


static gboolean tracker_resources_sparql_update_blank_co (TrackerResourcesSparqlUpdateBlankData* _data_) {
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	switch (_data_->_state_) {
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 0:
#line 1477 "tracker-resources.c"
		goto _state_0;
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 1:
#line 1481 "tracker-resources.c"
		goto _state_1;
		default:
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_assert_not_reached ();
#line 1486 "tracker-resources.c"
	}
	_state_0:
#line 148 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp0_ = _data_->sender;
#line 148 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = NULL;
#line 148 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = tracker_dbus_request_begin ((const gchar*) _data_->_tmp0_, "Resources.SparqlUpdateBlank", NULL);
#line 148 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->request = _data_->_tmp1_;
#line 149 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp2_ = _data_->request;
#line 149 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp3_ = _data_->update;
#line 149 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_dbus_request_debug (_data_->_tmp2_, "query: %s", _data_->_tmp3_, NULL);
#line 1503 "tracker-resources.c"
	{
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp4_ = _data_->update;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp5_ = _data_->sender;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_state_ = 1;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_update_blank (_data_->_tmp4_, TRACKER_STORE_PRIORITY_HIGH, (const gchar*) _data_->_tmp5_, tracker_resources_sparql_update_blank_ready, _data_);
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1515 "tracker-resources.c"
		_state_1:
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp6_ = NULL;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp6_ = tracker_store_sparql_update_blank_finish (_data_->_res_, &_data_->_inner_error_);
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp7_ = _data_->_tmp6_;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_inner_error_ != NULL) {
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			if (g_error_matches (_data_->_inner_error_, TRACKER_DB_INTERFACE_ERROR, TRACKER_DB_NO_SPACE)) {
#line 1527 "tracker-resources.c"
				goto __catch11_tracker_db_no_space;
			}
			goto __catch11_g_error;
		}
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->result = _data_->_tmp7_;
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_state_ == 0) {
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1538 "tracker-resources.c"
		} else {
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1542 "tracker-resources.c"
		}
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_object_unref (_data_->_async_result);
#line 151 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1548 "tracker-resources.c"
	}
	goto __finally11;
	__catch11_tracker_db_no_space:
	{
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->ie = _data_->_inner_error_;
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 153 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp8_ = _data_->ie;
#line 153 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp9_ = _data_->_tmp8_->message;
#line 153 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp10_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_NO_SPACE, _data_->_tmp9_);
#line 153 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = _data_->_tmp10_;
#line 153 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->ie);
#line 1567 "tracker-resources.c"
		goto __finally11;
	}
	goto __finally11;
	__catch11_g_error:
	{
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->e = _data_->_inner_error_;
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 155 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp11_ = _data_->request;
#line 155 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp12_ = _data_->e;
#line 155 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->_tmp11_, _data_->_tmp12_);
#line 156 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp13_ = _data_->e;
#line 156 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_tmp13_->domain == TRACKER_SPARQL_ERROR) {
#line 157 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp14_ = _data_->e;
#line 157 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp15_ = _g_error_copy0 (_data_->_tmp14_);
#line 157 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp15_;
#line 157 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1595 "tracker-resources.c"
			goto __finally11;
		} else {
#line 159 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp16_ = _data_->e;
#line 159 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp17_ = _data_->_tmp16_->message;
#line 159 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp18_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_INTERNAL, _data_->_tmp17_);
#line 159 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp18_;
#line 159 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1608 "tracker-resources.c"
			goto __finally11;
		}
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->e);
#line 1613 "tracker-resources.c"
	}
	__finally11:
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_error_free (_data_->_inner_error_);
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1624 "tracker-resources.c"
	} else {
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1628 "tracker-resources.c"
	}
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 150 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1638 "tracker-resources.c"
	} else {
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1642 "tracker-resources.c"
	}
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 147 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 1648 "tracker-resources.c"
}


void tracker_resources_sync (TrackerResources* self, const char* sender) {
	const char* _tmp0_;
	TrackerDBusRequest* _tmp1_ = NULL;
	TrackerDBusRequest* request;
#line 164 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 164 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (sender != NULL);
#line 165 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = sender;
#line 165 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = tracker_dbus_request_begin ((const gchar*) _tmp0_, "Resources.Sync", NULL);
#line 165 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	request = _tmp1_;
#line 168 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_store_wal_checkpoint ();
#line 170 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_sync ();
#line 172 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_dbus_request_end (request, NULL);
#line 1672 "tracker-resources.c"
}


static void tracker_resources_batch_sparql_update_data_free (gpointer _data) {
	TrackerResourcesBatchSparqlUpdateData* _data_;
	_data_ = _data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->sender);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_free0 (_data_->update);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (_data_->self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_slice_free (TrackerResourcesBatchSparqlUpdateData, _data_);
#line 1687 "tracker-resources.c"
}


void tracker_resources_batch_sparql_update (TrackerResources* self, const char* sender, const gchar* update, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrackerResourcesBatchSparqlUpdateData* _data_;
	TrackerResources* _tmp0_;
	const char* _tmp1_;
	const char* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_slice_new0 (TrackerResourcesBatchSparqlUpdateData);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_resources_batch_sparql_update);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_resources_batch_sparql_update_data_free);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->self = _tmp0_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = sender;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->sender = _tmp2_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = update;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->update = _tmp4_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_batch_sparql_update_co (_data_);
#line 1722 "tracker-resources.c"
}


void tracker_resources_batch_sparql_update_finish (TrackerResources* self, GAsyncResult* _res_, GError** error) {
	TrackerResourcesBatchSparqlUpdateData* _data_;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return;
#line 1732 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 1736 "tracker-resources.c"
}


static void tracker_resources_batch_sparql_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrackerResourcesBatchSparqlUpdateData* _data_;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_ = _user_data_;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_source_object_ = source_object;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_res_ = _res_;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_batch_sparql_update_co (_data_);
#line 1750 "tracker-resources.c"
}


static gboolean tracker_resources_batch_sparql_update_co (TrackerResourcesBatchSparqlUpdateData* _data_) {
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	switch (_data_->_state_) {
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 0:
#line 1759 "tracker-resources.c"
		goto _state_0;
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		case 1:
#line 1763 "tracker-resources.c"
		goto _state_1;
		default:
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_assert_not_reached ();
#line 1768 "tracker-resources.c"
	}
	_state_0:
#line 176 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp0_ = _data_->sender;
#line 176 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = NULL;
#line 176 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp1_ = tracker_dbus_request_begin ((const gchar*) _data_->_tmp0_, "Resources.BatchSparqlUpdate", NULL);
#line 176 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->request = _data_->_tmp1_;
#line 177 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_data_->_tmp2_ = _data_->update;
#line 177 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_dbus_request_debug (_data_->request, "query: %s", _data_->_tmp2_, NULL);
#line 1783 "tracker-resources.c"
	{
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp3_ = _data_->update;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp4_ = _data_->sender;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_state_ = 1;
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_update (_data_->_tmp3_, TRACKER_STORE_PRIORITY_LOW, (const gchar*) _data_->_tmp4_, tracker_resources_batch_sparql_update_ready, _data_);
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1795 "tracker-resources.c"
		_state_1:
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_store_sparql_update_finish (_data_->_res_, &_data_->_inner_error_);
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_inner_error_ != NULL) {
#line 179 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			if (g_error_matches (_data_->_inner_error_, TRACKER_DB_INTERFACE_ERROR, TRACKER_DB_NO_SPACE)) {
#line 1803 "tracker-resources.c"
				goto __catch12_tracker_db_no_space;
			}
			goto __catch12_g_error;
		}
#line 181 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->request, NULL);
#line 1810 "tracker-resources.c"
	}
	goto __finally12;
	__catch12_tracker_db_no_space:
	{
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->ie = _data_->_inner_error_;
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 183 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp5_ = _data_->ie;
#line 183 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp6_ = _data_->_tmp5_->message;
#line 183 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp7_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_NO_SPACE, _data_->_tmp6_);
#line 183 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = _data_->_tmp7_;
#line 183 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->ie);
#line 1829 "tracker-resources.c"
		goto __finally12;
	}
	goto __finally12;
	__catch12_g_error:
	{
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->e = _data_->_inner_error_;
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_inner_error_ = NULL;
#line 185 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp8_ = _data_->e;
#line 185 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_dbus_request_end (_data_->request, _data_->_tmp8_);
#line 186 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data_->_tmp9_ = _data_->e;
#line 186 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_tmp9_->domain == TRACKER_SPARQL_ERROR) {
#line 187 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp10_ = _data_->e;
#line 187 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp11_ = _g_error_copy0 (_data_->_tmp10_);
#line 187 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp11_;
#line 187 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1855 "tracker-resources.c"
			goto __finally12;
		} else {
#line 189 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp12_ = _data_->e;
#line 189 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp13_ = _data_->_tmp12_->message;
#line 189 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_tmp14_ = g_error_new_literal (TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_INTERNAL, _data_->_tmp13_);
#line 189 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_data_->_inner_error_ = _data_->_tmp14_;
#line 189 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_g_error_free0 (_data_->e);
#line 1868 "tracker-resources.c"
			goto __finally12;
		}
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_error_free0 (_data_->e);
#line 1873 "tracker-resources.c"
	}
	__finally12:
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_inner_error_ != NULL) {
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_error_free (_data_->_inner_error_);
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_data_->_state_ == 0) {
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1886 "tracker-resources.c"
		} else {
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1890 "tracker-resources.c"
		}
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_object_unref (_data_->_async_result);
#line 178 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return FALSE;
#line 1896 "tracker-resources.c"
	}
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_data_->_state_ == 0) {
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1902 "tracker-resources.c"
	} else {
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1906 "tracker-resources.c"
	}
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_object_unref (_data_->_async_result);
#line 175 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return FALSE;
#line 1912 "tracker-resources.c"
}


void tracker_resources_batch_commit (TrackerResources* self) {
#line 194 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 1919 "tracker-resources.c"
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_atomic_int_inc (&_data4_->_ref_count_);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return _data4_;
#line 1928 "tracker-resources.c"
}


static void block4_data_unref (Block4Data* _data4_) {
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_object_unref0 (_data4_->self);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_builder_unref0 (_data4_->builder);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_slice_free (Block4Data, _data4_);
#line 1941 "tracker-resources.c"
	}
}


static void ___lambda3_ (Block4Data* _data4_, gint graph_id, gint subject_id, gint pred_id, gint object_id) {
	TrackerResources * self;
	GVariantBuilder* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
#line 201 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self = _data4_->self;
#line 202 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _data4_->builder;
#line 202 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = graph_id;
#line 202 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = subject_id;
#line 202 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = pred_id;
#line 202 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = object_id;
#line 202 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_variant_builder_add (_tmp0_, "(iiii)", _tmp1_, _tmp2_, _tmp3_, _tmp4_, NULL);
#line 1967 "tracker-resources.c"
}


static void ____lambda3__tracker_events_foreach (gint graph_id, gint subject_id, gint pred_id, gint object_id, gpointer self) {
#line 201 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	___lambda3_ (self, graph_id, subject_id, pred_id, object_id);
#line 1974 "tracker-resources.c"
}


static void ___lambda4_ (Block4Data* _data4_, gint graph_id, gint subject_id, gint pred_id, gint object_id) {
	TrackerResources * self;
	GVariantBuilder* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
#line 207 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self = _data4_->self;
#line 208 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = _data4_->builder;
#line 208 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = graph_id;
#line 208 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = subject_id;
#line 208 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = pred_id;
#line 208 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = object_id;
#line 208 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_variant_builder_add (_tmp0_, "(iiii)", _tmp1_, _tmp2_, _tmp3_, _tmp4_, NULL);
#line 1999 "tracker-resources.c"
}


static void ____lambda4__tracker_events_foreach (gint graph_id, gint subject_id, gint pred_id, gint object_id, gpointer self) {
#line 207 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	___lambda4_ (self, graph_id, subject_id, pred_id, object_id);
#line 2006 "tracker-resources.c"
}


static gboolean tracker_resources_emit_graph_updated (TrackerResources* self, TrackerClass* cl) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	TrackerClass* _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp5_;
#line 198 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 198 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_val_if_fail (cl != NULL, FALSE);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = cl;
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = tracker_class_has_insert_events (_tmp1_);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp2_) {
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp0_ = TRUE;
#line 2028 "tracker-resources.c"
	} else {
		TrackerClass* _tmp3_;
		gboolean _tmp4_ = FALSE;
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp3_ = cl;
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp4_ = tracker_class_has_delete_events (_tmp3_);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp0_ = _tmp4_;
#line 2038 "tracker-resources.c"
	}
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp5_ = _tmp0_;
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp5_) {
#line 2044 "tracker-resources.c"
		Block4Data* _data4_;
		GVariantBuilder* _tmp6_;
		TrackerClass* _tmp7_;
		GVariantBuilder* _tmp8_;
		GVariant* _tmp9_ = NULL;
		GVariant* _tmp10_;
		GVariant* deletes;
		GVariantBuilder* _tmp11_;
		TrackerClass* _tmp12_;
		GVariantBuilder* _tmp13_;
		GVariant* _tmp14_ = NULL;
		GVariant* _tmp15_;
		GVariant* inserts;
		TrackerClass* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		GVariant* _tmp19_;
		GVariant* _tmp20_;
		TrackerClass* _tmp21_;
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data4_ = g_slice_new0 (Block4Data);
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data4_->_ref_count_ = 1;
#line 199 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data4_->self = g_object_ref (self);
#line 200 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp6_ = g_variant_builder_new ((const GVariantType*) "a(iiii)");
#line 200 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data4_->builder = _tmp6_;
#line 201 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp7_ = cl;
#line 201 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_class_foreach_delete_event (_tmp7_, ____lambda3__tracker_events_foreach, _data4_);
#line 204 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp8_ = _data4_->builder;
#line 204 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp9_ = g_variant_builder_end (_tmp8_);
#line 204 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp10_ = g_variant_ref_sink (_tmp9_);
#line 204 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		deletes = _tmp10_;
#line 206 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp11_ = g_variant_builder_new ((const GVariantType*) "a(iiii)");
#line 206 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_builder_unref0 (_data4_->builder);
#line 206 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data4_->builder = _tmp11_;
#line 207 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp12_ = cl;
#line 207 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_class_foreach_insert_event (_tmp12_, ____lambda4__tracker_events_foreach, _data4_);
#line 210 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp13_ = _data4_->builder;
#line 210 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp14_ = g_variant_builder_end (_tmp13_);
#line 210 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp15_ = g_variant_ref_sink (_tmp14_);
#line 210 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		inserts = _tmp15_;
#line 212 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp16_ = cl;
#line 212 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp17_ = tracker_class_get_uri (_tmp16_);
#line 212 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp18_ = _tmp17_;
#line 212 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp19_ = deletes;
#line 212 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp20_ = inserts;
#line 212 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_signal_emit_by_name (self, "graph-updated", _tmp18_, _tmp19_, _tmp20_);
#line 214 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp21_ = cl;
#line 214 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_class_reset_ready_events (_tmp21_);
#line 216 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		result = TRUE;
#line 216 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_unref0 (inserts);
#line 216 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_unref0 (deletes);
#line 216 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		block4_data_unref (_data4_);
#line 216 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_data4_ = NULL;
#line 216 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		return result;
#line 2132 "tracker-resources.c"
	}
#line 218 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	result = FALSE;
#line 218 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return result;
#line 2138 "tracker-resources.c"
}


static gpointer _g_hash_table_ref0 (gpointer self) {
#line 230 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return self ? g_hash_table_ref (self) : NULL;
#line 2145 "tracker-resources.c"
}


static gboolean tracker_resources_on_emit_signals (TrackerResources* self) {
	gboolean result = FALSE;
	gint _tmp0_ = 0;
	TrackerClass** _tmp1_ = NULL;
	GHashTable* _tmp4_ = NULL;
	GHashTable* _tmp5_;
	GHashTable* writebacks;
	GHashTable* _tmp6_;
#line 221 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = tracker_events_get_classes (&_tmp0_);
#line 2161 "tracker-resources.c"
	{
		TrackerClass** cl_collection = NULL;
		gint cl_collection_length1 = 0;
		gint _cl_collection_size_ = 0;
		gint cl_it = 0;
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		cl_collection = _tmp1_;
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		cl_collection_length1 = _tmp0_;
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		for (cl_it = 0; cl_it < _tmp0_; cl_it = cl_it + 1) {
#line 2173 "tracker-resources.c"
			TrackerClass* _tmp2_;
			TrackerClass* cl = NULL;
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp2_ = _g_object_ref0 (cl_collection[cl_it]);
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			cl = _tmp2_;
#line 2180 "tracker-resources.c"
			{
				TrackerClass* _tmp3_;
#line 223 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				_tmp3_ = cl;
#line 223 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				tracker_resources_emit_graph_updated (self, _tmp3_);
#line 222 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				_g_object_unref0 (cl);
#line 2189 "tracker-resources.c"
			}
		}
	}
#line 227 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_events_get_total (TRUE);
#line 230 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = tracker_writeback_get_ready ();
#line 230 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp5_ = _g_hash_table_ref0 (_tmp4_);
#line 230 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	writebacks = _tmp5_;
#line 232 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp6_ = writebacks;
#line 232 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp6_ != NULL) {
#line 2205 "tracker-resources.c"
		GVariantBuilder* _tmp7_;
		GVariantBuilder* builder;
		GHashTable* _tmp8_;
		GHashTableIter wb_iter = {0};
		gint subject_id = 0;
		GArray* types = NULL;
		GVariantBuilder* _tmp28_;
		GVariant* _tmp29_ = NULL;
		GVariant* _tmp30_;
#line 233 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp7_ = g_variant_builder_new ((const GVariantType*) "a{iai}");
#line 233 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		builder = _tmp7_;
#line 235 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp8_ = writebacks;
#line 235 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_hash_table_iter_init (&wb_iter, _tmp8_);
#line 239 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		while (TRUE) {
#line 2225 "tracker-resources.c"
			gconstpointer _tmp9_ = NULL;
			gconstpointer _tmp10_ = NULL;
			gboolean _tmp11_ = FALSE;
			GVariantBuilder* _tmp12_;
			GVariantBuilder* _tmp13_;
			gint _tmp14_;
			GVariantBuilder* _tmp15_;
			GVariantBuilder* _tmp26_;
			GVariantBuilder* _tmp27_;
#line 239 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp11_ = g_hash_table_iter_next (&wb_iter, &_tmp9_, &_tmp10_);
#line 239 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			subject_id = _tmp9_;
#line 239 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			types = _tmp10_;
#line 239 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			if (!_tmp11_) {
#line 239 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				break;
#line 2245 "tracker-resources.c"
			}
#line 240 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp12_ = builder;
#line 240 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_variant_builder_open (_tmp12_, (const GVariantType*) "{iai}");
#line 242 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp13_ = builder;
#line 242 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp14_ = subject_id;
#line 242 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_variant_builder_add (_tmp13_, "i", _tmp14_, NULL);
#line 244 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp15_ = builder;
#line 244 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_variant_builder_open (_tmp15_, (const GVariantType*) "ai");
#line 2261 "tracker-resources.c"
			{
				gint i;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				i = 0;
#line 2266 "tracker-resources.c"
				{
					gboolean _tmp16_;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					_tmp16_ = TRUE;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
					while (TRUE) {
#line 2273 "tracker-resources.c"
						gboolean _tmp17_;
						gint _tmp19_;
						GArray* _tmp20_;
						guint _tmp21_;
						GVariantBuilder* _tmp22_;
						GArray* _tmp23_;
						gint _tmp24_;
						gint _tmp25_ = 0;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp17_ = _tmp16_;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						if (!_tmp17_) {
#line 2286 "tracker-resources.c"
							gint _tmp18_;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
							_tmp18_ = i;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
							i = _tmp18_ + 1;
#line 2292 "tracker-resources.c"
						}
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp16_ = FALSE;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp19_ = i;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp20_ = types;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp21_ = _tmp20_->len;
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						if (!(((guint) _tmp19_) < _tmp21_)) {
#line 245 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
							break;
#line 2306 "tracker-resources.c"
						}
#line 246 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp22_ = builder;
#line 246 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp23_ = types;
#line 246 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp24_ = i;
#line 246 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						_tmp25_ = g_array_index (_tmp23_, gint, (guint) _tmp24_);
#line 246 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
						g_variant_builder_add (_tmp22_, "i", _tmp25_, NULL);
#line 2318 "tracker-resources.c"
					}
				}
			}
#line 248 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp26_ = builder;
#line 248 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_variant_builder_close (_tmp26_);
#line 250 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp27_ = builder;
#line 250 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_variant_builder_close (_tmp27_);
#line 2330 "tracker-resources.c"
		}
#line 253 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp28_ = builder;
#line 253 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp29_ = g_variant_builder_end (_tmp28_);
#line 253 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp30_ = g_variant_ref_sink (_tmp29_);
#line 253 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_signal_emit_by_name (self, "writeback", _tmp30_);
#line 253 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_unref0 (_tmp30_);
#line 232 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_g_variant_builder_unref0 (builder);
#line 2344 "tracker-resources.c"
	}
#line 256 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_writeback_reset_ready ();
#line 258 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self->priv->regular_commit_pending = FALSE;
#line 259 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self->priv->signal_timeout = (guint) 0;
#line 260 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	result = FALSE;
#line 260 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_hash_table_unref0 (writebacks);
#line 260 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return result;
#line 2358 "tracker-resources.c"
}


static gboolean _tracker_resources_on_emit_signals_gsource_func (gpointer self) {
	gboolean result;
	result = tracker_resources_on_emit_signals (self);
#line 292 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	return result;
#line 2367 "tracker-resources.c"
}


static void tracker_resources_on_statements_committed (TrackerResources* self, TrackerDataCommitType commit_type) {
	gint _tmp0_ = 0;
	TrackerClass** _tmp1_ = NULL;
	gboolean _tmp4_;
	TrackerDataCommitType _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_;
	gboolean _tmp11_;
#line 263 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = tracker_events_get_classes (&_tmp0_);
#line 2383 "tracker-resources.c"
	{
		TrackerClass** cl_collection = NULL;
		gint cl_collection_length1 = 0;
		gint _cl_collection_size_ = 0;
		gint cl_it = 0;
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		cl_collection = _tmp1_;
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		cl_collection_length1 = _tmp0_;
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		for (cl_it = 0; cl_it < _tmp0_; cl_it = cl_it + 1) {
#line 2395 "tracker-resources.c"
			TrackerClass* _tmp2_;
			TrackerClass* cl = NULL;
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp2_ = _g_object_ref0 (cl_collection[cl_it]);
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			cl = _tmp2_;
#line 2402 "tracker-resources.c"
			{
				TrackerClass* _tmp3_;
#line 267 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				_tmp3_ = cl;
#line 267 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				tracker_class_transact_events (_tmp3_);
#line 266 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
				_g_object_unref0 (cl);
#line 2411 "tracker-resources.c"
			}
		}
	}
#line 270 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = self->priv->regular_commit_pending;
#line 270 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (!_tmp4_) {
#line 2419 "tracker-resources.c"
		guint _tmp5_;
#line 279 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp5_ = self->priv->signal_timeout;
#line 279 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_tmp5_ != ((guint) 0)) {
#line 2425 "tracker-resources.c"
			guint _tmp6_;
#line 280 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp6_ = self->priv->signal_timeout;
#line 280 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_source_remove (_tmp6_);
#line 281 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			self->priv->signal_timeout = (guint) 0;
#line 2433 "tracker-resources.c"
		}
	}
#line 285 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp7_ = commit_type;
#line 285 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp7_ == TRACKER_DATA_COMMIT_REGULAR) {
#line 286 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		self->priv->regular_commit_pending = TRUE;
#line 2442 "tracker-resources.c"
	}
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp9_ = self->priv->regular_commit_pending;
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp9_) {
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp8_ = TRUE;
#line 2450 "tracker-resources.c"
	} else {
		TrackerDataCommitType _tmp10_;
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp10_ = commit_type;
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp8_ = _tmp10_ == TRACKER_DATA_COMMIT_BATCH_LAST;
#line 2457 "tracker-resources.c"
	}
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp11_ = _tmp8_;
#line 289 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp11_) {
#line 2463 "tracker-resources.c"
		guint _tmp12_;
#line 291 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp12_ = self->priv->signal_timeout;
#line 291 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_tmp12_ == ((guint) 0)) {
#line 2469 "tracker-resources.c"
			guint _tmp13_ = 0U;
#line 292 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp13_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (TRACKER_RESOURCES_SIGNALS_SECONDS_PER_EMIT * 1000), _tracker_resources_on_emit_signals_gsource_func, g_object_ref (self), g_object_unref);
#line 292 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			self->priv->signal_timeout = _tmp13_;
#line 2475 "tracker-resources.c"
		}
	}
#line 297 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_writeback_transact ();
#line 2480 "tracker-resources.c"
}


static void tracker_resources_on_statements_rolled_back (TrackerResources* self, TrackerDataCommitType commit_type) {
#line 300 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 301 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_events_reset_pending ();
#line 302 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_writeback_reset_pending ();
#line 2491 "tracker-resources.c"
}


static void tracker_resources_check_graph_updated_signal (TrackerResources* self) {
	guint _tmp0_ = 0U;
#line 305 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 307 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = tracker_events_get_total (FALSE);
#line 307 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp0_ > ((guint) TRACKER_RESOURCES_GRAPH_UPDATED_IMMEDIATE_EMIT_AT)) {
#line 2503 "tracker-resources.c"
		guint _tmp1_;
#line 311 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp1_ = self->priv->signal_timeout;
#line 311 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		if (_tmp1_ != ((guint) 0)) {
#line 2509 "tracker-resources.c"
			guint _tmp2_;
#line 312 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			_tmp2_ = self->priv->signal_timeout;
#line 312 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			g_source_remove (_tmp2_);
#line 313 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
			self->priv->signal_timeout = (guint) 0;
#line 2517 "tracker-resources.c"
		}
#line 317 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		tracker_resources_on_emit_signals (self);
#line 2521 "tracker-resources.c"
	}
}


static void tracker_resources_on_statement_inserted (TrackerResources* self, gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint pred_id, gint object_id, const gchar* object, GPtrArray* rdf_types) {
	gint _tmp0_;
	gint _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	gint _tmp7_;
	const gchar* _tmp8_;
	gint _tmp9_;
	const gchar* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	const gchar* _tmp13_;
	GPtrArray* _tmp14_;
#line 321 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 321 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (subject != NULL);
#line 321 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (rdf_types != NULL);
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = graph_id;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = subject_id;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = subject;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = pred_id;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = object_id;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp5_ = object;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp6_ = rdf_types;
#line 322 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_events_add_insert (_tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_, _tmp6_);
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp7_ = graph_id;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp8_ = graph;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp9_ = subject_id;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp10_ = subject;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp11_ = pred_id;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp12_ = object_id;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp13_ = object;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp14_ = rdf_types;
#line 323 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_writeback_check (_tmp7_, _tmp8_, _tmp9_, _tmp10_, _tmp11_, _tmp12_, _tmp13_, _tmp14_);
#line 324 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_check_graph_updated_signal (self);
#line 2584 "tracker-resources.c"
}


static void tracker_resources_on_statement_deleted (TrackerResources* self, gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint pred_id, gint object_id, const gchar* object, GPtrArray* rdf_types) {
	gint _tmp0_;
	gint _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	gint _tmp7_;
	const gchar* _tmp8_;
	gint _tmp9_;
	const gchar* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	const gchar* _tmp13_;
	GPtrArray* _tmp14_;
#line 327 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 327 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (subject != NULL);
#line 327 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (rdf_types != NULL);
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = graph_id;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp1_ = subject_id;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp2_ = subject;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp3_ = pred_id;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp4_ = object_id;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp5_ = object;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp6_ = rdf_types;
#line 328 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_events_add_delete (_tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_, _tmp6_);
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp7_ = graph_id;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp8_ = graph;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp9_ = subject_id;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp10_ = subject;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp11_ = pred_id;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp12_ = object_id;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp13_ = object;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp14_ = rdf_types;
#line 329 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_writeback_check (_tmp7_, _tmp8_, _tmp9_, _tmp10_, _tmp11_, _tmp12_, _tmp13_, _tmp14_);
#line 330 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_check_graph_updated_signal (self);
#line 2646 "tracker-resources.c"
}


static void _tracker_resources_on_statement_inserted_tracker_statement_callback (gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint predicate_id, gint object_id, const gchar* object, GPtrArray* rdf_types, gpointer self) {
#line 335 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_on_statement_inserted (self, graph_id, graph, subject_id, subject, predicate_id, object_id, object, rdf_types);
#line 2653 "tracker-resources.c"
}


static void _tracker_resources_on_statement_deleted_tracker_statement_callback (gint graph_id, const gchar* graph, gint subject_id, const gchar* subject, gint predicate_id, gint object_id, const gchar* object, GPtrArray* rdf_types, gpointer self) {
#line 336 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_on_statement_deleted (self, graph_id, graph, subject_id, subject, predicate_id, object_id, object, rdf_types);
#line 2660 "tracker-resources.c"
}


static void _tracker_resources_on_statements_committed_tracker_commit_callback (TrackerDataCommitType commit_type, gpointer self) {
#line 337 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_on_statements_committed (self, commit_type);
#line 2667 "tracker-resources.c"
}


static void _tracker_resources_on_statements_rolled_back_tracker_commit_callback (TrackerDataCommitType commit_type, gpointer self) {
#line 338 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_on_statements_rolled_back (self, commit_type);
#line 2674 "tracker-resources.c"
}


void tracker_resources_enable_signals (TrackerResources* self) {
#line 334 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 335 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_add_insert_statement_callback (_tracker_resources_on_statement_inserted_tracker_statement_callback, self);
#line 336 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_add_delete_statement_callback (_tracker_resources_on_statement_deleted_tracker_statement_callback, self);
#line 337 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_add_commit_statement_callback (_tracker_resources_on_statements_committed_tracker_commit_callback, self);
#line 338 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_add_rollback_statement_callback (_tracker_resources_on_statements_rolled_back_tracker_commit_callback, self);
#line 2689 "tracker-resources.c"
}


void tracker_resources_disable_signals (TrackerResources* self) {
	guint _tmp0_;
#line 342 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 343 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_remove_insert_statement_callback (_tracker_resources_on_statement_inserted_tracker_statement_callback, self);
#line 344 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_remove_delete_statement_callback (_tracker_resources_on_statement_deleted_tracker_statement_callback, self);
#line 345 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_remove_commit_statement_callback (_tracker_resources_on_statements_committed_tracker_commit_callback, self);
#line 346 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_data_remove_rollback_statement_callback (_tracker_resources_on_statements_rolled_back_tracker_commit_callback, self);
#line 348 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = self->priv->signal_timeout;
#line 348 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (_tmp0_ != ((guint) 0)) {
#line 2709 "tracker-resources.c"
		guint _tmp1_;
#line 349 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		_tmp1_ = self->priv->signal_timeout;
#line 349 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		g_source_remove (_tmp1_);
#line 2715 "tracker-resources.c"
	}
}


void tracker_resources_unreg_batches (TrackerResources* self, const gchar* old_owner) {
	const gchar* _tmp0_;
#line 358 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (self != NULL);
#line 358 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (old_owner != NULL);
#line 359 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_tmp0_ = old_owner;
#line 359 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_store_unreg_batches (_tmp0_);
#line 2730 "tracker-resources.c"
}


static void g_cclosure_user_marshal_VOID__VARIANT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__VARIANT) (gpointer data1, gpointer arg_1, gpointer data2);
	register GMarshalFunc_VOID__VARIANT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (n_param_values == 2);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data1 = closure->data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data2 = param_values->data[0].v_pointer;
#line 2749 "tracker-resources.c"
	} else {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data1 = param_values->data[0].v_pointer;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data2 = closure->data;
#line 2755 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	callback = (GMarshalFunc_VOID__VARIANT) (marshal_data ? marshal_data : cc->callback);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	callback (data1, g_value_get_variant (param_values + 1), data2);
#line 2761 "tracker-resources.c"
}


static void g_cclosure_user_marshal_VOID__STRING_VARIANT_VARIANT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__STRING_VARIANT_VARIANT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_VARIANT_VARIANT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_return_if_fail (n_param_values == 4);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data1 = closure->data;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data2 = param_values->data[0].v_pointer;
#line 2780 "tracker-resources.c"
	} else {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data1 = param_values->data[0].v_pointer;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
		data2 = closure->data;
#line 2786 "tracker-resources.c"
	}
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	callback = (GMarshalFunc_VOID__STRING_VARIANT_VARIANT) (marshal_data ? marshal_data : cc->callback);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	callback (data1, g_value_get_string (param_values + 1), g_value_get_variant (param_values + 2), g_value_get_variant (param_values + 3), data2);
#line 2792 "tracker-resources.c"
}


static void tracker_resources_class_init (TrackerResourcesClass * klass) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_parent_class = g_type_class_peek_parent (klass);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_type_class_add_private (klass, sizeof (TrackerResourcesPrivate));
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	G_OBJECT_CLASS (klass)->finalize = tracker_resources_finalize;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_signal_new ("writeback", TRACKER_TYPE_RESOURCES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__VARIANT, G_TYPE_NONE, 1, G_TYPE_VARIANT);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	g_signal_new ("graph_updated", TRACKER_TYPE_RESOURCES, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_VARIANT_VARIANT, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT);
#line 2807 "tracker-resources.c"
}


static void tracker_resources_instance_init (TrackerResources * self) {
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self->priv = TRACKER_RESOURCES_GET_PRIVATE (self);
#line 2814 "tracker-resources.c"
}


static void tracker_resources_finalize (GObject* obj) {
	TrackerResources * self;
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	self = TRACKER_RESOURCES (obj);
#line 354 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	tracker_resources_disable_signals (self);
#line 53 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	_g_object_unref0 (self->priv->connection);
#line 22 "/home/martyn/Source/tracker/src/tracker-store/tracker-resources.vala"
	G_OBJECT_CLASS (tracker_resources_parent_class)->finalize (obj);
#line 2828 "tracker-resources.c"
}


GType tracker_resources_get_type (void) {
	static volatile gsize tracker_resources_type_id__volatile = 0;
	if (g_once_init_enter (&tracker_resources_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TrackerResourcesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_resources_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerResources), 0, (GInstanceInitFunc) tracker_resources_instance_init, NULL };
		GType tracker_resources_type_id;
		tracker_resources_type_id = g_type_register_static (G_TYPE_OBJECT, "TrackerResources", &g_define_type_info, 0);
		g_type_set_qdata (tracker_resources_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) tracker_resources_register_object);
		g_once_init_leave (&tracker_resources_type_id__volatile, tracker_resources_type_id);
	}
	return tracker_resources_type_id__volatile;
}


static void _dbus_tracker_resources_load (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* uri = NULL;
	GVariant* _tmp2_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp2_ = g_variant_iter_next_value (&_arguments_iter);
	uri = g_variant_dup_string (_tmp2_, NULL);
	g_variant_unref (_tmp2_);
	tracker_resources_load (self, g_dbus_method_invocation_get_sender (invocation), uri, (GAsyncReadyCallback) _dbus_tracker_resources_load_ready, invocation);
	_g_free0 (uri);
}


static void _dbus_tracker_resources_load_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	invocation = _user_data_;
	tracker_resources_load_finish ((TrackerResources*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_tracker_resources_sparql_query (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* query = NULL;
	GVariant* _tmp3_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	query = g_variant_dup_string (_tmp3_, NULL);
	g_variant_unref (_tmp3_);
	tracker_resources_sparql_query (self, g_dbus_method_invocation_get_sender (invocation), query, (GAsyncReadyCallback) _dbus_tracker_resources_sparql_query_ready, invocation);
	_g_free0 (query);
}


static void _dbus_tracker_resources_sparql_query_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	invocation = _user_data_;
	result = tracker_resources_sparql_query_finish ((TrackerResources*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_tracker_resources_sparql_update (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* update = NULL;
	GVariant* _tmp4_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	update = g_variant_dup_string (_tmp4_, NULL);
	g_variant_unref (_tmp4_);
	tracker_resources_sparql_update (self, g_dbus_method_invocation_get_sender (invocation), update, (GAsyncReadyCallback) _dbus_tracker_resources_sparql_update_ready, invocation);
	_g_free0 (update);
}


static void _dbus_tracker_resources_sparql_update_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	invocation = _user_data_;
	tracker_resources_sparql_update_finish ((TrackerResources*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_tracker_resources_sparql_update_blank (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* update = NULL;
	GVariant* _tmp5_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	update = g_variant_dup_string (_tmp5_, NULL);
	g_variant_unref (_tmp5_);
	tracker_resources_sparql_update_blank (self, g_dbus_method_invocation_get_sender (invocation), update, (GAsyncReadyCallback) _dbus_tracker_resources_sparql_update_blank_ready, invocation);
	_g_free0 (update);
}


static void _dbus_tracker_resources_sparql_update_blank_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	invocation = _user_data_;
	result = tracker_resources_sparql_update_blank_finish ((TrackerResources*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_tracker_resources_sync (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, parameters);
	tracker_resources_sync (self, g_dbus_method_invocation_get_sender (invocation));
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_tracker_resources_batch_sparql_update (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* update = NULL;
	GVariant* _tmp6_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	update = g_variant_dup_string (_tmp6_, NULL);
	g_variant_unref (_tmp6_);
	tracker_resources_batch_sparql_update (self, g_dbus_method_invocation_get_sender (invocation), update, (GAsyncReadyCallback) _dbus_tracker_resources_batch_sparql_update_ready, invocation);
	_g_free0 (update);
}


static void _dbus_tracker_resources_batch_sparql_update_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	invocation = _user_data_;
	tracker_resources_batch_sparql_update_finish ((TrackerResources*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_tracker_resources_batch_commit (TrackerResources* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, parameters);
	tracker_resources_batch_commit (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void tracker_resources_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "Load") == 0) {
		_dbus_tracker_resources_load (object, parameters, invocation);
	} else if (strcmp (method_name, "SparqlQuery") == 0) {
		_dbus_tracker_resources_sparql_query (object, parameters, invocation);
	} else if (strcmp (method_name, "SparqlUpdate") == 0) {
		_dbus_tracker_resources_sparql_update (object, parameters, invocation);
	} else if (strcmp (method_name, "SparqlUpdateBlank") == 0) {
		_dbus_tracker_resources_sparql_update_blank (object, parameters, invocation);
	} else if (strcmp (method_name, "Sync") == 0) {
		_dbus_tracker_resources_sync (object, parameters, invocation);
	} else if (strcmp (method_name, "BatchSparqlUpdate") == 0) {
		_dbus_tracker_resources_batch_sparql_update (object, parameters, invocation);
	} else if (strcmp (method_name, "BatchCommit") == 0) {
		_dbus_tracker_resources_batch_commit (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* tracker_resources_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}


static gboolean tracker_resources_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}


static void _dbus_tracker_resources_writeback (GObject* _sender, GVariant* subjects, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, subjects);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Tracker1.Resources", "Writeback", _arguments, NULL);
}


static void _dbus_tracker_resources_graph_updated (GObject* _sender, const gchar* classname, GVariant* deletes, GVariant* inserts, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (classname));
	g_variant_builder_add_value (&_arguments_builder, deletes);
	g_variant_builder_add_value (&_arguments_builder, inserts);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Tracker1.Resources", "GraphUpdated", _arguments, NULL);
}


guint tracker_resources_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_tracker_resources_dbus_interface_info), &_tracker_resources_dbus_interface_vtable, data, _tracker_resources_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "writeback", (GCallback) _dbus_tracker_resources_writeback, data);
	g_signal_connect (object, "graph-updated", (GCallback) _dbus_tracker_resources_graph_updated, data);
	return result;
}


static void _tracker_resources_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_tracker_resources_writeback, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_tracker_resources_graph_updated, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}



