/* box-config.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from box-config.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include "common.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	BOXES_BOX_CONFIG_0_PROPERTY,
	BOXES_BOX_CONFIG_GROUP_PROPERTY,
	BOXES_BOX_CONFIG_LAST_SEEN_NAME_PROPERTY,
	BOXES_BOX_CONFIG_UUID_PROPERTY,
	BOXES_BOX_CONFIG_CATEGORIES_PROPERTY,
	BOXES_BOX_CONFIG_ACCESS_LAST_TIME_PROPERTY,
	BOXES_BOX_CONFIG_ACCESS_FIRST_TIME_PROPERTY,
	BOXES_BOX_CONFIG_ACCESS_TOTAL_TIME_PROPERTY,
	BOXES_BOX_CONFIG_ACCESS_NTIMES_PROPERTY,
	BOXES_BOX_CONFIG_NUM_PROPERTIES
};
static GParamSpec* boxes_box_config_properties[BOXES_BOX_CONFIG_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_param_spec_unref0(var) ((var == NULL) ? NULL : (var = (g_param_spec_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

struct _BoxesBoxConfigPrivate {
	BoxesCollectionSource* source;
	gchar* _group;
	gint64 _access_last_time;
	gint64 _access_first_time;
	gint64 _access_total_time;
	gint64 _access_ntimes;
	BoxesBoxConfigSavedProperty* access_properties;
	gint access_properties_length1;
	gint _access_properties_size_;
	gchar* filter_data;
};

struct _Block2Data {
	int _ref_count_;
	BoxesBoxConfig* self;
	GParamSpec* property;
};

static gint BoxesBoxConfig_private_offset;
static gpointer boxes_box_config_parent_class = NULL;
static BoxesIConfigIface * boxes_box_config_boxes_iconfig_parent_iface = NULL;

static void _vala_BoxesBoxConfigSavedProperty_array_free (BoxesBoxConfigSavedProperty * array,
                                                   gssize array_length);
static void boxes_box_config_set_group (BoxesBoxConfig* self,
                                 const gchar* value);
static void boxes_box_config_save_property (BoxesBoxConfig* self,
                                     GObject* object,
                                     const gchar* property_name);
static GParamSpec* boxes_box_config_load_property (BoxesBoxConfig* self,
                                            GObject* object,
                                            const gchar* property_name,
                                            GValue* default_value);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void ____lambda5_ (Block2Data* _data2_,
                   GObject* object,
                   GParamSpec* pspec);
static void _____lambda5__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void boxes_box_config_update_filter_data (BoxesBoxConfig* self);
static GObject * boxes_box_config_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static void boxes_box_config_finalize (GObject * obj);
static GType boxes_box_config_get_type_once (void);
static void _vala_boxes_box_config_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_boxes_box_config_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
boxes_box_config_get_instance_private (BoxesBoxConfig* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesBoxConfig_private_offset);
}

static void
_vala_BoxesBoxConfigSavedProperty_array_free (BoxesBoxConfigSavedProperty * array,
                                              gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			boxes_box_config_saved_property_destroy (&array[i]);
		}
	}
	g_free (array);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

BoxesBoxConfig*
boxes_box_config_construct_with_group (GType object_type,
                                       BoxesCollectionSource* source,
                                       const gchar* group)
{
	BoxesBoxConfig * self = NULL;
	BoxesCollectionSource* _tmp0_;
	BoxesBoxConfigSavedProperty* _tmp1_;
	gint _tmp1__length1;
	g_return_val_if_fail (source != NULL, NULL);
	g_return_val_if_fail (group != NULL, NULL);
	self = (BoxesBoxConfig*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (source);
	_g_object_unref0 (self->priv->source);
	self->priv->source = _tmp0_;
	g_warn_if_fail (g_str_has_prefix (group, "display"));
	boxes_box_config_set_group (self, group);
	_tmp1_ = self->priv->access_properties;
	_tmp1__length1 = self->priv->access_properties_length1;
	boxes_box_config_save_properties (self, (GObject*) self, _tmp1_, (gint) _tmp1__length1);
	return self;
}

BoxesBoxConfig*
boxes_box_config_new_with_group (BoxesCollectionSource* source,
                                 const gchar* group)
{
	return boxes_box_config_construct_with_group (BOXES_TYPE_BOX_CONFIG, source, group);
}

void
boxes_box_config_delete (BoxesBoxConfig* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GKeyFile* _tmp0_;
		GKeyFile* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = self->priv->_group;
		g_key_file_remove_group (_tmp1_, _tmp2_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	boxes_iconfig_save ((BoxesIConfig*) self);
}

static void
boxes_box_config_save_property (BoxesBoxConfig* self,
                                GObject* object,
                                const gchar* property_name)
{
	GValue value = {0};
	GObjectClass* _tmp0_;
	GParamSpec* _tmp1_;
	GValue _tmp2_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (property_name != NULL);
	_tmp0_ = G_OBJECT_GET_CLASS (object);
	_tmp1_ = g_object_class_find_property (_tmp0_, property_name);
	g_value_init (&_tmp2_, _tmp1_->value_type);
	value = _tmp2_;
	g_object_get_property (object, property_name, &value);
	if (G_VALUE_TYPE (&value) == G_TYPE_STRING) {
		GKeyFile* _tmp3_;
		GKeyFile* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp3_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
		_tmp4_ = _tmp3_;
		_tmp5_ = self->priv->_group;
		_tmp6_ = g_value_get_string (&value);
		g_key_file_set_string (_tmp4_, _tmp5_, property_name, _tmp6_);
	} else {
		if (G_VALUE_TYPE (&value) == G_TYPE_UINT64) {
			GKeyFile* _tmp7_;
			GKeyFile* _tmp8_;
			const gchar* _tmp9_;
			_tmp7_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp8_ = _tmp7_;
			_tmp9_ = self->priv->_group;
			g_key_file_set_uint64 (_tmp8_, _tmp9_, property_name, g_value_get_uint64 (&value));
		} else {
			if (G_VALUE_TYPE (&value) == G_TYPE_INT64) {
				GKeyFile* _tmp10_;
				GKeyFile* _tmp11_;
				const gchar* _tmp12_;
				_tmp10_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
				_tmp11_ = _tmp10_;
				_tmp12_ = self->priv->_group;
				g_key_file_set_int64 (_tmp11_, _tmp12_, property_name, g_value_get_int64 (&value));
			} else {
				if (G_VALUE_TYPE (&value) == G_TYPE_BOOLEAN) {
					GKeyFile* _tmp13_;
					GKeyFile* _tmp14_;
					const gchar* _tmp15_;
					_tmp13_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
					_tmp14_ = _tmp13_;
					_tmp15_ = self->priv->_group;
					g_key_file_set_boolean (_tmp14_, _tmp15_, property_name, g_value_get_boolean (&value));
				} else {
					gchar* _tmp16_;
					gchar* _tmp17_;
					gchar* _tmp18_;
					gchar* _tmp19_;
					_tmp16_ = g_strdup_value_contents (&value);
					_tmp17_ = _tmp16_;
					_tmp18_ = g_strdup_printf ("unhandled property %s type, value: %s", property_name, _tmp17_);
					_tmp19_ = _tmp18_;
					g_warning ("box-config.vala:87: %s", _tmp19_);
					_g_free0 (_tmp19_);
					_g_free0 (_tmp17_);
				}
			}
		}
	}
	boxes_iconfig_save ((BoxesIConfig*) self);
	G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
}

static gpointer
_g_param_spec_ref0 (gpointer self)
{
	return self ? g_param_spec_ref (self) : NULL;
}

static GParamSpec*
boxes_box_config_load_property (BoxesBoxConfig* self,
                                GObject* object,
                                const gchar* property_name,
                                GValue* default_value)
{
	GParamSpec* property = NULL;
	GObjectClass* _tmp0_;
	GParamSpec* _tmp1_;
	GParamSpec* _tmp2_;
	GParamSpec* _tmp3_;
	GValue value = {0};
	GParamSpec* _tmp4_;
	GValue _tmp5_ = {0};
	GValue _tmp31_;
	GError* _inner_error0_ = NULL;
	GParamSpec* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (object != NULL, NULL);
	g_return_val_if_fail (property_name != NULL, NULL);
	g_return_val_if_fail (default_value != NULL, NULL);
	_tmp0_ = G_OBJECT_GET_CLASS (object);
	_tmp1_ = g_object_class_find_property (_tmp0_, property_name);
	_tmp2_ = _g_param_spec_ref0 (_tmp1_);
	property = _tmp2_;
	_tmp3_ = property;
	if (_tmp3_ == NULL) {
		g_debug ("box-config.vala:96: You forgot the property '%s' needs to have public " \
"getter!", property_name);
		result = NULL;
		_g_param_spec_unref0 (property);
		return result;
	}
	_tmp4_ = property;
	g_value_init (&_tmp5_, _tmp4_->value_type);
	value = _tmp5_;
	{
		if (G_VALUE_TYPE (&value) == G_TYPE_STRING) {
			gchar* _tmp6_ = NULL;
			GKeyFile* _tmp7_;
			GKeyFile* _tmp8_;
			const gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			GValue _tmp12_ = {0};
			_tmp7_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp8_ = _tmp7_;
			_tmp9_ = self->priv->_group;
			_tmp10_ = g_key_file_get_string (_tmp8_, _tmp9_, property_name, &_inner_error0_);
			_tmp6_ = _tmp10_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp11_ = _tmp6_;
			_tmp6_ = NULL;
			g_value_init (&_tmp12_, G_TYPE_STRING);
			g_value_take_string (&_tmp12_, _tmp11_);
			G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			value = _tmp12_;
			_g_free0 (_tmp6_);
		}
		if (G_VALUE_TYPE (&value) == G_TYPE_UINT64) {
			guint64 _tmp13_ = 0ULL;
			GKeyFile* _tmp14_;
			GKeyFile* _tmp15_;
			const gchar* _tmp16_;
			GValue _tmp17_ = {0};
			_tmp14_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp15_ = _tmp14_;
			_tmp16_ = self->priv->_group;
			_tmp13_ = g_key_file_get_uint64 (_tmp15_, _tmp16_, property_name, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			g_value_init (&_tmp17_, G_TYPE_UINT64);
			g_value_set_uint64 (&_tmp17_, _tmp13_);
			G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			value = _tmp17_;
		}
		if (G_VALUE_TYPE (&value) == G_TYPE_INT64) {
			gint64 _tmp18_ = 0LL;
			GKeyFile* _tmp19_;
			GKeyFile* _tmp20_;
			const gchar* _tmp21_;
			GValue _tmp22_ = {0};
			_tmp19_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp20_ = _tmp19_;
			_tmp21_ = self->priv->_group;
			_tmp18_ = g_key_file_get_int64 (_tmp20_, _tmp21_, property_name, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			g_value_init (&_tmp22_, G_TYPE_INT64);
			g_value_set_int64 (&_tmp22_, _tmp18_);
			G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			value = _tmp22_;
		}
		if (G_VALUE_TYPE (&value) == G_TYPE_BOOLEAN) {
			gboolean _tmp23_ = FALSE;
			GKeyFile* _tmp24_;
			GKeyFile* _tmp25_;
			const gchar* _tmp26_;
			GValue _tmp27_ = {0};
			_tmp24_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
			_tmp25_ = _tmp24_;
			_tmp26_ = self->priv->_group;
			_tmp23_ = g_key_file_get_boolean (_tmp25_, _tmp26_, property_name, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			g_value_init (&_tmp27_, G_TYPE_BOOLEAN);
			g_value_set_boolean (&_tmp27_, _tmp23_);
			G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			value = _tmp27_;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GValue _tmp28_;
		GValue _tmp29_;
		GValue _tmp30_ = {0};
		g_clear_error (&_inner_error0_);
		_tmp28_ = *default_value;
		_tmp29_ = _tmp28_;
		if (G_IS_VALUE (&_tmp29_)) {
			g_value_init (&_tmp30_, G_VALUE_TYPE (&_tmp29_));
			g_value_copy (&_tmp29_, &_tmp30_);
		} else {
			_tmp30_ = _tmp29_;
		}
		G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
		value = _tmp30_;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
		_g_param_spec_unref0 (property);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp31_ = value;
	g_object_set_property (object, property_name, &_tmp31_);
	result = property;
	G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
	return result;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		BoxesBoxConfig* self;
		self = _data2_->self;
		_g_param_spec_unref0 (_data2_->property);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
____lambda5_ (Block2Data* _data2_,
              GObject* object,
              GParamSpec* pspec)
{
	BoxesBoxConfig* self;
	const gchar* _tmp0_;
	GParamSpec* _tmp1_;
	const gchar* _tmp2_;
	self = _data2_->self;
	g_return_if_fail (object != NULL);
	g_return_if_fail (pspec != NULL);
	_tmp0_ = pspec->name;
	_tmp1_ = _data2_->property;
	_tmp2_ = _tmp1_->name;
	if (g_strcmp0 (_tmp0_, _tmp2_) == 0) {
		const gchar* _tmp3_;
		_tmp3_ = pspec->name;
		boxes_box_config_save_property (self, object, _tmp3_);
	}
}

static void
_____lambda5__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	____lambda5_ (self, _sender, pspec);
}

void
boxes_box_config_save_properties (BoxesBoxConfig* self,
                                  GObject* object,
                                  BoxesBoxConfigSavedProperty* properties,
                                  gint properties_length1)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	{
		BoxesBoxConfigSavedProperty* prop_collection = NULL;
		gint prop_collection_length1 = 0;
		gint _prop_collection_size_ = 0;
		gint prop_it = 0;
		prop_collection = properties;
		prop_collection_length1 = properties_length1;
		for (prop_it = 0; prop_it < prop_collection_length1; prop_it = prop_it + 1) {
			BoxesBoxConfigSavedProperty _tmp0_;
			BoxesBoxConfigSavedProperty _tmp1_ = {0};
			BoxesBoxConfigSavedProperty prop = {0};
			_tmp0_ = prop_collection[prop_it];
			boxes_box_config_saved_property_copy (&_tmp0_, &_tmp1_);
			prop = _tmp1_;
			{
				Block2Data* _data2_;
				BoxesBoxConfigSavedProperty _tmp2_;
				const gchar* _tmp3_;
				BoxesBoxConfigSavedProperty _tmp4_;
				GValue _tmp5_;
				GParamSpec* _tmp6_;
				GParamSpec* _tmp7_;
				_data2_ = g_slice_new0 (Block2Data);
				_data2_->_ref_count_ = 1;
				_data2_->self = g_object_ref (self);
				_tmp2_ = prop;
				_tmp3_ = _tmp2_.name;
				_tmp4_ = prop;
				_tmp5_ = _tmp4_.default_value;
				_tmp6_ = boxes_box_config_load_property (self, object, _tmp3_, &_tmp5_);
				_data2_->property = _tmp6_;
				_tmp7_ = _data2_->property;
				if (_tmp7_ == NULL) {
					boxes_box_config_saved_property_destroy (&prop);
					block2_data_unref (_data2_);
					_data2_ = NULL;
					return;
				}
				g_signal_connect_data (object, "notify", (GCallback) _____lambda5__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
				boxes_box_config_saved_property_destroy (&prop);
				block2_data_unref (_data2_);
				_data2_ = NULL;
			}
		}
	}
}

static void
boxes_box_config_update_filter_data (BoxesBoxConfig* self)
{
	GString* builder = NULL;
	GString* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	GString* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_string_new ("");
	builder = _tmp0_;
	_tmp1_ = boxes_box_config_get_last_seen_name (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ != NULL;
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		GString* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		GString* _tmp11_;
		_tmp5_ = builder;
		_tmp6_ = boxes_box_config_get_last_seen_name (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = boxes_canonicalize_for_search (_tmp8_);
		_tmp10_ = _tmp9_;
		g_string_append (_tmp5_, _tmp10_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp8_);
		_tmp11_ = builder;
		g_string_append_unichar (_tmp11_, (gunichar) ' ');
	}
	_tmp12_ = builder;
	_tmp13_ = _tmp12_->str;
	_tmp14_ = g_strdup (_tmp13_);
	_g_free0 (self->priv->filter_data);
	self->priv->filter_data = _tmp14_;
	_g_string_free0 (builder);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

gboolean
boxes_box_config_contains_strings (BoxesBoxConfig* self,
                                   gchar** strings,
                                   gint strings_length1)
{
	const gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->filter_data;
	if (_tmp0_ == NULL) {
		boxes_box_config_update_filter_data (self);
	}
	{
		gchar** i_collection = NULL;
		gint i_collection_length1 = 0;
		gint _i_collection_size_ = 0;
		gint i_it = 0;
		i_collection = strings;
		i_collection_length1 = strings_length1;
		for (i_it = 0; i_it < i_collection_length1; i_it = i_it + 1) {
			gchar* _tmp1_;
			gchar* i = NULL;
			_tmp1_ = g_strdup (i_collection[i_it]);
			i = _tmp1_;
			{
				const gchar* _tmp2_;
				const gchar* _tmp3_;
				_tmp2_ = self->priv->filter_data;
				_tmp3_ = i;
				if (!string_contains (_tmp2_, _tmp3_)) {
					result = FALSE;
					_g_free0 (i);
					return result;
				}
				_g_free0 (i);
			}
		}
	}
	result = TRUE;
	return result;
}

gint
boxes_box_config_compare (BoxesBoxConfig* self,
                          BoxesBoxConfig* other)
{
	gboolean _tmp0_ = FALSE;
	gint64 _tmp1_;
	gchar* name = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* other_name = NULL;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (other != NULL, 0);
	_tmp1_ = self->priv->_access_last_time;
	if (_tmp1_ > ((gint64) 0)) {
		_tmp0_ = TRUE;
	} else {
		gint64 _tmp2_;
		_tmp2_ = other->priv->_access_last_time;
		_tmp0_ = _tmp2_ > ((gint64) 0);
	}
	if (_tmp0_) {
		gint64 _tmp3_;
		gint64 _tmp4_;
		_tmp3_ = self->priv->_access_last_time;
		_tmp4_ = other->priv->_access_last_time;
		if (_tmp3_ > _tmp4_) {
			result = -1;
			return result;
		} else {
			gint64 _tmp5_;
			gint64 _tmp6_;
			_tmp5_ = self->priv->_access_last_time;
			_tmp6_ = other->priv->_access_last_time;
			if (_tmp5_ < _tmp6_) {
				result = 1;
				return result;
			}
		}
	}
	_tmp7_ = boxes_box_config_get_last_seen_name (self);
	_tmp8_ = _tmp7_;
	name = _tmp8_;
	_tmp9_ = boxes_box_config_get_last_seen_name (other);
	_tmp10_ = _tmp9_;
	other_name = _tmp10_;
	_tmp12_ = name;
	if (boxes_is_set (_tmp12_)) {
		const gchar* _tmp13_;
		_tmp13_ = other_name;
		_tmp11_ = boxes_is_set (_tmp13_);
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		_tmp14_ = name;
		_tmp15_ = other_name;
		result = g_utf8_collate (_tmp14_, _tmp15_);
		_g_free0 (other_name);
		_g_free0 (name);
		return result;
	}
	_tmp16_ = name;
	if (boxes_is_set (_tmp16_)) {
		result = -1;
		_g_free0 (other_name);
		_g_free0 (name);
		return result;
	}
	_tmp17_ = other_name;
	if (boxes_is_set (_tmp17_)) {
		result = 1;
		_g_free0 (other_name);
		_g_free0 (name);
		return result;
	}
	result = 0;
	_g_free0 (other_name);
	_g_free0 (name);
	return result;
}

BoxesBoxConfig*
boxes_box_config_construct (GType object_type)
{
	BoxesBoxConfig * self = NULL;
	self = (BoxesBoxConfig*) g_object_new (object_type, NULL);
	return self;
}

BoxesBoxConfig*
boxes_box_config_new (void)
{
	return boxes_box_config_construct (BOXES_TYPE_BOX_CONFIG);
}

static gboolean
boxes_box_config_real_get_has_file (BoxesIConfig* base)
{
	gboolean result;
	BoxesBoxConfig* self;
	BoxesCollectionSource* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = (BoxesBoxConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = boxes_iconfig_get_has_file ((BoxesIConfig*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
boxes_box_config_real_set_has_file (BoxesIConfig* base,
                                    gboolean value)
{
	BoxesBoxConfig* self;
	BoxesCollectionSource* _tmp0_;
	self = (BoxesBoxConfig*) base;
	_tmp0_ = self->priv->source;
	boxes_iconfig_set_has_file ((BoxesIConfig*) _tmp0_, value);
}

static const gchar*
boxes_box_config_real_get_filename (BoxesIConfig* base)
{
	const gchar* result;
	BoxesBoxConfig* self;
	BoxesCollectionSource* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (BoxesBoxConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = boxes_iconfig_get_filename ((BoxesIConfig*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
boxes_box_config_real_set_filename (BoxesIConfig* base,
                                    const gchar* value)
{
	BoxesBoxConfig* self;
	self = (BoxesBoxConfig*) base;
	g_warning ("box-config.vala:17: not allowed to change filename");
}

static GKeyFile*
boxes_box_config_real_get_keyfile (BoxesIConfig* base)
{
	GKeyFile* result;
	BoxesBoxConfig* self;
	BoxesCollectionSource* _tmp0_;
	GKeyFile* _tmp1_;
	GKeyFile* _tmp2_;
	self = (BoxesBoxConfig*) base;
	_tmp0_ = self->priv->source;
	_tmp1_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

const gchar*
boxes_box_config_get_group (BoxesBoxConfig* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	result = _tmp0_;
	return result;
}

static void
boxes_box_config_set_group (BoxesBoxConfig* self,
                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_box_config_get_group (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_group);
		self->priv->_group = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_GROUP_PROPERTY]);
	}
}

gchar*
boxes_box_config_get_last_seen_name (BoxesBoxConfig* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	_tmp1_ = boxes_iconfig_get_string ((BoxesIConfig*) self, _tmp0_, "last-seen-name");
	result = _tmp1_;
	return result;
}

void
boxes_box_config_set_last_seen_name (BoxesBoxConfig* self,
                                     const gchar* value)
{
	GKeyFile* _tmp0_;
	GKeyFile* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_group;
	g_key_file_set_string (_tmp1_, _tmp2_, "last-seen-name", value);
	g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_LAST_SEEN_NAME_PROPERTY]);
}

gchar*
boxes_box_config_get_uuid (BoxesBoxConfig* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	_tmp1_ = boxes_iconfig_get_string ((BoxesIConfig*) self, _tmp0_, "uuid");
	result = _tmp1_;
	return result;
}

void
boxes_box_config_set_uuid (BoxesBoxConfig* self,
                           const gchar* value)
{
	GKeyFile* _tmp0_;
	GKeyFile* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_group;
	g_key_file_set_string (_tmp1_, _tmp2_, "uuid", value);
	g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_UUID_PROPERTY]);
}

gchar**
boxes_box_config_get_categories (BoxesBoxConfig* self,
                                 gint* result_length1)
{
	gchar** result;
	const gchar* _tmp0_;
	gint _tmp1_ = 0;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	_tmp2_ = boxes_iconfig_get_string_list ((BoxesIConfig*) self, _tmp0_, "categories", &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}

void
boxes_box_config_set_categories (BoxesBoxConfig* self,
                                 gchar** value,
                                 gint value_length1)
{
	GKeyFile* _tmp0_;
	GKeyFile* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_iconfig_get_keyfile ((BoxesIConfig*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_group;
	g_key_file_set_string_list (_tmp1_, _tmp2_, "categories", (const gchar* const*) value, (gint) value_length1);
	g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_CATEGORIES_PROPERTY]);
}

gint64
boxes_box_config_get_access_last_time (BoxesBoxConfig* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_access_last_time;
	return result;
}

void
boxes_box_config_set_access_last_time (BoxesBoxConfig* self,
                                       gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_box_config_get_access_last_time (self);
	if (old_value != value) {
		self->priv->_access_last_time = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_LAST_TIME_PROPERTY]);
	}
}

gint64
boxes_box_config_get_access_first_time (BoxesBoxConfig* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_access_first_time;
	return result;
}

void
boxes_box_config_set_access_first_time (BoxesBoxConfig* self,
                                        gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_box_config_get_access_first_time (self);
	if (old_value != value) {
		self->priv->_access_first_time = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_FIRST_TIME_PROPERTY]);
	}
}

gint64
boxes_box_config_get_access_total_time (BoxesBoxConfig* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_access_total_time;
	return result;
}

void
boxes_box_config_set_access_total_time (BoxesBoxConfig* self,
                                        gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_box_config_get_access_total_time (self);
	if (old_value != value) {
		self->priv->_access_total_time = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_TOTAL_TIME_PROPERTY]);
	}
}

gint64
boxes_box_config_get_access_ntimes (BoxesBoxConfig* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_access_ntimes;
	return result;
}

void
boxes_box_config_set_access_ntimes (BoxesBoxConfig* self,
                                    gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_box_config_get_access_ntimes (self);
	if (old_value != value) {
		self->priv->_access_ntimes = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_NTIMES_PROPERTY]);
	}
}

void
boxes_box_config_saved_property_copy (const BoxesBoxConfigSavedProperty* self,
                                      BoxesBoxConfigSavedProperty* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GValue _tmp2_;
	GValue _tmp3_;
	GValue _tmp4_ = {0};
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	_tmp2_ = (*self).default_value;
	_tmp3_ = _tmp2_;
	if (G_IS_VALUE (&_tmp3_)) {
		g_value_init (&_tmp4_, G_VALUE_TYPE (&_tmp3_));
		g_value_copy (&_tmp3_, &_tmp4_);
	} else {
		_tmp4_ = _tmp3_;
	}
	G_IS_VALUE (&(*dest).default_value) ? (g_value_unset (&(*dest).default_value), NULL) : NULL;
	(*dest).default_value = _tmp4_;
}

void
boxes_box_config_saved_property_destroy (BoxesBoxConfigSavedProperty* self)
{
	_g_free0 ((*self).name);
	G_IS_VALUE (&(*self).default_value) ? (g_value_unset (&(*self).default_value), NULL) : NULL;
}

BoxesBoxConfigSavedProperty*
boxes_box_config_saved_property_dup (const BoxesBoxConfigSavedProperty* self)
{
	BoxesBoxConfigSavedProperty* dup;
	dup = g_new0 (BoxesBoxConfigSavedProperty, 1);
	boxes_box_config_saved_property_copy (self, dup);
	return dup;
}

void
boxes_box_config_saved_property_free (BoxesBoxConfigSavedProperty* self)
{
	boxes_box_config_saved_property_destroy (self);
	g_free (self);
}

static GType
boxes_box_config_saved_property_get_type_once (void)
{
	GType boxes_box_config_saved_property_type_id;
	boxes_box_config_saved_property_type_id = g_boxed_type_register_static ("BoxesBoxConfigSavedProperty", (GBoxedCopyFunc) boxes_box_config_saved_property_dup, (GBoxedFreeFunc) boxes_box_config_saved_property_free);
	return boxes_box_config_saved_property_type_id;
}

GType
boxes_box_config_saved_property_get_type (void)
{
	static volatile gsize boxes_box_config_saved_property_type_id__once = 0;
	if (g_once_init_enter (&boxes_box_config_saved_property_type_id__once)) {
		GType boxes_box_config_saved_property_type_id;
		boxes_box_config_saved_property_type_id = boxes_box_config_saved_property_get_type_once ();
		g_once_init_leave (&boxes_box_config_saved_property_type_id__once, boxes_box_config_saved_property_type_id);
	}
	return boxes_box_config_saved_property_type_id__once;
}

static GObject *
boxes_box_config_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BoxesBoxConfig * self;
	gchar* _tmp0_;
	GValue _tmp1_ = {0};
	BoxesBoxConfigSavedProperty _tmp2_ = {0};
	gchar* _tmp3_;
	GValue _tmp4_ = {0};
	BoxesBoxConfigSavedProperty _tmp5_ = {0};
	gchar* _tmp6_;
	GValue _tmp7_ = {0};
	BoxesBoxConfigSavedProperty _tmp8_ = {0};
	gchar* _tmp9_;
	GValue _tmp10_ = {0};
	BoxesBoxConfigSavedProperty _tmp11_ = {0};
	BoxesBoxConfigSavedProperty* _tmp12_;
	parent_class = G_OBJECT_CLASS (boxes_box_config_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_BOX_CONFIG, BoxesBoxConfig);
	_tmp0_ = g_strdup ("access-last-time");
	g_value_init (&_tmp1_, G_TYPE_INT64);
	g_value_set_int64 (&_tmp1_, (gint64) -1);
	memset (&_tmp2_, 0, sizeof (BoxesBoxConfigSavedProperty));
	_g_free0 (_tmp2_.name);
	_tmp2_.name = _tmp0_;
	G_IS_VALUE (&_tmp2_.default_value) ? (g_value_unset (&_tmp2_.default_value), NULL) : NULL;
	_tmp2_.default_value = _tmp1_;
	_tmp3_ = g_strdup ("access-first-time");
	g_value_init (&_tmp4_, G_TYPE_INT64);
	g_value_set_int64 (&_tmp4_, (gint64) -1);
	memset (&_tmp5_, 0, sizeof (BoxesBoxConfigSavedProperty));
	_g_free0 (_tmp5_.name);
	_tmp5_.name = _tmp3_;
	G_IS_VALUE (&_tmp5_.default_value) ? (g_value_unset (&_tmp5_.default_value), NULL) : NULL;
	_tmp5_.default_value = _tmp4_;
	_tmp6_ = g_strdup ("access-total-time");
	g_value_init (&_tmp7_, G_TYPE_INT64);
	g_value_set_int64 (&_tmp7_, (gint64) -1);
	memset (&_tmp8_, 0, sizeof (BoxesBoxConfigSavedProperty));
	_g_free0 (_tmp8_.name);
	_tmp8_.name = _tmp6_;
	G_IS_VALUE (&_tmp8_.default_value) ? (g_value_unset (&_tmp8_.default_value), NULL) : NULL;
	_tmp8_.default_value = _tmp7_;
	_tmp9_ = g_strdup ("access-ntimes");
	g_value_init (&_tmp10_, G_TYPE_UINT64);
	g_value_set_uint64 (&_tmp10_, (guint64) 0);
	memset (&_tmp11_, 0, sizeof (BoxesBoxConfigSavedProperty));
	_g_free0 (_tmp11_.name);
	_tmp11_.name = _tmp9_;
	G_IS_VALUE (&_tmp11_.default_value) ? (g_value_unset (&_tmp11_.default_value), NULL) : NULL;
	_tmp11_.default_value = _tmp10_;
	_tmp12_ = g_new0 (BoxesBoxConfigSavedProperty, 4);
	_tmp12_[0] = _tmp2_;
	_tmp12_[1] = _tmp5_;
	_tmp12_[2] = _tmp8_;
	_tmp12_[3] = _tmp11_;
	self->priv->access_properties = (_vala_BoxesBoxConfigSavedProperty_array_free (self->priv->access_properties, self->priv->access_properties_length1), NULL);
	self->priv->access_properties = _tmp12_;
	self->priv->access_properties_length1 = 4;
	self->priv->_access_properties_size_ = self->priv->access_properties_length1;
	return obj;
}

static void
boxes_box_config_class_init (BoxesBoxConfigClass * klass,
                             gpointer klass_data)
{
	boxes_box_config_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesBoxConfig_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_box_config_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_box_config_set_property;
	G_OBJECT_CLASS (klass)->constructor = boxes_box_config_constructor;
	G_OBJECT_CLASS (klass)->finalize = boxes_box_config_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_GROUP_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_GROUP_PROPERTY] = g_param_spec_string ("group", "group", "group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_LAST_SEEN_NAME_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_LAST_SEEN_NAME_PROPERTY] = g_param_spec_string ("last-seen-name", "last-seen-name", "last-seen-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_UUID_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_UUID_PROPERTY] = g_param_spec_string ("uuid", "uuid", "uuid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_CATEGORIES_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_CATEGORIES_PROPERTY] = g_param_spec_boxed ("categories", "categories", "categories", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_ACCESS_LAST_TIME_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_LAST_TIME_PROPERTY] = g_param_spec_int64 ("access-last-time", "access-last-time", "access-last-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_ACCESS_FIRST_TIME_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_FIRST_TIME_PROPERTY] = g_param_spec_int64 ("access-first-time", "access-first-time", "access-first-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_ACCESS_TOTAL_TIME_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_TOTAL_TIME_PROPERTY] = g_param_spec_int64 ("access-total-time", "access-total-time", "access-total-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_BOX_CONFIG_ACCESS_NTIMES_PROPERTY, boxes_box_config_properties[BOXES_BOX_CONFIG_ACCESS_NTIMES_PROPERTY] = g_param_spec_int64 ("access-ntimes", "access-ntimes", "access-ntimes", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
boxes_box_config_boxes_iconfig_interface_init (BoxesIConfigIface * iface,
                                               gpointer iface_data)
{
	boxes_box_config_boxes_iconfig_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_has_file = boxes_box_config_real_get_has_file;
	iface->set_has_file = boxes_box_config_real_set_has_file;
	iface->get_filename = boxes_box_config_real_get_filename;
	iface->set_filename = boxes_box_config_real_set_filename;
	iface->get_keyfile = boxes_box_config_real_get_keyfile;
}

static void
boxes_box_config_instance_init (BoxesBoxConfig * self,
                                gpointer klass)
{
	self->priv = boxes_box_config_get_instance_private (self);
}

static void
boxes_box_config_finalize (GObject * obj)
{
	BoxesBoxConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_BOX_CONFIG, BoxesBoxConfig);
	_g_object_unref0 (self->priv->source);
	_g_free0 (self->priv->_group);
	self->priv->access_properties = (_vala_BoxesBoxConfigSavedProperty_array_free (self->priv->access_properties, self->priv->access_properties_length1), NULL);
	_g_free0 (self->priv->filter_data);
	G_OBJECT_CLASS (boxes_box_config_parent_class)->finalize (obj);
}

static GType
boxes_box_config_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesBoxConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_box_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesBoxConfig), 0, (GInstanceInitFunc) boxes_box_config_instance_init, NULL };
	static const GInterfaceInfo boxes_iconfig_info = { (GInterfaceInitFunc) boxes_box_config_boxes_iconfig_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType boxes_box_config_type_id;
	boxes_box_config_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesBoxConfig", &g_define_type_info, 0);
	g_type_add_interface_static (boxes_box_config_type_id, BOXES_TYPE_ICONFIG, &boxes_iconfig_info);
	BoxesBoxConfig_private_offset = g_type_add_instance_private (boxes_box_config_type_id, sizeof (BoxesBoxConfigPrivate));
	return boxes_box_config_type_id;
}

GType
boxes_box_config_get_type (void)
{
	static volatile gsize boxes_box_config_type_id__once = 0;
	if (g_once_init_enter (&boxes_box_config_type_id__once)) {
		GType boxes_box_config_type_id;
		boxes_box_config_type_id = boxes_box_config_get_type_once ();
		g_once_init_leave (&boxes_box_config_type_id__once, boxes_box_config_type_id);
	}
	return boxes_box_config_type_id__once;
}

static void
_vala_boxes_box_config_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	BoxesBoxConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_BOX_CONFIG, BoxesBoxConfig);
	switch (property_id) {
		case BOXES_BOX_CONFIG_GROUP_PROPERTY:
		g_value_set_string (value, boxes_box_config_get_group (self));
		break;
		case BOXES_BOX_CONFIG_LAST_SEEN_NAME_PROPERTY:
		g_value_take_string (value, boxes_box_config_get_last_seen_name (self));
		break;
		case BOXES_BOX_CONFIG_UUID_PROPERTY:
		g_value_take_string (value, boxes_box_config_get_uuid (self));
		break;
		case BOXES_BOX_CONFIG_CATEGORIES_PROPERTY:
		{
			int length;
			g_value_take_boxed (value, boxes_box_config_get_categories (self, &length));
		}
		break;
		case BOXES_BOX_CONFIG_ACCESS_LAST_TIME_PROPERTY:
		g_value_set_int64 (value, boxes_box_config_get_access_last_time (self));
		break;
		case BOXES_BOX_CONFIG_ACCESS_FIRST_TIME_PROPERTY:
		g_value_set_int64 (value, boxes_box_config_get_access_first_time (self));
		break;
		case BOXES_BOX_CONFIG_ACCESS_TOTAL_TIME_PROPERTY:
		g_value_set_int64 (value, boxes_box_config_get_access_total_time (self));
		break;
		case BOXES_BOX_CONFIG_ACCESS_NTIMES_PROPERTY:
		g_value_set_int64 (value, boxes_box_config_get_access_ntimes (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_boxes_box_config_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	BoxesBoxConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_BOX_CONFIG, BoxesBoxConfig);
	switch (property_id) {
		case BOXES_BOX_CONFIG_GROUP_PROPERTY:
		boxes_box_config_set_group (self, g_value_get_string (value));
		break;
		case BOXES_BOX_CONFIG_LAST_SEEN_NAME_PROPERTY:
		boxes_box_config_set_last_seen_name (self, g_value_get_string (value));
		break;
		case BOXES_BOX_CONFIG_UUID_PROPERTY:
		boxes_box_config_set_uuid (self, g_value_get_string (value));
		break;
		case BOXES_BOX_CONFIG_CATEGORIES_PROPERTY:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			boxes_box_config_set_categories (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case BOXES_BOX_CONFIG_ACCESS_LAST_TIME_PROPERTY:
		boxes_box_config_set_access_last_time (self, g_value_get_int64 (value));
		break;
		case BOXES_BOX_CONFIG_ACCESS_FIRST_TIME_PROPERTY:
		boxes_box_config_set_access_first_time (self, g_value_get_int64 (value));
		break;
		case BOXES_BOX_CONFIG_ACCESS_TOTAL_TIME_PROPERTY:
		boxes_box_config_set_access_total_time (self, g_value_get_int64 (value));
		break;
		case BOXES_BOX_CONFIG_ACCESS_NTIMES_PROPERTY:
		boxes_box_config_set_access_ntimes (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

