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

/*
 * Copyright (C) 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-data-manager.h"
#include "libtracker-data/tracker-ontologies.h"
#include "libtracker-data/tracker-db-interface.h"
#include "libtracker-data/tracker-class.h"
#include "libtracker-sparql/tracker-sparql.h"


#define TRACKER_TYPE_STATISTICS (tracker_statistics_get_type ())
#define TRACKER_STATISTICS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_STATISTICS, TrackerStatistics))
#define TRACKER_STATISTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_STATISTICS, TrackerStatisticsClass))
#define TRACKER_IS_STATISTICS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_STATISTICS))
#define TRACKER_IS_STATISTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_STATISTICS))
#define TRACKER_STATISTICS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_STATISTICS, TrackerStatisticsClass))

typedef struct _TrackerStatistics TrackerStatistics;
typedef struct _TrackerStatisticsClass TrackerStatisticsClass;
typedef struct _TrackerStatisticsPrivate TrackerStatisticsPrivate;
enum  {
	TRACKER_STATISTICS_DUMMY_PROPERTY,
	TRACKER_STATISTICS_LAST_PROPERTY
};
static GParamSpec* tracker_statistics_properties[TRACKER_STATISTICS_LAST_PROPERTY];
#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_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _TrackerStatistics {
	GObject parent_instance;
	TrackerStatisticsPrivate * priv;
};

struct _TrackerStatisticsClass {
	GObjectClass parent_class;
};


static gpointer tracker_statistics_parent_class = NULL;
static gboolean tracker_statistics_initialized;
static gboolean tracker_statistics_initialized = FALSE;

GType tracker_statistics_get_type (void) G_GNUC_CONST;
guint tracker_statistics_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
#define TRACKER_STATISTICS_PATH "/org/freedesktop/Tracker1/Statistics"
GVariant* tracker_statistics_get (TrackerStatistics* self, const char* sender, GError** error);
TrackerDataManager* tracker_main_get_data_manager (void);
TrackerStatistics* tracker_statistics_new (void);
TrackerStatistics* tracker_statistics_construct (GType object_type);
static void tracker_statistics_finalize (GObject * obj);
static void _dbus_tracker_statistics_get (TrackerStatistics* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void tracker_statistics_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_statistics_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_statistics_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 _tracker_statistics_unregister_object (gpointer user_data);

static const GDBusArgInfo _tracker_statistics_dbus_arg_info_get_result = {-1, "result", "aas"};
static const GDBusArgInfo * const _tracker_statistics_dbus_arg_info_get_in[] = {NULL};
static const GDBusArgInfo * const _tracker_statistics_dbus_arg_info_get_out[] = {&_tracker_statistics_dbus_arg_info_get_result, NULL};
static const GDBusMethodInfo _tracker_statistics_dbus_method_info_get = {-1, "Get", (GDBusArgInfo **) (&_tracker_statistics_dbus_arg_info_get_in), (GDBusArgInfo **) (&_tracker_statistics_dbus_arg_info_get_out)};
static const GDBusMethodInfo * const _tracker_statistics_dbus_method_info[] = {&_tracker_statistics_dbus_method_info_get, NULL};
static const GDBusSignalInfo * const _tracker_statistics_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _tracker_statistics_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _tracker_statistics_dbus_interface_info = {-1, "org.freedesktop.Tracker1.Statistics", (GDBusMethodInfo **) (&_tracker_statistics_dbus_method_info), (GDBusSignalInfo **) (&_tracker_statistics_dbus_signal_info), (GDBusPropertyInfo **) (&_tracker_statistics_dbus_property_info)};
static const GDBusInterfaceVTable _tracker_statistics_dbus_interface_vtable = {tracker_statistics_dbus_interface_method_call, tracker_statistics_dbus_interface_get_property, tracker_statistics_dbus_interface_set_property};

static gpointer _g_object_ref0 (gpointer self) {
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	return self ? g_object_ref (self) : NULL;
#line 98 "tracker-statistics.c"
}


GVariant* tracker_statistics_get (TrackerStatistics* self, const char* sender, GError** error) {
	GVariant* result = NULL;
	TrackerDBusRequest* request = NULL;
	const char* _tmp0_;
	TrackerDBusRequest* _tmp1_;
	TrackerDataManager* data_manager = NULL;
	TrackerDataManager* _tmp2_;
	TrackerDataManager* _tmp3_;
	TrackerOntologies* ontologies = NULL;
	TrackerDataManager* _tmp4_;
	TrackerOntologies* _tmp5_;
	TrackerOntologies* _tmp6_;
	gboolean _tmp7_;
	GVariantBuilder* builder = NULL;
	GVariantBuilder* _tmp35_;
	TrackerOntologies* _tmp36_;
	gint _tmp37_;
	TrackerClass** _tmp38_;
	TrackerDBusRequest* _tmp55_;
	GVariantBuilder* _tmp56_;
	GVariant* _tmp57_;
	GError * _inner_error_ = NULL;
#line 27 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 27 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	g_return_val_if_fail (sender != NULL, NULL);
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp0_ = sender;
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp1_ = tracker_dbus_request_begin ((const gchar*) _tmp0_, "Statistics.Get", NULL);
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	request = _tmp1_;
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp2_ = tracker_main_get_data_manager ();
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	data_manager = _tmp3_;
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp4_ = data_manager;
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp5_ = tracker_data_manager_get_ontologies (_tmp4_);
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	ontologies = _tmp6_;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp7_ = tracker_statistics_initialized;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	if (!_tmp7_) {
#line 152 "tracker-statistics.c"
		TrackerDBInterface* iface = NULL;
		TrackerDataManager* _tmp8_;
		TrackerDBInterface* _tmp9_;
		TrackerDBInterface* _tmp10_;
		TrackerOntologies* _tmp11_;
		gint _tmp12_;
		TrackerClass** _tmp13_;
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp8_ = data_manager;
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp9_ = tracker_data_manager_get_db_interface (_tmp8_);
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp10_ = _g_object_ref0 (_tmp9_);
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		iface = _tmp10_;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp11_ = ontologies;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp13_ = tracker_ontologies_get_classes (_tmp11_, &_tmp12_);
#line 172 "tracker-statistics.c"
		{
			TrackerClass** cl_collection = NULL;
			gint cl_collection_length1 = 0;
			gint _cl_collection_size_ = 0;
			gint cl_it = 0;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			cl_collection = _tmp13_;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			cl_collection_length1 = _tmp12_;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			for (cl_it = 0; cl_it < _tmp12_; cl_it = cl_it + 1) {
#line 184 "tracker-statistics.c"
				TrackerClass* _tmp14_;
				TrackerClass* cl = NULL;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp14_ = _g_object_ref0 (cl_collection[cl_it]);
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				cl = _tmp14_;
#line 191 "tracker-statistics.c"
				{
					TrackerClass* _tmp15_;
					const gchar* _tmp16_;
					const gchar* _tmp17_;
					gboolean _tmp18_;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp15_ = cl;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp16_ = tracker_class_get_name (_tmp15_);
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp17_ = _tmp16_;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp18_ = g_str_has_prefix (_tmp17_, "xsd:");
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					if (!_tmp18_) {
#line 207 "tracker-statistics.c"
						TrackerDBStatement* stmt = NULL;
						TrackerDBInterface* _tmp19_;
						TrackerClass* _tmp20_;
						const gchar* _tmp21_;
						const gchar* _tmp22_;
						TrackerDBStatement* _tmp23_;
						TrackerDBCursor* stat_cursor = NULL;
						TrackerDBStatement* _tmp24_;
						TrackerDBCursor* _tmp25_;
						gboolean _tmp26_ = FALSE;
						TrackerDBCursor* _tmp27_;
						gboolean _tmp28_;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp19_ = iface;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp20_ = cl;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp21_ = tracker_class_get_name (_tmp20_);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp22_ = _tmp21_;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp23_ = tracker_db_interface_create_statement (_tmp19_, TRACKER_DB_STATEMENT_CACHE_TYPE_NONE, &_inner_error_, "SELECT COUNT(1) FROM \"%s\"", _tmp22_);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						stmt = _tmp23_;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							g_propagate_error (error, _inner_error_);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (cl);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (iface);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (ontologies);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (data_manager);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							return NULL;
#line 246 "tracker-statistics.c"
						}
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp24_ = stmt;
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp25_ = tracker_db_statement_start_cursor (_tmp24_, &_inner_error_);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						stat_cursor = _tmp25_;
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							g_propagate_error (error, _inner_error_);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (stmt);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (cl);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (iface);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (ontologies);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (data_manager);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							return NULL;
#line 270 "tracker-statistics.c"
						}
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp27_ = stat_cursor;
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp28_ = tracker_sparql_cursor_next ((TrackerSparqlCursor*) _tmp27_, NULL, &_inner_error_);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp26_ = _tmp28_;
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							g_propagate_error (error, _inner_error_);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (stat_cursor);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (stmt);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (cl);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (iface);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (ontologies);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_g_object_unref0 (data_manager);
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							return NULL;
#line 296 "tracker-statistics.c"
						}
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						if (_tmp26_) {
#line 300 "tracker-statistics.c"
							TrackerClass* _tmp29_;
							TrackerDBCursor* _tmp30_;
							gint64 _tmp31_;
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp29_ = cl;
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp30_ = stat_cursor;
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp31_ = tracker_sparql_cursor_get_integer ((TrackerSparqlCursor*) _tmp30_, 0);
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							tracker_class_set_count (_tmp29_, (gint) _tmp31_);
#line 312 "tracker-statistics.c"
						} else {
							TrackerClass* _tmp32_;
							const gchar* _tmp33_;
							const gchar* _tmp34_;
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp32_ = cl;
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp33_ = tracker_class_get_name (_tmp32_);
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp34_ = _tmp33_;
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							g_warning ("Unable to query instance count for class %s", _tmp34_);
#line 325 "tracker-statistics.c"
						}
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_g_object_unref0 (stat_cursor);
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_g_object_unref0 (stmt);
#line 331 "tracker-statistics.c"
					}
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_g_object_unref0 (cl);
#line 335 "tracker-statistics.c"
				}
			}
		}
#line 52 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		tracker_statistics_initialized = TRUE;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_g_object_unref0 (iface);
#line 343 "tracker-statistics.c"
	}
#line 55 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp35_ = g_variant_builder_new ((const GVariantType*) "aas");
#line 55 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	builder = _tmp35_;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp36_ = ontologies;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp38_ = tracker_ontologies_get_classes (_tmp36_, &_tmp37_);
#line 353 "tracker-statistics.c"
	{
		TrackerClass** cl_collection = NULL;
		gint cl_collection_length1 = 0;
		gint _cl_collection_size_ = 0;
		gint cl_it = 0;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		cl_collection = _tmp38_;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		cl_collection_length1 = _tmp37_;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		for (cl_it = 0; cl_it < _tmp37_; cl_it = cl_it + 1) {
#line 365 "tracker-statistics.c"
			TrackerClass* _tmp39_;
			TrackerClass* cl = NULL;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			_tmp39_ = _g_object_ref0 (cl_collection[cl_it]);
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			cl = _tmp39_;
#line 372 "tracker-statistics.c"
			{
				TrackerClass* _tmp40_;
				gint _tmp41_;
				gint _tmp42_;
				GVariantBuilder* _tmp43_;
				GVariantBuilder* _tmp44_;
				TrackerClass* _tmp45_;
				const gchar* _tmp46_;
				const gchar* _tmp47_;
				GVariantBuilder* _tmp48_;
				TrackerClass* _tmp49_;
				gint _tmp50_;
				gint _tmp51_;
				gchar* _tmp52_;
				gchar* _tmp53_;
				GVariantBuilder* _tmp54_;
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp40_ = cl;
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp41_ = tracker_class_get_count (_tmp40_);
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp42_ = _tmp41_;
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				if (_tmp42_ == 0) {
#line 60 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_g_object_unref0 (cl);
#line 60 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					continue;
#line 401 "tracker-statistics.c"
				}
#line 63 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp43_ = builder;
#line 63 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_open (_tmp43_, (const GVariantType*) "as");
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp44_ = builder;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp45_ = cl;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp46_ = tracker_class_get_name (_tmp45_);
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp47_ = _tmp46_;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_add (_tmp44_, "s", _tmp47_, NULL);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp48_ = builder;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp49_ = cl;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp50_ = tracker_class_get_count (_tmp49_);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp51_ = _tmp50_;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp52_ = g_strdup_printf ("%i", _tmp51_);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp53_ = _tmp52_;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_add (_tmp48_, "s", _tmp53_, NULL);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_g_free0 (_tmp53_);
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp54_ = builder;
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_close (_tmp54_);
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_g_object_unref0 (cl);
#line 439 "tracker-statistics.c"
			}
		}
	}
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp55_ = request;
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	tracker_dbus_request_end (_tmp55_, NULL);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp56_ = builder;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp57_ = g_variant_builder_end (_tmp56_);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	g_variant_ref_sink (_tmp57_);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	result = _tmp57_;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_g_variant_builder_unref0 (builder);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_g_object_unref0 (ontologies);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_g_object_unref0 (data_manager);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	return result;
#line 463 "tracker-statistics.c"
}


TrackerStatistics* tracker_statistics_construct (GType object_type) {
	TrackerStatistics * self = NULL;
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	self = (TrackerStatistics*) g_object_new (object_type, NULL);
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	return self;
#line 473 "tracker-statistics.c"
}


TrackerStatistics* tracker_statistics_new (void) {
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	return tracker_statistics_construct (TRACKER_TYPE_STATISTICS);
#line 480 "tracker-statistics.c"
}


static void tracker_statistics_class_init (TrackerStatisticsClass * klass) {
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	tracker_statistics_parent_class = g_type_class_peek_parent (klass);
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	G_OBJECT_CLASS (klass)->finalize = tracker_statistics_finalize;
#line 489 "tracker-statistics.c"
}


static void tracker_statistics_instance_init (TrackerStatistics * self) {
}


static void tracker_statistics_finalize (GObject * obj) {
	TrackerStatistics * self;
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_TYPE_STATISTICS, TrackerStatistics);
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	G_OBJECT_CLASS (tracker_statistics_parent_class)->finalize (obj);
#line 503 "tracker-statistics.c"
}


GType tracker_statistics_get_type (void) {
	static volatile gsize tracker_statistics_type_id__volatile = 0;
	if (g_once_init_enter (&tracker_statistics_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TrackerStatisticsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_statistics_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerStatistics), 0, (GInstanceInitFunc) tracker_statistics_instance_init, NULL };
		GType tracker_statistics_type_id;
		tracker_statistics_type_id = g_type_register_static (G_TYPE_OBJECT, "TrackerStatistics", &g_define_type_info, 0);
		g_type_set_qdata (tracker_statistics_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) tracker_statistics_register_object);
		g_once_init_leave (&tracker_statistics_type_id__volatile, tracker_statistics_type_id);
	}
	return tracker_statistics_type_id__volatile;
}


static void _dbus_tracker_statistics_get (TrackerStatistics* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = tracker_statistics_get (self, g_dbus_method_invocation_get_sender (invocation), &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 tracker_statistics_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, "Get") == 0) {
		_dbus_tracker_statistics_get (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* tracker_statistics_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_statistics_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;
}


guint tracker_statistics_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_statistics_dbus_interface_info), &_tracker_statistics_dbus_interface_vtable, data, _tracker_statistics_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}


static void _tracker_statistics_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}



