/* rygel-user-config.c generated by valac 0.17.2.19-5f50d, the Vala compiler
 * generated from rygel-user-config.vala, do not modify */

/*
 * Copyright (C) 2008,2009 Nokia Corporation.
 * Copyright (C) 2008,2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; 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 <stdlib.h>
#include <string.h>
#include <gee.h>
#include <config.h>
#include <glib/gi18n-lib.h>


#define RYGEL_TYPE_CONFIGURATION (rygel_configuration_get_type ())
#define RYGEL_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_CONFIGURATION, RygelConfiguration))
#define RYGEL_IS_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_CONFIGURATION))
#define RYGEL_CONFIGURATION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_TYPE_CONFIGURATION, RygelConfigurationIface))

typedef struct _RygelConfiguration RygelConfiguration;
typedef struct _RygelConfigurationIface RygelConfigurationIface;

#define RYGEL_TYPE_USER_CONFIG (rygel_user_config_get_type ())
#define RYGEL_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_USER_CONFIG, RygelUserConfig))
#define RYGEL_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_USER_CONFIG, RygelUserConfigClass))
#define RYGEL_IS_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_USER_CONFIG))
#define RYGEL_IS_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_USER_CONFIG))
#define RYGEL_USER_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_USER_CONFIG, RygelUserConfigClass))

typedef struct _RygelUserConfig RygelUserConfig;
typedef struct _RygelUserConfigClass RygelUserConfigClass;
typedef struct _RygelUserConfigPrivate RygelUserConfigPrivate;
#define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _RygelConfigurationIface {
	GTypeInterface parent_iface;
	gboolean (*get_upnp_enabled) (RygelConfiguration* self, GError** error);
	gchar* (*get_interface) (RygelConfiguration* self, GError** error);
	gint (*get_port) (RygelConfiguration* self, GError** error);
	gboolean (*get_transcoding) (RygelConfiguration* self, GError** error);
	gboolean (*get_mp3_transcoder) (RygelConfiguration* self, GError** error);
	gboolean (*get_mp2ts_transcoder) (RygelConfiguration* self, GError** error);
	gboolean (*get_lpcm_transcoder) (RygelConfiguration* self, GError** error);
	gboolean (*get_wmv_transcoder) (RygelConfiguration* self, GError** error);
	gboolean (*get_aac_transcoder) (RygelConfiguration* self, GError** error);
	gboolean (*get_avc_transcoder) (RygelConfiguration* self, GError** error);
	gboolean (*get_allow_upload) (RygelConfiguration* self, GError** error);
	gboolean (*get_allow_deletion) (RygelConfiguration* self, GError** error);
	gchar* (*get_log_levels) (RygelConfiguration* self, GError** error);
	gchar* (*get_plugin_path) (RygelConfiguration* self, GError** error);
	gchar* (*get_video_upload_folder) (RygelConfiguration* self, GError** error);
	gchar* (*get_music_upload_folder) (RygelConfiguration* self, GError** error);
	gchar* (*get_picture_upload_folder) (RygelConfiguration* self, GError** error);
	gboolean (*get_enabled) (RygelConfiguration* self, const gchar* section, GError** error);
	gchar* (*get_title) (RygelConfiguration* self, const gchar* section, GError** error);
	gchar* (*get_string) (RygelConfiguration* self, const gchar* section, const gchar* key, GError** error);
	GeeArrayList* (*get_string_list) (RygelConfiguration* self, const gchar* section, const gchar* key, GError** error);
	gint (*get_int) (RygelConfiguration* self, const gchar* section, const gchar* key, gint min, gint max, GError** error);
	GeeArrayList* (*get_int_list) (RygelConfiguration* self, const gchar* section, const gchar* key, GError** error);
	gboolean (*get_bool) (RygelConfiguration* self, const gchar* section, const gchar* key, GError** error);
};

struct _RygelUserConfig {
	GObject parent_instance;
	RygelUserConfigPrivate * priv;
	GKeyFile* key_file;
	GKeyFile* sys_key_file;
};

struct _RygelUserConfigClass {
	GObjectClass parent_class;
};

typedef enum  {
	RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET,
	RYGEL_CONFIGURATION_ERROR_VALUE_OUT_OF_RANGE
} RygelConfigurationError;
#define RYGEL_CONFIGURATION_ERROR rygel_configuration_error_quark ()

static gpointer rygel_user_config_parent_class = NULL;
static RygelUserConfig* rygel_user_config_config;
static RygelUserConfig* rygel_user_config_config = NULL;
static RygelConfigurationIface* rygel_user_config_rygel_configuration_parent_iface = NULL;

GType rygel_configuration_get_type (void) G_GNUC_CONST;
GType rygel_user_config_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_USER_CONFIG_DUMMY_PROPERTY
};
#define RYGEL_USER_CONFIG_CONFIG_FILE "rygel.conf"
#define RYGEL_USER_CONFIG_IFACE_KEY "interface"
#define RYGEL_USER_CONFIG_PORT_KEY "port"
#define RYGEL_USER_CONFIG_ENABLED_KEY "enabled"
#define RYGEL_USER_CONFIG_UPNP_ENABLED_KEY "upnp-" RYGEL_USER_CONFIG_ENABLED_KEY
#define RYGEL_USER_CONFIG_TITLE_KEY "title"
#define RYGEL_USER_CONFIG_TRANSCODING_KEY "enable-transcoding"
#define RYGEL_USER_CONFIG_MP3_TRANSCODER_KEY "enable-mp3-transcoder"
#define RYGEL_USER_CONFIG_MP2TS_TRANSCODER_KEY "enable-mp2ts-transcoder"
#define RYGEL_USER_CONFIG_LPCM_TRANSCODER_KEY "enable-lpcm-transcoder"
#define RYGEL_USER_CONFIG_WMV_TRANSCODER_KEY "enable-wmv-transcoder"
#define RYGEL_USER_CONFIG_AAC_TRANSCODER_KEY "enable-aac-transcoder"
#define RYGEL_USER_CONFIG_AVC_TRANSCODER_KEY "enable-avc-transcoder"
#define RYGEL_USER_CONFIG_ALLOW_UPLOAD_KEY "allow-upload"
#define RYGEL_USER_CONFIG_ALLOW_DELETION_KEY "allow-deletion"
#define RYGEL_USER_CONFIG_LOG_LEVELS_KEY "log-level"
#define RYGEL_USER_CONFIG_PLUGIN_PATH_KEY "plugin-path"
#define RYGEL_USER_CONFIG_UPLOAD_FOLDER_KEY "upload-folder"
#define RYGEL_USER_CONFIG_VIDEO_UPLOAD_DIR_PATH_KEY "video-" RYGEL_USER_CONFIG_UPLOAD_FOLDER_KEY
#define RYGEL_USER_CONFIG_MUSIC_UPLOAD_DIR_PATH_KEY "music-" RYGEL_USER_CONFIG_UPLOAD_FOLDER_KEY
#define RYGEL_USER_CONFIG_PICTURE_UPLOAD_DIR_PATH_KEY "picture-" RYGEL_USER_CONFIG_UPLOAD_FOLDER_KEY
static gboolean rygel_user_config_real_get_upnp_enabled (RygelConfiguration* base, GError** error);
gboolean rygel_configuration_get_bool (RygelConfiguration* self, const gchar* section, const gchar* key, GError** error);
static gchar* rygel_user_config_real_get_interface (RygelConfiguration* base, GError** error);
gchar* rygel_configuration_get_string (RygelConfiguration* self, const gchar* section, const gchar* key, GError** error);
static gint rygel_user_config_real_get_port (RygelConfiguration* base, GError** error);
gint rygel_configuration_get_int (RygelConfiguration* self, const gchar* section, const gchar* key, gint min, gint max, GError** error);
static gboolean rygel_user_config_real_get_transcoding (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_mp3_transcoder (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_mp2ts_transcoder (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_lpcm_transcoder (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_wmv_transcoder (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_aac_transcoder (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_avc_transcoder (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_allow_upload (RygelConfiguration* base, GError** error);
static gboolean rygel_user_config_real_get_allow_deletion (RygelConfiguration* base, GError** error);
static gchar* rygel_user_config_real_get_log_levels (RygelConfiguration* base, GError** error);
static gchar* rygel_user_config_real_get_plugin_path (RygelConfiguration* base, GError** error);
static gchar* rygel_user_config_real_get_video_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_user_config_real_get_music_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_user_config_real_get_picture_upload_folder (RygelConfiguration* base, GError** error);
RygelUserConfig* rygel_user_config_get_default (GError** error);
RygelUserConfig* rygel_user_config_new (const gchar* file, GError** error);
RygelUserConfig* rygel_user_config_construct (GType object_type, const gchar* file, GError** error);
static gboolean rygel_user_config_real_get_enabled (RygelConfiguration* base, const gchar* section, GError** error);
static gchar* rygel_user_config_real_get_title (RygelConfiguration* base, const gchar* section, GError** error);
static gchar* rygel_user_config_real_get_string (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
GQuark rygel_configuration_error_quark (void);
static GeeArrayList* rygel_user_config_real_get_string_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static gint rygel_user_config_real_get_int (RygelConfiguration* base, const gchar* section, const gchar* key, gint min, gint max, GError** error);
static GeeArrayList* rygel_user_config_real_get_int_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static gboolean rygel_user_config_real_get_bool (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static void rygel_user_config_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gboolean rygel_user_config_real_get_upnp_enabled (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_UPNP_ENABLED_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gchar* rygel_user_config_real_get_interface (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_string ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_IFACE_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp1_;
	return result;
}


static gint rygel_user_config_real_get_port (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gint result = 0;
	guint16 _tmp0_;
	guint16 _tmp1_;
	gint _tmp2_ = 0;
	gint _tmp3_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = 0U;
	_tmp1_ = G_MAXUINT16;
	_tmp2_ = rygel_configuration_get_int ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_PORT_KEY, (gint) _tmp0_, (gint) _tmp1_, &_inner_error_);
	_tmp3_ = _tmp2_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return 0;
	}
	result = _tmp3_;
	return result;
}


static gboolean rygel_user_config_real_get_transcoding (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_TRANSCODING_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_mp3_transcoder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_MP3_TRANSCODER_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_mp2ts_transcoder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_MP2TS_TRANSCODER_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_lpcm_transcoder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_LPCM_TRANSCODER_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_wmv_transcoder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_WMV_TRANSCODER_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_aac_transcoder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_AAC_TRANSCODER_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_avc_transcoder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_AVC_TRANSCODER_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_allow_upload (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_ALLOW_UPLOAD_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gboolean rygel_user_config_real_get_allow_deletion (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_bool ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_ALLOW_DELETION_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp1_;
	return result;
}


static gchar* rygel_user_config_real_get_log_levels (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_string ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_LOG_LEVELS_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp1_;
	return result;
}


static gchar* rygel_user_config_real_get_plugin_path (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_string ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_PLUGIN_PATH_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp1_;
	return result;
}


static gchar* rygel_user_config_real_get_video_upload_folder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_string ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_VIDEO_UPLOAD_DIR_PATH_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp1_;
	return result;
}


static gchar* rygel_user_config_real_get_music_upload_folder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_string ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_MUSIC_UPLOAD_DIR_PATH_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp1_;
	return result;
}


static gchar* rygel_user_config_real_get_picture_upload_folder (RygelConfiguration* base, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	_tmp0_ = rygel_configuration_get_string ((RygelConfiguration*) self, "general", RYGEL_USER_CONFIG_PICTURE_UPLOAD_DIR_PATH_KEY, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp1_;
	return result;
}


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


RygelUserConfig* rygel_user_config_get_default (GError** error) {
	RygelUserConfig* result = NULL;
	RygelUserConfig* _tmp0_;
	RygelUserConfig* _tmp6_;
	RygelUserConfig* _tmp7_;
	GError * _inner_error_ = NULL;
	_tmp0_ = rygel_user_config_config;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* path;
		const gchar* _tmp3_;
		RygelUserConfig* _tmp4_;
		RygelUserConfig* _tmp5_;
		_tmp1_ = g_get_user_config_dir ();
		_tmp2_ = g_build_filename (_tmp1_, RYGEL_USER_CONFIG_CONFIG_FILE, NULL);
		path = _tmp2_;
		_tmp3_ = path;
		_tmp4_ = rygel_user_config_new (_tmp3_, &_inner_error_);
		_tmp5_ = _tmp4_;
		if (_inner_error_ != NULL) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (path);
			return NULL;
		}
		_g_object_unref0 (rygel_user_config_config);
		rygel_user_config_config = _tmp5_;
		_g_free0 (path);
	}
	_tmp6_ = rygel_user_config_config;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	result = _tmp7_;
	return result;
}


RygelUserConfig* rygel_user_config_construct (GType object_type, const gchar* file, GError** error) {
	RygelUserConfig * self = NULL;
	GKeyFile* _tmp0_;
	GKeyFile* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* path;
	GKeyFile* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	self = (RygelUserConfig*) g_object_new (object_type, NULL);
	_tmp0_ = g_key_file_new ();
	_g_key_file_unref0 (self->key_file);
	self->key_file = _tmp0_;
	_tmp1_ = g_key_file_new ();
	_g_key_file_unref0 (self->sys_key_file);
	self->sys_key_file = _tmp1_;
	_tmp2_ = g_build_filename (SYS_CONFIG_DIR, RYGEL_USER_CONFIG_CONFIG_FILE, NULL);
	path = _tmp2_;
	_tmp3_ = self->sys_key_file;
	_tmp4_ = path;
	g_key_file_load_from_file (_tmp3_, _tmp4_, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &_inner_error_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (path);
		_g_object_unref0 (self);
		return NULL;
	}
	_tmp5_ = path;
	g_debug ("rygel-user-config.vala:151: Loaded system configuration from file '%s'", _tmp5_);
	{
		GKeyFile* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp6_ = self->key_file;
		_tmp7_ = file;
		g_key_file_load_from_file (_tmp6_, _tmp7_, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch38_g_error;
		}
		_tmp8_ = file;
		g_debug ("rygel-user-config.vala:158: Loaded user configuration from file '%s'", _tmp8_);
	}
	goto __finally38;
	__catch38_g_error:
	{
		GError* _error_ = NULL;
		const gchar* _tmp9_;
		GError* _tmp10_;
		const gchar* _tmp11_;
		gsize size = 0UL;
		GKeyFile* _tmp12_;
		gsize _tmp13_ = 0UL;
		gchar* _tmp14_ = NULL;
		gchar* data;
		GKeyFile* _tmp15_;
		const gchar* _tmp16_;
		gsize _tmp17_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp9_ = file;
		_tmp10_ = _error_;
		_tmp11_ = _tmp10_->message;
		g_debug ("rygel-user-config.vala:160: Failed to load user configuration from fil" \
"e '%s': %s", _tmp9_, _tmp11_);
		_tmp12_ = self->sys_key_file;
		_tmp14_ = g_key_file_to_data (_tmp12_, &_tmp13_, NULL);
		size = _tmp13_;
		data = _tmp14_;
		_tmp15_ = self->key_file;
		_tmp16_ = data;
		_tmp17_ = size;
		g_key_file_load_from_data (_tmp15_, _tmp16_, _tmp17_, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_free0 (data);
			_g_error_free0 (_error_);
			goto __finally38;
		}
		_g_free0 (data);
		_g_error_free0 (_error_);
	}
	__finally38:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (path);
		_g_object_unref0 (self);
		return NULL;
	}
	_g_free0 (path);
	return self;
}


RygelUserConfig* rygel_user_config_new (const gchar* file, GError** error) {
	return rygel_user_config_construct (RYGEL_TYPE_USER_CONFIG, file, error);
}


static gboolean rygel_user_config_real_get_enabled (RygelConfiguration* base, const gchar* section, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, FALSE);
	_tmp0_ = section;
	_tmp1_ = rygel_configuration_get_bool ((RygelConfiguration*) self, _tmp0_, RYGEL_USER_CONFIG_ENABLED_KEY, &_inner_error_);
	_tmp2_ = _tmp1_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp2_;
	return result;
}


static gchar* rygel_user_config_real_get_title (RygelConfiguration* base, const gchar* section, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	_tmp0_ = section;
	_tmp1_ = rygel_configuration_get_string ((RygelConfiguration*) self, _tmp0_, RYGEL_USER_CONFIG_TITLE_KEY, &_inner_error_);
	_tmp2_ = _tmp1_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	result = _tmp2_;
	return result;
}


static gpointer _g_error_copy0 (gpointer self) {
	return self ? g_error_copy (self) : NULL;
}


static gchar* rygel_user_config_real_get_string (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelUserConfig * self;
	gchar* result = NULL;
	gchar* val = NULL;
	gboolean _tmp16_ = FALSE;
	const gchar* _tmp17_;
	gboolean _tmp19_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	{
		GKeyFile* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_;
		_tmp0_ = self->key_file;
		_tmp1_ = section;
		_tmp2_ = key;
		_tmp3_ = g_key_file_get_string (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
		_tmp4_ = _tmp3_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch39_g_key_file_error;
			}
			_g_free0 (val);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_free0 (val);
		val = _tmp4_;
	}
	goto __finally39;
	__catch39_g_key_file_error:
	{
		GError* _error_ = NULL;
		gboolean _tmp5_ = FALSE;
		GError* _tmp6_;
		gboolean _tmp8_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = _error_;
		if (g_error_matches (_tmp6_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
			_tmp5_ = TRUE;
		} else {
			GError* _tmp7_;
			_tmp7_ = _error_;
			_tmp5_ = g_error_matches (_tmp7_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
		}
		_tmp8_ = _tmp5_;
		if (_tmp8_) {
			GKeyFile* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_ = NULL;
			gchar* _tmp13_;
			_tmp9_ = self->sys_key_file;
			_tmp10_ = section;
			_tmp11_ = key;
			_tmp12_ = g_key_file_get_string (_tmp9_, _tmp10_, _tmp11_, &_inner_error_);
			_tmp13_ = _tmp12_;
			if (_inner_error_ != NULL) {
				_g_error_free0 (_error_);
				goto __finally39;
			}
			_g_free0 (val);
			val = _tmp13_;
		} else {
			GError* _tmp14_;
			GError* _tmp15_;
			_tmp14_ = _error_;
			_tmp15_ = _g_error_copy0 (_tmp14_);
			_inner_error_ = _tmp15_;
			_g_error_free0 (_error_);
			goto __finally39;
		}
		_g_error_free0 (_error_);
	}
	__finally39:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (val);
		return NULL;
	}
	_tmp17_ = val;
	if (_tmp17_ == NULL) {
		_tmp16_ = TRUE;
	} else {
		const gchar* _tmp18_;
		_tmp18_ = val;
		_tmp16_ = g_strcmp0 (_tmp18_, "") == 0;
	}
	_tmp19_ = _tmp16_;
	if (_tmp19_) {
		const gchar* _tmp20_ = NULL;
		const gchar* _tmp21_;
		GError* _tmp22_;
		_tmp20_ = _ ("No value available for '%s'");
		_tmp21_ = key;
		_tmp22_ = g_error_new (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp20_, _tmp21_);
		_inner_error_ = _tmp22_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (val);
		return NULL;
	}
	result = val;
	return result;
}


static GeeArrayList* rygel_user_config_real_get_string_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelUserConfig * self;
	GeeArrayList* result = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* str_list;
	gchar** strings = NULL;
	gint strings_length1 = 0;
	gint _strings_size_ = 0;
	gchar** _tmp19_;
	gint _tmp19__length1;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
	str_list = _tmp0_;
	{
		GKeyFile* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gsize _tmp4_;
		gchar** _tmp5_ = NULL;
		gchar** _tmp6_;
		gint _tmp6__length1;
		gint __tmp6__size_;
		_tmp1_ = self->key_file;
		_tmp2_ = section;
		_tmp3_ = key;
		_tmp5_ = g_key_file_get_string_list (_tmp1_, _tmp2_, _tmp3_, &_tmp4_, &_inner_error_);
		_tmp6_ = _tmp5_;
		_tmp6__length1 = _tmp4_;
		__tmp6__size_ = _tmp6__length1;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch40_g_key_file_error;
			}
			strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (str_list);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
		strings = _tmp6_;
		strings_length1 = _tmp6__length1;
		_strings_size_ = strings_length1;
	}
	goto __finally40;
	__catch40_g_key_file_error:
	{
		GError* _error_ = NULL;
		gboolean _tmp7_ = FALSE;
		GError* _tmp8_;
		gboolean _tmp10_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp8_ = _error_;
		if (g_error_matches (_tmp8_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
			_tmp7_ = TRUE;
		} else {
			GError* _tmp9_;
			_tmp9_ = _error_;
			_tmp7_ = g_error_matches (_tmp9_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
		}
		_tmp10_ = _tmp7_;
		if (_tmp10_) {
			GKeyFile* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gsize _tmp14_;
			gchar** _tmp15_ = NULL;
			gchar** _tmp16_;
			gint _tmp16__length1;
			gint __tmp16__size_;
			_tmp11_ = self->sys_key_file;
			_tmp12_ = section;
			_tmp13_ = key;
			_tmp15_ = g_key_file_get_string_list (_tmp11_, _tmp12_, _tmp13_, &_tmp14_, &_inner_error_);
			_tmp16_ = _tmp15_;
			_tmp16__length1 = _tmp14_;
			__tmp16__size_ = _tmp16__length1;
			if (_inner_error_ != NULL) {
				_g_error_free0 (_error_);
				goto __finally40;
			}
			strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
			strings = _tmp16_;
			strings_length1 = _tmp16__length1;
			_strings_size_ = strings_length1;
		} else {
			GError* _tmp17_;
			GError* _tmp18_;
			_tmp17_ = _error_;
			_tmp18_ = _g_error_copy0 (_tmp17_);
			_inner_error_ = _tmp18_;
			_g_error_free0 (_error_);
			goto __finally40;
		}
		_g_error_free0 (_error_);
	}
	__finally40:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (str_list);
		return NULL;
	}
	_tmp19_ = strings;
	_tmp19__length1 = strings_length1;
	{
		gchar** str_collection = NULL;
		gint str_collection_length1 = 0;
		gint _str_collection_size_ = 0;
		gint str_it = 0;
		str_collection = _tmp19_;
		str_collection_length1 = _tmp19__length1;
		for (str_it = 0; str_it < _tmp19__length1; str_it = str_it + 1) {
			gchar* _tmp20_;
			gchar* str = NULL;
			_tmp20_ = g_strdup (str_collection[str_it]);
			str = _tmp20_;
			{
				GeeArrayList* _tmp21_;
				const gchar* _tmp22_;
				_tmp21_ = str_list;
				_tmp22_ = str;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, _tmp22_);
				_g_free0 (str);
			}
		}
	}
	result = str_list;
	strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


static gint rygel_user_config_real_get_int (RygelConfiguration* base, const gchar* section, const gchar* key, gint min, gint max, GError** error) {
	RygelUserConfig * self;
	gint result = 0;
	gint val = 0;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	gint _tmp18_;
	gboolean _tmp21_;
	gboolean _tmp24_;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, 0);
	g_return_val_if_fail (key != NULL, 0);
	{
		GKeyFile* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gint _tmp3_ = 0;
		gint _tmp4_;
		_tmp0_ = self->key_file;
		_tmp1_ = section;
		_tmp2_ = key;
		_tmp3_ = g_key_file_get_integer (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
		_tmp4_ = _tmp3_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch41_g_key_file_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return 0;
		}
		val = _tmp4_;
	}
	goto __finally41;
	__catch41_g_key_file_error:
	{
		GError* _error_ = NULL;
		gboolean _tmp5_ = FALSE;
		GError* _tmp6_;
		gboolean _tmp8_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = _error_;
		if (g_error_matches (_tmp6_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
			_tmp5_ = TRUE;
		} else {
			GError* _tmp7_;
			_tmp7_ = _error_;
			_tmp5_ = g_error_matches (_tmp7_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
		}
		_tmp8_ = _tmp5_;
		if (_tmp8_) {
			GKeyFile* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gint _tmp12_ = 0;
			gint _tmp13_;
			_tmp9_ = self->sys_key_file;
			_tmp10_ = section;
			_tmp11_ = key;
			_tmp12_ = g_key_file_get_integer (_tmp9_, _tmp10_, _tmp11_, &_inner_error_);
			_tmp13_ = _tmp12_;
			if (_inner_error_ != NULL) {
				_g_error_free0 (_error_);
				goto __finally41;
			}
			val = _tmp13_;
		} else {
			GError* _tmp14_;
			GError* _tmp15_;
			_tmp14_ = _error_;
			_tmp15_ = _g_error_copy0 (_tmp14_);
			_inner_error_ = _tmp15_;
			_g_error_free0 (_error_);
			goto __finally41;
		}
		_g_error_free0 (_error_);
	}
	__finally41:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return 0;
	}
	_tmp18_ = val;
	if (_tmp18_ == 0) {
		_tmp17_ = TRUE;
	} else {
		gint _tmp19_;
		gint _tmp20_;
		_tmp19_ = val;
		_tmp20_ = min;
		_tmp17_ = _tmp19_ < _tmp20_;
	}
	_tmp21_ = _tmp17_;
	if (_tmp21_) {
		_tmp16_ = TRUE;
	} else {
		gint _tmp22_;
		gint _tmp23_;
		_tmp22_ = val;
		_tmp23_ = max;
		_tmp16_ = _tmp22_ > _tmp23_;
	}
	_tmp24_ = _tmp16_;
	if (_tmp24_) {
		const gchar* _tmp25_ = NULL;
		const gchar* _tmp26_;
		GError* _tmp27_;
		_tmp25_ = _ ("Value of '%s' out of range");
		_tmp26_ = key;
		_tmp27_ = g_error_new (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_VALUE_OUT_OF_RANGE, _tmp25_, _tmp26_);
		_inner_error_ = _tmp27_;
		g_propagate_error (error, _inner_error_);
		return 0;
	}
	result = val;
	return result;
}


static GeeArrayList* rygel_user_config_real_get_int_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelUserConfig * self;
	GeeArrayList* result = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* int_list;
	gint* ints = NULL;
	gint ints_length1 = 0;
	gint _ints_size_ = 0;
	gint* _tmp19_;
	gint _tmp19__length1;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	_tmp0_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL);
	int_list = _tmp0_;
	{
		GKeyFile* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gsize _tmp4_;
		gint* _tmp5_ = NULL;
		gint* _tmp6_;
		gint _tmp6__length1;
		gint __tmp6__size_;
		_tmp1_ = self->key_file;
		_tmp2_ = section;
		_tmp3_ = key;
		_tmp5_ = g_key_file_get_integer_list (_tmp1_, _tmp2_, _tmp3_, &_tmp4_, &_inner_error_);
		_tmp6_ = _tmp5_;
		_tmp6__length1 = _tmp4_;
		__tmp6__size_ = _tmp6__length1;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch42_g_key_file_error;
			}
			ints = (g_free (ints), NULL);
			_g_object_unref0 (int_list);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		ints = (g_free (ints), NULL);
		ints = _tmp6_;
		ints_length1 = _tmp6__length1;
		_ints_size_ = ints_length1;
	}
	goto __finally42;
	__catch42_g_key_file_error:
	{
		GError* _error_ = NULL;
		gboolean _tmp7_ = FALSE;
		GError* _tmp8_;
		gboolean _tmp10_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp8_ = _error_;
		if (g_error_matches (_tmp8_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
			_tmp7_ = TRUE;
		} else {
			GError* _tmp9_;
			_tmp9_ = _error_;
			_tmp7_ = g_error_matches (_tmp9_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
		}
		_tmp10_ = _tmp7_;
		if (_tmp10_) {
			GKeyFile* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gsize _tmp14_;
			gint* _tmp15_ = NULL;
			gint* _tmp16_;
			gint _tmp16__length1;
			gint __tmp16__size_;
			_tmp11_ = self->sys_key_file;
			_tmp12_ = section;
			_tmp13_ = key;
			_tmp15_ = g_key_file_get_integer_list (_tmp11_, _tmp12_, _tmp13_, &_tmp14_, &_inner_error_);
			_tmp16_ = _tmp15_;
			_tmp16__length1 = _tmp14_;
			__tmp16__size_ = _tmp16__length1;
			if (_inner_error_ != NULL) {
				_g_error_free0 (_error_);
				goto __finally42;
			}
			ints = (g_free (ints), NULL);
			ints = _tmp16_;
			ints_length1 = _tmp16__length1;
			_ints_size_ = ints_length1;
		} else {
			GError* _tmp17_;
			GError* _tmp18_;
			_tmp17_ = _error_;
			_tmp18_ = _g_error_copy0 (_tmp17_);
			_inner_error_ = _tmp18_;
			_g_error_free0 (_error_);
			goto __finally42;
		}
		_g_error_free0 (_error_);
	}
	__finally42:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		ints = (g_free (ints), NULL);
		_g_object_unref0 (int_list);
		return NULL;
	}
	_tmp19_ = ints;
	_tmp19__length1 = ints_length1;
	{
		gint* num_collection = NULL;
		gint num_collection_length1 = 0;
		gint _num_collection_size_ = 0;
		gint num_it = 0;
		num_collection = _tmp19_;
		num_collection_length1 = _tmp19__length1;
		for (num_it = 0; num_it < _tmp19__length1; num_it = num_it + 1) {
			gint num = 0;
			num = num_collection[num_it];
			{
				GeeArrayList* _tmp20_;
				gint _tmp21_;
				_tmp20_ = int_list;
				_tmp21_ = num;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, GINT_TO_POINTER (_tmp21_));
			}
		}
	}
	result = int_list;
	ints = (g_free (ints), NULL);
	return result;
}


static gboolean rygel_user_config_real_get_bool (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelUserConfig * self;
	gboolean result = FALSE;
	gboolean val = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelUserConfig*) base;
	g_return_val_if_fail (section != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	{
		GKeyFile* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_;
		_tmp0_ = self->key_file;
		_tmp1_ = section;
		_tmp2_ = key;
		_tmp3_ = g_key_file_get_boolean (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
		_tmp4_ = _tmp3_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch43_g_key_file_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return FALSE;
		}
		val = _tmp4_;
	}
	goto __finally43;
	__catch43_g_key_file_error:
	{
		GError* _error_ = NULL;
		gboolean _tmp5_ = FALSE;
		GError* _tmp6_;
		gboolean _tmp8_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = _error_;
		if (g_error_matches (_tmp6_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
			_tmp5_ = TRUE;
		} else {
			GError* _tmp7_;
			_tmp7_ = _error_;
			_tmp5_ = g_error_matches (_tmp7_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND);
		}
		_tmp8_ = _tmp5_;
		if (_tmp8_) {
			GKeyFile* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gboolean _tmp12_ = FALSE;
			gboolean _tmp13_;
			_tmp9_ = self->sys_key_file;
			_tmp10_ = section;
			_tmp11_ = key;
			_tmp12_ = g_key_file_get_boolean (_tmp9_, _tmp10_, _tmp11_, &_inner_error_);
			_tmp13_ = _tmp12_;
			if (_inner_error_ != NULL) {
				_g_error_free0 (_error_);
				goto __finally43;
			}
			val = _tmp13_;
		} else {
			GError* _tmp14_;
			GError* _tmp15_;
			_tmp14_ = _error_;
			_tmp15_ = _g_error_copy0 (_tmp14_);
			_inner_error_ = _tmp15_;
			_g_error_free0 (_error_);
			goto __finally43;
		}
		_g_error_free0 (_error_);
	}
	__finally43:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = val;
	return result;
}


static void rygel_user_config_class_init (RygelUserConfigClass * klass) {
	rygel_user_config_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = rygel_user_config_finalize;
}


static void rygel_user_config_rygel_configuration_interface_init (RygelConfigurationIface * iface) {
	rygel_user_config_rygel_configuration_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_upnp_enabled = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_upnp_enabled;
	iface->get_interface = (gchar* (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_interface;
	iface->get_port = (gint (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_port;
	iface->get_transcoding = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_transcoding;
	iface->get_mp3_transcoder = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_mp3_transcoder;
	iface->get_mp2ts_transcoder = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_mp2ts_transcoder;
	iface->get_lpcm_transcoder = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_lpcm_transcoder;
	iface->get_wmv_transcoder = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_wmv_transcoder;
	iface->get_aac_transcoder = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_aac_transcoder;
	iface->get_avc_transcoder = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_avc_transcoder;
	iface->get_allow_upload = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_allow_upload;
	iface->get_allow_deletion = (gboolean (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_allow_deletion;
	iface->get_log_levels = (gchar* (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_log_levels;
	iface->get_plugin_path = (gchar* (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_plugin_path;
	iface->get_video_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_video_upload_folder;
	iface->get_music_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_music_upload_folder;
	iface->get_picture_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_user_config_real_get_picture_upload_folder;
	iface->get_enabled = (gboolean (*)(RygelConfiguration*, const gchar*, GError**)) rygel_user_config_real_get_enabled;
	iface->get_title = (gchar* (*)(RygelConfiguration*, const gchar*, GError**)) rygel_user_config_real_get_title;
	iface->get_string = (gchar* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_user_config_real_get_string;
	iface->get_string_list = (GeeArrayList* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_user_config_real_get_string_list;
	iface->get_int = (gint (*)(RygelConfiguration*, const gchar*, const gchar*, gint, gint, GError**)) rygel_user_config_real_get_int;
	iface->get_int_list = (GeeArrayList* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_user_config_real_get_int_list;
	iface->get_bool = (gboolean (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_user_config_real_get_bool;
}


static void rygel_user_config_instance_init (RygelUserConfig * self) {
}


static void rygel_user_config_finalize (GObject* obj) {
	RygelUserConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_USER_CONFIG, RygelUserConfig);
	_g_key_file_unref0 (self->key_file);
	_g_key_file_unref0 (self->sys_key_file);
	G_OBJECT_CLASS (rygel_user_config_parent_class)->finalize (obj);
}


/**
 * Manages the user configuration for Rygel.
 */
GType rygel_user_config_get_type (void) {
	static volatile gsize rygel_user_config_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_user_config_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelUserConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_user_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelUserConfig), 0, (GInstanceInitFunc) rygel_user_config_instance_init, NULL };
		static const GInterfaceInfo rygel_configuration_info = { (GInterfaceInitFunc) rygel_user_config_rygel_configuration_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType rygel_user_config_type_id;
		rygel_user_config_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelUserConfig", &g_define_type_info, 0);
		g_type_add_interface_static (rygel_user_config_type_id, RYGEL_TYPE_CONFIGURATION, &rygel_configuration_info);
		g_once_init_leave (&rygel_user_config_type_id__volatile, rygel_user_config_type_id);
	}
	return rygel_user_config_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



