/* a11y-profile-manager.c generated by valac 0.32.1, the Vala compiler
 * generated from a11y-profile-manager.vala, do not modify */

/* Copyright (C) 2016 Canonical Ltd.
 * Author: Luke Yelavich <luke.yelavich@canonical.com>
 *
 * This program 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 3 of the License, or (at
 * your option) any later version.
 *
 * This program 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 program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <a11y-profile-manager.h>
#include <stdio.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <config.h>
#include <gio/gio.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))



void print_profile_list (gboolean detailed);
static void _g_object_unref0_ (gpointer var);
static void _g_slist_free__g_object_unref0_ (GSList* self);
gint _vala_main (gchar** args, int args_length1);


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


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_slist_free__g_object_unref0_ (GSList* self) {
	g_slist_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_slist_free (self);
}


void print_profile_list (gboolean detailed) {
	GSList* profile_list = NULL;
	GSList* _tmp0_ = NULL;
	GSList* _tmp1_ = NULL;
	_tmp0_ = a11y_profile_manager_list_profiles ();
	profile_list = _tmp0_;
	_tmp1_ = profile_list;
	{
		GSList* profile_collection = NULL;
		GSList* profile_it = NULL;
		profile_collection = _tmp1_;
		for (profile_it = profile_collection; profile_it != NULL; profile_it = profile_it->next) {
			A11yProfileManagerProfile* _tmp2_ = NULL;
			A11yProfileManagerProfile* profile = NULL;
			_tmp2_ = _g_object_ref0 ((A11yProfileManagerProfile*) profile_it->data);
			profile = _tmp2_;
			{
				gboolean _tmp3_ = FALSE;
				_tmp3_ = detailed;
				if (_tmp3_) {
					FILE* _tmp4_ = NULL;
					const gchar* _tmp5_ = NULL;
					A11yProfileManagerProfile* _tmp6_ = NULL;
					const gchar* _tmp7_ = NULL;
					const gchar* _tmp8_ = NULL;
					FILE* _tmp9_ = NULL;
					const gchar* _tmp10_ = NULL;
					A11yProfileManagerProfile* _tmp11_ = NULL;
					const gchar* _tmp12_ = NULL;
					const gchar* _tmp13_ = NULL;
					FILE* _tmp14_ = NULL;
					const gchar* _tmp15_ = NULL;
					A11yProfileManagerProfile* _tmp16_ = NULL;
					const gchar* _tmp17_ = NULL;
					const gchar* _tmp18_ = NULL;
					FILE* _tmp19_ = NULL;
					_tmp4_ = stdout;
					_tmp5_ = _ ("Profile directory name: %s\n");
					_tmp6_ = profile;
					_tmp7_ = a11y_profile_manager_profile_get_dir_name (_tmp6_);
					_tmp8_ = _tmp7_;
					fprintf (_tmp4_, _tmp5_, _tmp8_);
					_tmp9_ = stdout;
					_tmp10_ = _ ("Name: %s\n");
					_tmp11_ = profile;
					_tmp12_ = a11y_profile_manager_profile_get_name (_tmp11_);
					_tmp13_ = _tmp12_;
					fprintf (_tmp9_, _tmp10_, _tmp13_);
					_tmp14_ = stdout;
					_tmp15_ = _ ("Description: %s\n");
					_tmp16_ = profile;
					_tmp17_ = a11y_profile_manager_profile_get_description (_tmp16_);
					_tmp18_ = _tmp17_;
					fprintf (_tmp14_, _tmp15_, _tmp18_);
					_tmp19_ = stdout;
					fprintf (_tmp19_, "\n");
				} else {
					FILE* _tmp20_ = NULL;
					A11yProfileManagerProfile* _tmp21_ = NULL;
					const gchar* _tmp22_ = NULL;
					const gchar* _tmp23_ = NULL;
					_tmp20_ = stdout;
					_tmp21_ = profile;
					_tmp22_ = a11y_profile_manager_profile_get_dir_name (_tmp21_);
					_tmp23_ = _tmp22_;
					fprintf (_tmp20_, "%s\n", _tmp23_);
				}
				_g_object_unref0 (profile);
			}
		}
	}
	__g_slist_free__g_object_unref0_0 (profile_list);
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	gboolean show_version = FALSE;
	gboolean list_profiles = FALSE;
	gboolean list_profiles_detailed = FALSE;
	gboolean get_active_profile = FALSE;
	gboolean deactivate_profile = FALSE;
	gboolean toggle_indicator = FALSE;
	gchar* active_profile = NULL;
	gchar* profile_name = NULL;
	gchar* dconf_file = NULL;
	GOptionEntry version_option = {0};
	GOptionEntry _tmp0_ = {0};
	GOptionEntry list_option = {0};
	GOptionEntry _tmp1_ = {0};
	GOptionEntry detail_option = {0};
	GOptionEntry _tmp2_ = {0};
	GOptionEntry get_option = {0};
	GOptionEntry _tmp3_ = {0};
	GOptionEntry set_option = {0};
	GOptionEntry _tmp4_ = {0};
	GOptionEntry dconf_option = {0};
	GOptionEntry _tmp5_ = {0};
	GOptionEntry deact_option = {0};
	GOptionEntry _tmp6_ = {0};
	GOptionEntry tindc_option = {0};
	GOptionEntry _tmp7_ = {0};
	GOptionEntry nulloption = {0};
	GOptionEntry _tmp8_ = {0};
	GOptionEntry* options = NULL;
	GOptionEntry _tmp9_ = {0};
	GOptionEntry _tmp10_ = {0};
	GOptionEntry _tmp11_ = {0};
	GOptionEntry _tmp12_ = {0};
	GOptionEntry _tmp13_ = {0};
	GOptionEntry _tmp14_ = {0};
	GOptionEntry _tmp15_ = {0};
	GOptionEntry _tmp16_ = {0};
	GOptionEntry _tmp17_ = {0};
	GOptionEntry* _tmp18_ = NULL;
	gint options_length1 = 0;
	gint _options_size_ = 0;
	GOptionContext* context = NULL;
	const gchar* _tmp19_ = NULL;
	GOptionContext* _tmp20_ = NULL;
	GOptionContext* _tmp21_ = NULL;
	GOptionEntry* _tmp22_ = NULL;
	gint _tmp22__length1 = 0;
	gboolean _tmp32_ = FALSE;
	gboolean _tmp34_ = FALSE;
	gboolean _tmp35_ = FALSE;
	gboolean _tmp36_ = FALSE;
	gboolean _tmp47_ = FALSE;
	const gchar* _tmp72_ = NULL;
	GError * _inner_error_ = NULL;
	setlocale (LC_ALL, "");
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	show_version = FALSE;
	list_profiles = FALSE;
	list_profiles_detailed = FALSE;
	get_active_profile = FALSE;
	deactivate_profile = FALSE;
	toggle_indicator = FALSE;
	active_profile = NULL;
	profile_name = NULL;
	dconf_file = NULL;
	_tmp0_.long_name = "version";
	_tmp0_.short_name = 'v';
	_tmp0_.flags = 0;
	_tmp0_.arg = G_OPTION_ARG_NONE;
	_tmp0_.arg_data = &show_version;
	_tmp0_.description = "Show release version";
	_tmp0_.arg_description = NULL;
	version_option = _tmp0_;
	_tmp1_.long_name = "list";
	_tmp1_.short_name = 'l';
	_tmp1_.flags = 0;
	_tmp1_.arg = G_OPTION_ARG_NONE;
	_tmp1_.arg_data = &list_profiles;
	_tmp1_.description = "List available accessibility profiles";
	_tmp1_.arg_description = NULL;
	list_option = _tmp1_;
	_tmp2_.long_name = "list-detailed";
	_tmp2_.short_name = 'L';
	_tmp2_.flags = 0;
	_tmp2_.arg = G_OPTION_ARG_NONE;
	_tmp2_.arg_data = &list_profiles_detailed;
	_tmp2_.description = "List available accessibility profiles with more detail";
	_tmp2_.arg_description = NULL;
	detail_option = _tmp2_;
	_tmp3_.long_name = "get";
	_tmp3_.short_name = 'g';
	_tmp3_.flags = 0;
	_tmp3_.arg = G_OPTION_ARG_NONE;
	_tmp3_.arg_data = &get_active_profile;
	_tmp3_.description = "Get the currently active profile";
	_tmp3_.arg_description = NULL;
	get_option = _tmp3_;
	_tmp4_.long_name = "set";
	_tmp4_.short_name = 's';
	_tmp4_.flags = 0;
	_tmp4_.arg = G_OPTION_ARG_STRING;
	_tmp4_.arg_data = &profile_name;
	_tmp4_.description = "Set the active profile, using its directory name, as shown with the -l" \
" or -L option output";
	_tmp4_.arg_description = "DIR";
	set_option = _tmp4_;
	_tmp5_.long_name = "dconf";
	_tmp5_.short_name = 'D';
	_tmp5_.flags = 0;
	_tmp5_.arg = G_OPTION_ARG_STRING;
	_tmp5_.arg_data = &dconf_file;
	_tmp5_.description = "Write profile settings to a file compatible with the dconf utility";
	_tmp5_.arg_description = "FILE";
	dconf_option = _tmp5_;
	_tmp6_.long_name = "deactivate";
	_tmp6_.short_name = 'd';
	_tmp6_.flags = 0;
	_tmp6_.arg = G_OPTION_ARG_NONE;
	_tmp6_.arg_data = &deactivate_profile;
	_tmp6_.description = "Deactivate the currently active profile";
	_tmp6_.arg_description = NULL;
	deact_option = _tmp6_;
	_tmp7_.long_name = "indicator-toggle";
	_tmp7_.short_name = 'i';
	_tmp7_.flags = 0;
	_tmp7_.arg = G_OPTION_ARG_NONE;
	_tmp7_.arg_data = &toggle_indicator;
	_tmp7_.description = "Toggle the accessibility profile indicator, will be enabled/disabled d" \
"epending on whether a profile is being activated or deactivated";
	_tmp7_.arg_description = NULL;
	tindc_option = _tmp7_;
	_tmp8_.long_name = NULL;
	nulloption = _tmp8_;
	_tmp9_ = version_option;
	_tmp10_ = list_option;
	_tmp11_ = detail_option;
	_tmp12_ = get_option;
	_tmp13_ = set_option;
	_tmp14_ = dconf_option;
	_tmp15_ = deact_option;
	_tmp16_ = tindc_option;
	_tmp17_ = nulloption;
	_tmp18_ = g_new0 (GOptionEntry, 9);
	_tmp18_[0] = _tmp9_;
	_tmp18_[1] = _tmp10_;
	_tmp18_[2] = _tmp11_;
	_tmp18_[3] = _tmp12_;
	_tmp18_[4] = _tmp13_;
	_tmp18_[5] = _tmp14_;
	_tmp18_[6] = _tmp15_;
	_tmp18_[7] = _tmp16_;
	_tmp18_[8] = _tmp17_;
	options = _tmp18_;
	options_length1 = 9;
	_options_size_ = options_length1;
	_tmp19_ = _ ("- Accessibility Profile Manager");
	_tmp20_ = g_option_context_new (_tmp19_);
	context = _tmp20_;
	_tmp21_ = context;
	_tmp22_ = options;
	_tmp22__length1 = options_length1;
	g_option_context_add_main_entries (_tmp21_, _tmp22_, GETTEXT_PACKAGE);
	{
		GOptionContext* _tmp23_ = NULL;
		_tmp23_ = context;
		g_option_context_parse (_tmp23_, &args_length1, &args, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp24_ = NULL;
		GError* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		FILE* _tmp27_ = NULL;
		const gchar* _tmp28_ = NULL;
		gchar** _tmp29_ = NULL;
		gint _tmp29__length1 = 0;
		const gchar* _tmp30_ = NULL;
		FILE* _tmp31_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp24_ = stderr;
		_tmp25_ = e;
		_tmp26_ = _tmp25_->message;
		fprintf (_tmp24_, "%s\n", _tmp26_);
		_tmp27_ = stderr;
		_tmp28_ = _ ("Run '%s --help' to see a full list of available command line options.");
		_tmp29_ = args;
		_tmp29__length1 = args_length1;
		_tmp30_ = _tmp29_[0];
		fprintf (_tmp27_, _tmp28_, _tmp30_);
		_tmp31_ = stderr;
		fprintf (_tmp31_, "\n");
		result = EXIT_FAILURE;
		_g_error_free0 (e);
		_g_option_context_free0 (context);
		options = (g_free (options), NULL);
		_g_free0 (dconf_file);
		_g_free0 (profile_name);
		_g_free0 (active_profile);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_option_context_free0 (context);
		options = (g_free (options), NULL);
		_g_free0 (dconf_file);
		_g_free0 (profile_name);
		_g_free0 (active_profile);
		g_critical ("file %s: line %d: uncaught 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;
	}
	_tmp32_ = show_version;
	if (_tmp32_) {
		FILE* _tmp33_ = NULL;
		_tmp33_ = stderr;
		fprintf (_tmp33_, "accessibility-profile-manager %s\n", VERSION);
	}
	_tmp34_ = list_profiles;
	if (_tmp34_) {
		print_profile_list (FALSE);
	}
	_tmp35_ = list_profiles_detailed;
	if (_tmp35_) {
		print_profile_list (TRUE);
	}
	_tmp36_ = get_active_profile;
	if (_tmp36_) {
		GSettings* profile_settings = NULL;
		GSettings* _tmp37_ = NULL;
		GSettings* _tmp38_ = NULL;
		gchar* _tmp39_ = NULL;
		gboolean _tmp40_ = FALSE;
		const gchar* _tmp41_ = NULL;
		_tmp37_ = g_settings_new ("com.canonical.a11y-profile-manager");
		profile_settings = _tmp37_;
		_tmp38_ = profile_settings;
		_tmp39_ = g_settings_get_string (_tmp38_, "active-profile");
		_g_free0 (active_profile);
		active_profile = _tmp39_;
		_tmp41_ = active_profile;
		if (_tmp41_ != NULL) {
			const gchar* _tmp42_ = NULL;
			_tmp42_ = active_profile;
			_tmp40_ = g_strcmp0 (_tmp42_, "") != 0;
		} else {
			_tmp40_ = FALSE;
		}
		if (_tmp40_) {
			FILE* _tmp43_ = NULL;
			const gchar* _tmp44_ = NULL;
			_tmp43_ = stdout;
			_tmp44_ = active_profile;
			fprintf (_tmp43_, "%s\n", _tmp44_);
		} else {
			FILE* _tmp45_ = NULL;
			const gchar* _tmp46_ = NULL;
			_tmp45_ = stdout;
			_tmp46_ = _ ("There is currently no active profile set.\n");
			fprintf (_tmp45_, "%s", _tmp46_);
		}
		_g_object_unref0 (profile_settings);
	}
	_tmp47_ = deactivate_profile;
	if (_tmp47_) {
		GSettings* profile_settings = NULL;
		GSettings* _tmp48_ = NULL;
		GSettings* _tmp49_ = NULL;
		gchar* _tmp50_ = NULL;
		A11yProfileManagerProfile* profile = NULL;
		gboolean _tmp51_ = FALSE;
		const gchar* _tmp52_ = NULL;
		_tmp48_ = g_settings_new ("com.canonical.a11y-profile-manager");
		profile_settings = _tmp48_;
		_tmp49_ = profile_settings;
		_tmp50_ = g_settings_get_string (_tmp49_, "active-profile");
		_g_free0 (active_profile);
		active_profile = _tmp50_;
		profile = NULL;
		_tmp52_ = active_profile;
		if (_tmp52_ != NULL) {
			const gchar* _tmp53_ = NULL;
			_tmp53_ = active_profile;
			_tmp51_ = g_strcmp0 (_tmp53_, "") != 0;
		} else {
			_tmp51_ = FALSE;
		}
		if (_tmp51_) {
			const gchar* _tmp54_ = NULL;
			A11yProfileManagerProfile* _tmp55_ = NULL;
			gboolean _tmp56_ = FALSE;
			A11yProfileManagerProfile* _tmp57_ = NULL;
			GSettings* _tmp71_ = NULL;
			_tmp54_ = active_profile;
			_tmp55_ = a11y_profile_manager_get_profile_by_dir_name (_tmp54_);
			_g_object_unref0 (profile);
			profile = _tmp55_;
			_tmp57_ = profile;
			if (_tmp57_ != NULL) {
				A11yProfileManagerProfile* _tmp58_ = NULL;
				gboolean _tmp59_ = FALSE;
				gboolean _tmp60_ = FALSE;
				_tmp58_ = profile;
				_tmp59_ = a11y_profile_manager_profile_get_valid (_tmp58_);
				_tmp60_ = _tmp59_;
				_tmp56_ = _tmp60_;
			} else {
				_tmp56_ = FALSE;
			}
			if (_tmp56_) {
				{
					A11yProfileManagerProfile* _tmp61_ = NULL;
					gboolean _tmp62_ = FALSE;
					A11yProfileManagerProfile* _tmp63_ = NULL;
					_tmp61_ = profile;
					_tmp62_ = toggle_indicator;
					a11y_profile_manager_profile_set_indicator_toggle (_tmp61_, _tmp62_);
					_tmp63_ = profile;
					a11y_profile_manager_profile_reset_settings (_tmp63_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						goto __catch1_g_error;
					}
				}
				goto __finally1;
				__catch1_g_error:
				{
					GError* e = NULL;
					FILE* _tmp64_ = NULL;
					const gchar* _tmp65_ = NULL;
					A11yProfileManagerProfile* _tmp66_ = NULL;
					const gchar* _tmp67_ = NULL;
					const gchar* _tmp68_ = NULL;
					GError* _tmp69_ = NULL;
					const gchar* _tmp70_ = NULL;
					e = _inner_error_;
					_inner_error_ = NULL;
					_tmp64_ = stdout;
					_tmp65_ = _ ("Unable to reset the settings in the profile %s: %s");
					_tmp66_ = profile;
					_tmp67_ = a11y_profile_manager_profile_get_dir_name (_tmp66_);
					_tmp68_ = _tmp67_;
					_tmp69_ = e;
					_tmp70_ = _tmp69_->message;
					fprintf (_tmp64_, _tmp65_, _tmp68_, _tmp70_);
					result = EXIT_FAILURE;
					_g_error_free0 (e);
					_g_object_unref0 (profile);
					_g_object_unref0 (profile_settings);
					_g_option_context_free0 (context);
					options = (g_free (options), NULL);
					_g_free0 (dconf_file);
					_g_free0 (profile_name);
					_g_free0 (active_profile);
					return result;
				}
				__finally1:
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					_g_object_unref0 (profile);
					_g_object_unref0 (profile_settings);
					_g_option_context_free0 (context);
					options = (g_free (options), NULL);
					_g_free0 (dconf_file);
					_g_free0 (profile_name);
					_g_free0 (active_profile);
					g_critical ("file %s: line %d: uncaught 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;
				}
			}
			_tmp71_ = profile_settings;
			g_settings_reset (_tmp71_, "active-profile");
			g_settings_sync ();
		}
		_g_object_unref0 (profile);
		_g_object_unref0 (profile_settings);
	}
	_tmp72_ = profile_name;
	if (_tmp72_ != NULL) {
		gboolean profile_set = FALSE;
		A11yProfileManagerProfile* profile = NULL;
		const gchar* _tmp73_ = NULL;
		A11yProfileManagerProfile* _tmp74_ = NULL;
		gboolean _tmp75_ = FALSE;
		gboolean _tmp76_ = FALSE;
		A11yProfileManagerProfile* _tmp77_ = NULL;
		gboolean _tmp100_ = FALSE;
		profile_set = FALSE;
		_tmp73_ = profile_name;
		_tmp74_ = a11y_profile_manager_get_profile_by_dir_name (_tmp73_);
		profile = _tmp74_;
		_tmp77_ = profile;
		if (_tmp77_ != NULL) {
			A11yProfileManagerProfile* _tmp78_ = NULL;
			gboolean _tmp79_ = FALSE;
			gboolean _tmp80_ = FALSE;
			_tmp78_ = profile;
			_tmp79_ = a11y_profile_manager_profile_get_valid (_tmp78_);
			_tmp80_ = _tmp79_;
			_tmp76_ = _tmp80_;
		} else {
			_tmp76_ = FALSE;
		}
		if (_tmp76_) {
			A11yProfileManagerProfile* _tmp81_ = NULL;
			const gchar* _tmp82_ = NULL;
			const gchar* _tmp83_ = NULL;
			const gchar* _tmp84_ = NULL;
			_tmp81_ = profile;
			_tmp82_ = a11y_profile_manager_profile_get_dir_name (_tmp81_);
			_tmp83_ = _tmp82_;
			_tmp84_ = profile_name;
			_tmp75_ = g_strcmp0 (_tmp83_, _tmp84_) == 0;
		} else {
			_tmp75_ = FALSE;
		}
		if (_tmp75_) {
			{
				A11yProfileManagerProfile* _tmp85_ = NULL;
				gboolean _tmp86_ = FALSE;
				gboolean _tmp87_ = FALSE;
				const gchar* _tmp88_ = NULL;
				_tmp85_ = profile;
				_tmp86_ = toggle_indicator;
				a11y_profile_manager_profile_set_indicator_toggle (_tmp85_, _tmp86_);
				_tmp88_ = dconf_file;
				if (_tmp88_ != NULL) {
					const gchar* _tmp89_ = NULL;
					_tmp89_ = dconf_file;
					_tmp87_ = g_strcmp0 (_tmp89_, "") != 0;
				} else {
					_tmp87_ = FALSE;
				}
				if (_tmp87_) {
					A11yProfileManagerProfile* _tmp90_ = NULL;
					const gchar* _tmp91_ = NULL;
					_tmp90_ = profile;
					_tmp91_ = dconf_file;
					a11y_profile_manager_profile_write_dconf_file (_tmp90_, _tmp91_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						goto __catch2_g_error;
					}
				} else {
					A11yProfileManagerProfile* _tmp92_ = NULL;
					_tmp92_ = profile;
					a11y_profile_manager_set_active_profile (_tmp92_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						goto __catch2_g_error;
					}
				}
			}
			goto __finally2;
			__catch2_g_error:
			{
				GError* e = NULL;
				FILE* _tmp93_ = NULL;
				const gchar* _tmp94_ = NULL;
				A11yProfileManagerProfile* _tmp95_ = NULL;
				const gchar* _tmp96_ = NULL;
				const gchar* _tmp97_ = NULL;
				GError* _tmp98_ = NULL;
				const gchar* _tmp99_ = NULL;
				e = _inner_error_;
				_inner_error_ = NULL;
				_tmp93_ = stderr;
				_tmp94_ = _ ("The profile %s cannot be set as the active profile: %s");
				_tmp95_ = profile;
				_tmp96_ = a11y_profile_manager_profile_get_dir_name (_tmp95_);
				_tmp97_ = _tmp96_;
				_tmp98_ = e;
				_tmp99_ = _tmp98_->message;
				fprintf (_tmp93_, _tmp94_, _tmp97_, _tmp99_);
				result = EXIT_FAILURE;
				_g_error_free0 (e);
				_g_object_unref0 (profile);
				_g_option_context_free0 (context);
				options = (g_free (options), NULL);
				_g_free0 (dconf_file);
				_g_free0 (profile_name);
				_g_free0 (active_profile);
				return result;
			}
			__finally2:
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				_g_object_unref0 (profile);
				_g_option_context_free0 (context);
				options = (g_free (options), NULL);
				_g_free0 (dconf_file);
				_g_free0 (profile_name);
				_g_free0 (active_profile);
				g_critical ("file %s: line %d: uncaught 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;
			}
			profile_set = TRUE;
		}
		_tmp100_ = profile_set;
		if (!_tmp100_) {
			FILE* _tmp101_ = NULL;
			const gchar* _tmp102_ = NULL;
			const gchar* _tmp103_ = NULL;
			_tmp101_ = stderr;
			_tmp102_ = _ ("The profile %s cannot be found in the list of available accessibility " \
"profiles.\n");
			_tmp103_ = active_profile;
			fprintf (_tmp101_, _tmp102_, _tmp103_);
			result = EXIT_FAILURE;
			_g_object_unref0 (profile);
			_g_option_context_free0 (context);
			options = (g_free (options), NULL);
			_g_free0 (dconf_file);
			_g_free0 (profile_name);
			_g_free0 (active_profile);
			return result;
		}
		_g_object_unref0 (profile);
	}
	result = EXIT_SUCCESS;
	_g_option_context_free0 (context);
	options = (g_free (options), NULL);
	_g_free0 (dconf_file);
	_g_free0 (profile_name);
	_g_free0 (active_profile);
	return result;
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
	return _vala_main (argv, argc);
}



