/* tracker-statistics.c generated by valac 0.40.6, 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_0_PROPERTY,
	TRACKER_STATISTICS_NUM_PROPERTIES
};
static GParamSpec* tracker_statistics_properties[TRACKER_STATISTICS_NUM_PROPERTIES];
#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 128 "tracker-statistics.c"
}


GVariant*
tracker_statistics_get (TrackerStatistics* self,
                        const char* sender,
                        GError** error)
{
	GVariant* result = NULL;
	TrackerDBusRequest* request = NULL;
	TrackerDBusRequest* _tmp0_;
	TrackerDataManager* data_manager = NULL;
	TrackerDataManager* _tmp1_;
	TrackerDataManager* _tmp2_;
	TrackerOntologies* ontologies = NULL;
	TrackerDataManager* _tmp3_;
	TrackerOntologies* _tmp4_;
	TrackerOntologies* _tmp5_;
	gboolean _tmp6_;
	GVariantBuilder* builder = NULL;
	GVariantBuilder* _tmp31_;
	TrackerOntologies* _tmp32_;
	gint _tmp33_;
	TrackerClass** _tmp34_;
	TrackerDBusRequest* _tmp51_;
	GVariantBuilder* _tmp52_;
	GVariant* _tmp53_;
	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_ = tracker_dbus_request_begin ((const gchar*) sender, "Statistics.Get", NULL);
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	request = _tmp0_;
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp1_ = tracker_main_get_data_manager ();
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	data_manager = _tmp2_;
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp3_ = data_manager;
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp4_ = tracker_data_manager_get_ontologies (_tmp3_);
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp5_ = _g_object_ref0 (_tmp4_);
#line 30 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	ontologies = _tmp5_;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp6_ = tracker_statistics_initialized;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	if (!_tmp6_) {
#line 183 "tracker-statistics.c"
		TrackerDBInterface* iface = NULL;
		TrackerDataManager* _tmp7_;
		TrackerDBInterface* _tmp8_;
		TrackerDBInterface* _tmp9_;
		TrackerOntologies* _tmp10_;
		gint _tmp11_;
		TrackerClass** _tmp12_;
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp7_ = data_manager;
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp8_ = tracker_data_manager_get_db_interface (_tmp7_);
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp9_ = _g_object_ref0 (_tmp8_);
#line 33 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		iface = _tmp9_;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp10_ = ontologies;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		_tmp12_ = tracker_ontologies_get_classes (_tmp10_, &_tmp11_);
#line 203 "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 = _tmp12_;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			cl_collection_length1 = _tmp11_;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			for (cl_it = 0; cl_it < _tmp11_; cl_it = cl_it + 1) {
#line 215 "tracker-statistics.c"
				TrackerClass* _tmp13_;
				TrackerClass* cl = NULL;
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp13_ = _g_object_ref0 (cl_collection[cl_it]);
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				cl = _tmp13_;
#line 222 "tracker-statistics.c"
				{
					TrackerClass* _tmp14_;
					const gchar* _tmp15_;
					const gchar* _tmp16_;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp14_ = cl;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp15_ = tracker_class_get_name (_tmp14_);
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_tmp16_ = _tmp15_;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					if (!g_str_has_prefix (_tmp16_, "xsd:")) {
#line 235 "tracker-statistics.c"
						TrackerDBStatement* stmt = NULL;
						TrackerDBInterface* _tmp17_;
						TrackerClass* _tmp18_;
						const gchar* _tmp19_;
						const gchar* _tmp20_;
						TrackerDBStatement* _tmp21_;
						TrackerDBCursor* stat_cursor = NULL;
						TrackerDBStatement* _tmp22_;
						TrackerDBCursor* _tmp23_;
						gboolean _tmp24_ = FALSE;
						TrackerDBCursor* _tmp25_;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp17_ = iface;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp18_ = cl;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp19_ = tracker_class_get_name (_tmp18_);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp20_ = _tmp19_;
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp21_ = tracker_db_interface_create_statement (_tmp17_, TRACKER_DB_STATEMENT_CACHE_TYPE_NONE, &_inner_error_, "SELECT COUNT(1) FROM \"%s\"", _tmp20_);
#line 39 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						stmt = _tmp21_;
#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 273 "tracker-statistics.c"
						}
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp22_ = stmt;
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp23_ = tracker_db_statement_start_cursor (_tmp22_, &_inner_error_);
#line 43 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						stat_cursor = _tmp23_;
#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 297 "tracker-statistics.c"
						}
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp25_ = stat_cursor;
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						_tmp24_ = tracker_sparql_cursor_next ((TrackerSparqlCursor*) _tmp25_, NULL, &_inner_error_);
#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 321 "tracker-statistics.c"
						}
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
						if (_tmp24_) {
#line 325 "tracker-statistics.c"
							TrackerClass* _tmp26_;
							TrackerDBCursor* _tmp27_;
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp26_ = cl;
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp27_ = stat_cursor;
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							tracker_class_set_count (_tmp26_, (gint) tracker_sparql_cursor_get_integer ((TrackerSparqlCursor*) _tmp27_, 0));
#line 334 "tracker-statistics.c"
						} else {
							TrackerClass* _tmp28_;
							const gchar* _tmp29_;
							const gchar* _tmp30_;
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp28_ = cl;
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp29_ = tracker_class_get_name (_tmp28_);
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							_tmp30_ = _tmp29_;
#line 47 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
							g_warning ("Unable to query instance count for class %s", _tmp30_);
#line 347 "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 353 "tracker-statistics.c"
					}
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
					_g_object_unref0 (cl);
#line 357 "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 365 "tracker-statistics.c"
	}
#line 55 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp31_ = g_variant_builder_new ((const GVariantType*) "aas");
#line 55 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	builder = _tmp31_;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp32_ = ontologies;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp34_ = tracker_ontologies_get_classes (_tmp32_, &_tmp33_);
#line 375 "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 = _tmp34_;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		cl_collection_length1 = _tmp33_;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
		for (cl_it = 0; cl_it < _tmp33_; cl_it = cl_it + 1) {
#line 387 "tracker-statistics.c"
			TrackerClass* _tmp35_;
			TrackerClass* cl = NULL;
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			_tmp35_ = _g_object_ref0 (cl_collection[cl_it]);
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
			cl = _tmp35_;
#line 394 "tracker-statistics.c"
			{
				TrackerClass* _tmp36_;
				gint _tmp37_;
				gint _tmp38_;
				GVariantBuilder* _tmp39_;
				GVariantBuilder* _tmp40_;
				TrackerClass* _tmp41_;
				const gchar* _tmp42_;
				const gchar* _tmp43_;
				GVariantBuilder* _tmp44_;
				TrackerClass* _tmp45_;
				gint _tmp46_;
				gint _tmp47_;
				gchar* _tmp48_;
				gchar* _tmp49_;
				GVariantBuilder* _tmp50_;
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp36_ = cl;
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp37_ = tracker_class_get_count (_tmp36_);
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp38_ = _tmp37_;
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				if (_tmp38_ == 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 423 "tracker-statistics.c"
				}
#line 63 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp39_ = builder;
#line 63 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_open (_tmp39_, (const GVariantType*) "as");
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp40_ = builder;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp41_ = cl;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp42_ = tracker_class_get_name (_tmp41_);
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp43_ = _tmp42_;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_add (_tmp40_, "s", _tmp43_, NULL);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp44_ = builder;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp45_ = cl;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp46_ = tracker_class_get_count (_tmp45_);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp47_ = _tmp46_;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp48_ = g_strdup_printf ("%i", _tmp47_);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp49_ = _tmp48_;
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_add (_tmp44_, "s", _tmp49_, NULL);
#line 65 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_g_free0 (_tmp49_);
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_tmp50_ = builder;
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				g_variant_builder_close (_tmp50_);
#line 57 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
				_g_object_unref0 (cl);
#line 461 "tracker-statistics.c"
			}
		}
	}
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp51_ = request;
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	tracker_dbus_request_end (_tmp51_, NULL);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp52_ = builder;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	_tmp53_ = g_variant_builder_end (_tmp52_);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	g_variant_ref_sink (_tmp53_);
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-store/tracker-statistics.vala"
	result = _tmp53_;
#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 485 "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 497 "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 506 "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 517 "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 535 "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);
}



