/* Utils.c generated by valac 0.56.19, the Vala compiler
 * generated from Utils.vala, do not modify */

/*
* Copyright (c) 2014-2017 elementary LLC. (https://elementary.io)
*
* 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, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Marvin Beckers <beckersmarvin@gmail.com>
*/

#include "useraccounts.h"
#include <glib.h>
#include <gio/gio.h>
#include <string.h>
#include <stdlib.h>
#include <libgnome-desktop/gnome-languages.h>
#include <gee.h>
#include <glib-object.h>
#include <glib/gstdio.h>
#include <polkit/polkit.h>
#include <unistd.h>
#include <act/act.h>
#include "run-passwd.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

typedef GDBusProxy SwitchboardPlugUserAccountsSystemdUnitProxy;
typedef GDBusProxyClass SwitchboardPlugUserAccountsSystemdUnitProxyClass;
typedef GDBusProxy SwitchboardPlugUserAccountsSystemdManagerProxy;
typedef GDBusProxyClass SwitchboardPlugUserAccountsSystemdManagerProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef GDBusProxy SwitchboardPlugUserAccountsLocale1ProxyProxy;
typedef GDBusProxyClass SwitchboardPlugUserAccountsLocale1ProxyProxyClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _passwd_destroy0(var) ((var == NULL) ? NULL : (var = (passwd_destroy (var), NULL)))

VALA_EXTERN gchar** switchboard_plug_user_accounts_installed_languages;
VALA_EXTERN gint switchboard_plug_user_accounts_installed_languages_length1;
gchar** switchboard_plug_user_accounts_installed_languages = NULL;
gint switchboard_plug_user_accounts_installed_languages_length1 = 0;
static gint _switchboard_plug_user_accounts_installed_languages_size_ = 0;
VALA_EXTERN gchar* switchboard_plug_user_accounts_display_manager;
gchar* switchboard_plug_user_accounts_display_manager = NULL;
VALA_EXTERN GeeHashMap* switchboard_plug_user_accounts_default_regions;
GeeHashMap* switchboard_plug_user_accounts_default_regions = NULL;
VALA_EXTERN PolkitPermission* switchboard_plug_user_accounts_permission;
PolkitPermission* switchboard_plug_user_accounts_permission = NULL;
VALA_EXTERN ActUserManager* switchboard_plug_user_accounts_usermanager;
ActUserManager* switchboard_plug_user_accounts_usermanager = NULL;
VALA_EXTERN ActUser* switchboard_plug_user_accounts_current_user;
ActUser* switchboard_plug_user_accounts_current_user = NULL;
VALA_EXTERN GList* switchboard_plug_user_accounts_removal_list;
GList* switchboard_plug_user_accounts_removal_list = NULL;
VALA_EXTERN  PasswdHandler* switchboard_plug_user_accounts_passwd_handler;
 PasswdHandler* switchboard_plug_user_accounts_passwd_handler = NULL;

static GType switchboard_plug_user_accounts_systemd_unit_get_type_once (void);
static void switchboard_plug_user_accounts_systemd_unit_proxy_g_signal (GDBusProxy* proxy,
                                                                 const gchar* sender_name,
                                                                 const gchar* signal_name,
                                                                 GVariant* parameters);
static gchar** switchboard_plug_user_accounts_systemd_unit_dbus_proxy_get_names (SwitchboardPlugUserAccountsSystemdUnit* self,
                                                                          gint* result_length1);
static void switchboard_plug_user_accounts_systemd_unit_proxy_switchboard_plug_user_accounts_systemd_unit_interface_init (SwitchboardPlugUserAccountsSystemdUnitIface* iface);
static void switchboard_plug_user_accounts_systemd_unit_dbus_interface_method_call (GDBusConnection* connection,
                                                                             const gchar* sender,
                                                                             const gchar* object_path,
                                                                             const gchar* interface_name,
                                                                             const gchar* method_name,
                                                                             GVariant* parameters,
                                                                             GDBusMethodInvocation* invocation,
                                                                             gpointer user_data);
static GVariant* switchboard_plug_user_accounts_systemd_unit_dbus_interface_get_property (GDBusConnection* connection,
                                                                                   const gchar* sender,
                                                                                   const gchar* object_path,
                                                                                   const gchar* interface_name,
                                                                                   const gchar* property_name,
                                                                                   GError** error,
                                                                                   gpointer user_data);
static GVariant* _dbus_switchboard_plug_user_accounts_systemd_unit_get_names (SwitchboardPlugUserAccountsSystemdUnit* self);
static gboolean switchboard_plug_user_accounts_systemd_unit_dbus_interface_set_property (GDBusConnection* connection,
                                                                                  const gchar* sender,
                                                                                  const gchar* object_path,
                                                                                  const gchar* interface_name,
                                                                                  const gchar* property_name,
                                                                                  GVariant* value,
                                                                                  GError** error,
                                                                                  gpointer user_data);
static void _switchboard_plug_user_accounts_systemd_unit_unregister_object (gpointer user_data);
static GType switchboard_plug_user_accounts_systemd_manager_get_type_once (void);
static void switchboard_plug_user_accounts_systemd_manager_proxy_g_signal (GDBusProxy* proxy,
                                                                    const gchar* sender_name,
                                                                    const gchar* signal_name,
                                                                    GVariant* parameters);
static char* switchboard_plug_user_accounts_systemd_manager_proxy_get_unit (SwitchboardPlugUserAccountsSystemdManager* self,
                                                                     const gchar* name,
                                                                     GError** error);
static void switchboard_plug_user_accounts_systemd_manager_proxy_switchboard_plug_user_accounts_systemd_manager_interface_init (SwitchboardPlugUserAccountsSystemdManagerIface* iface);
static void _dbus_switchboard_plug_user_accounts_systemd_manager_get_unit (SwitchboardPlugUserAccountsSystemdManager* self,
                                                                    GVariant* _parameters_,
                                                                    GDBusMethodInvocation* invocation);
static void switchboard_plug_user_accounts_systemd_manager_dbus_interface_method_call (GDBusConnection* connection,
                                                                                const gchar* sender,
                                                                                const gchar* object_path,
                                                                                const gchar* interface_name,
                                                                                const gchar* method_name,
                                                                                GVariant* parameters,
                                                                                GDBusMethodInvocation* invocation,
                                                                                gpointer user_data);
static GVariant* switchboard_plug_user_accounts_systemd_manager_dbus_interface_get_property (GDBusConnection* connection,
                                                                                      const gchar* sender,
                                                                                      const gchar* object_path,
                                                                                      const gchar* interface_name,
                                                                                      const gchar* property_name,
                                                                                      GError** error,
                                                                                      gpointer user_data);
static gboolean switchboard_plug_user_accounts_systemd_manager_dbus_interface_set_property (GDBusConnection* connection,
                                                                                     const gchar* sender,
                                                                                     const gchar* object_path,
                                                                                     const gchar* interface_name,
                                                                                     const gchar* property_name,
                                                                                     GVariant* value,
                                                                                     GError** error,
                                                                                     gpointer user_data);
static void _switchboard_plug_user_accounts_systemd_manager_unregister_object (gpointer user_data);
static GType switchboard_plug_user_accounts_locale1_proxy_get_type_once (void);
static void switchboard_plug_user_accounts_locale1_proxy_proxy_g_signal (GDBusProxy* proxy,
                                                                  const gchar* sender_name,
                                                                  const gchar* signal_name,
                                                                  GVariant* parameters);
static gchar** switchboard_plug_user_accounts_locale1_proxy_dbus_proxy_get_locale (SwitchboardPlugUserAccountsLocale1Proxy* self,
                                                                            gint* result_length1);
static void switchboard_plug_user_accounts_locale1_proxy_proxy_switchboard_plug_user_accounts_locale1_proxy_interface_init (SwitchboardPlugUserAccountsLocale1ProxyIface* iface);
static void switchboard_plug_user_accounts_locale1_proxy_dbus_interface_method_call (GDBusConnection* connection,
                                                                              const gchar* sender,
                                                                              const gchar* object_path,
                                                                              const gchar* interface_name,
                                                                              const gchar* method_name,
                                                                              GVariant* parameters,
                                                                              GDBusMethodInvocation* invocation,
                                                                              gpointer user_data);
static GVariant* switchboard_plug_user_accounts_locale1_proxy_dbus_interface_get_property (GDBusConnection* connection,
                                                                                    const gchar* sender,
                                                                                    const gchar* object_path,
                                                                                    const gchar* interface_name,
                                                                                    const gchar* property_name,
                                                                                    GError** error,
                                                                                    gpointer user_data);
static GVariant* _dbus_switchboard_plug_user_accounts_locale1_proxy_get_locale (SwitchboardPlugUserAccountsLocale1Proxy* self);
static gboolean switchboard_plug_user_accounts_locale1_proxy_dbus_interface_set_property (GDBusConnection* connection,
                                                                                   const gchar* sender,
                                                                                   const gchar* object_path,
                                                                                   const gchar* interface_name,
                                                                                   const gchar* property_name,
                                                                                   GVariant* value,
                                                                                   GError** error,
                                                                                   gpointer user_data);
static void _switchboard_plug_user_accounts_locale1_proxy_unregister_object (gpointer user_data);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static const GDBusMethodInfo * const _switchboard_plug_user_accounts_systemd_unit_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _switchboard_plug_user_accounts_systemd_unit_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _switchboard_plug_user_accounts_systemd_unit_dbus_property_info_names = {-1, "Names", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _switchboard_plug_user_accounts_systemd_unit_dbus_property_info[] = {&_switchboard_plug_user_accounts_systemd_unit_dbus_property_info_names, NULL};
static const GDBusInterfaceInfo _switchboard_plug_user_accounts_systemd_unit_dbus_interface_info = {-1, "org.freedesktop.systemd1.Unit", (GDBusMethodInfo **) (&_switchboard_plug_user_accounts_systemd_unit_dbus_method_info), (GDBusSignalInfo **) (&_switchboard_plug_user_accounts_systemd_unit_dbus_signal_info), (GDBusPropertyInfo **) (&_switchboard_plug_user_accounts_systemd_unit_dbus_property_info), NULL};
static const GDBusInterfaceVTable _switchboard_plug_user_accounts_systemd_unit_dbus_interface_vtable = {switchboard_plug_user_accounts_systemd_unit_dbus_interface_method_call, switchboard_plug_user_accounts_systemd_unit_dbus_interface_get_property, switchboard_plug_user_accounts_systemd_unit_dbus_interface_set_property};
static const GDBusArgInfo _switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_name = {-1, "name", "s", NULL};
static const GDBusArgInfo _switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_result = {-1, "result", "o", NULL};
static const GDBusArgInfo * const _switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_in[] = {&_switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_name, NULL};
static const GDBusArgInfo * const _switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_out[] = {&_switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_result, NULL};
static const GDBusMethodInfo _switchboard_plug_user_accounts_systemd_manager_dbus_method_info_get_unit = {-1, "GetUnit", (GDBusArgInfo **) (&_switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_in), (GDBusArgInfo **) (&_switchboard_plug_user_accounts_systemd_manager_dbus_arg_info_get_unit_out), NULL};
static const GDBusMethodInfo * const _switchboard_plug_user_accounts_systemd_manager_dbus_method_info[] = {&_switchboard_plug_user_accounts_systemd_manager_dbus_method_info_get_unit, NULL};
static const GDBusSignalInfo * const _switchboard_plug_user_accounts_systemd_manager_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _switchboard_plug_user_accounts_systemd_manager_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _switchboard_plug_user_accounts_systemd_manager_dbus_interface_info = {-1, "org.freedesktop.systemd1.Manager", (GDBusMethodInfo **) (&_switchboard_plug_user_accounts_systemd_manager_dbus_method_info), (GDBusSignalInfo **) (&_switchboard_plug_user_accounts_systemd_manager_dbus_signal_info), (GDBusPropertyInfo **) (&_switchboard_plug_user_accounts_systemd_manager_dbus_property_info), NULL};
static const GDBusInterfaceVTable _switchboard_plug_user_accounts_systemd_manager_dbus_interface_vtable = {switchboard_plug_user_accounts_systemd_manager_dbus_interface_method_call, switchboard_plug_user_accounts_systemd_manager_dbus_interface_get_property, switchboard_plug_user_accounts_systemd_manager_dbus_interface_set_property};
static const GDBusMethodInfo * const _switchboard_plug_user_accounts_locale1_proxy_dbus_method_info[] = {NULL};
static const GDBusSignalInfo * const _switchboard_plug_user_accounts_locale1_proxy_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _switchboard_plug_user_accounts_locale1_proxy_dbus_property_info_locale = {-1, "Locale", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _switchboard_plug_user_accounts_locale1_proxy_dbus_property_info[] = {&_switchboard_plug_user_accounts_locale1_proxy_dbus_property_info_locale, NULL};
static const GDBusInterfaceInfo _switchboard_plug_user_accounts_locale1_proxy_dbus_interface_info = {-1, "org.freedesktop.locale1", (GDBusMethodInfo **) (&_switchboard_plug_user_accounts_locale1_proxy_dbus_method_info), (GDBusSignalInfo **) (&_switchboard_plug_user_accounts_locale1_proxy_dbus_signal_info), (GDBusPropertyInfo **) (&_switchboard_plug_user_accounts_locale1_proxy_dbus_property_info), NULL};
static const GDBusInterfaceVTable _switchboard_plug_user_accounts_locale1_proxy_dbus_interface_vtable = {switchboard_plug_user_accounts_locale1_proxy_dbus_interface_method_call, switchboard_plug_user_accounts_locale1_proxy_dbus_interface_get_property, switchboard_plug_user_accounts_locale1_proxy_dbus_interface_set_property};

gchar**
switchboard_plug_user_accounts_systemd_unit_get_names (SwitchboardPlugUserAccountsSystemdUnit* self,
                                                       gint* result_length1)
{
	SwitchboardPlugUserAccountsSystemdUnitIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SWITCHBOARD_PLUG_USER_ACCOUNTS_SYSTEMD_UNIT_GET_INTERFACE (self);
	if (_iface_->get_names) {
		return _iface_->get_names (self, result_length1);
	}
	return NULL;
}

static void
switchboard_plug_user_accounts_systemd_unit_default_init (SwitchboardPlugUserAccountsSystemdUnitIface * iface,
                                                          gpointer iface_data)
{
}

static GType
switchboard_plug_user_accounts_systemd_unit_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugUserAccountsSystemdUnitIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_user_accounts_systemd_unit_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType switchboard_plug_user_accounts_systemd_unit_type_id;
	switchboard_plug_user_accounts_systemd_unit_type_id = g_type_register_static (G_TYPE_INTERFACE, "SwitchboardPlugUserAccountsSystemdUnit", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (switchboard_plug_user_accounts_systemd_unit_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_unit_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) switchboard_plug_user_accounts_systemd_unit_proxy_get_type);
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_unit_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.systemd1.Unit");
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_unit_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_switchboard_plug_user_accounts_systemd_unit_dbus_interface_info));
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_unit_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) switchboard_plug_user_accounts_systemd_unit_register_object);
	return switchboard_plug_user_accounts_systemd_unit_type_id;
}

GType
switchboard_plug_user_accounts_systemd_unit_get_type (void)
{
	static volatile gsize switchboard_plug_user_accounts_systemd_unit_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_user_accounts_systemd_unit_type_id__once)) {
		GType switchboard_plug_user_accounts_systemd_unit_type_id;
		switchboard_plug_user_accounts_systemd_unit_type_id = switchboard_plug_user_accounts_systemd_unit_get_type_once ();
		g_once_init_leave (&switchboard_plug_user_accounts_systemd_unit_type_id__once, switchboard_plug_user_accounts_systemd_unit_type_id);
	}
	return switchboard_plug_user_accounts_systemd_unit_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SwitchboardPlugUserAccountsSystemdUnitProxy, switchboard_plug_user_accounts_systemd_unit_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_SYSTEMD_UNIT, switchboard_plug_user_accounts_systemd_unit_proxy_switchboard_plug_user_accounts_systemd_unit_interface_init) )
static void
switchboard_plug_user_accounts_systemd_unit_proxy_class_init (SwitchboardPlugUserAccountsSystemdUnitProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = switchboard_plug_user_accounts_systemd_unit_proxy_g_signal;
}

static void
switchboard_plug_user_accounts_systemd_unit_proxy_g_signal (GDBusProxy* proxy,
                                                            const gchar* sender_name,
                                                            const gchar* signal_name,
                                                            GVariant* parameters)
{
}

static void
switchboard_plug_user_accounts_systemd_unit_proxy_init (SwitchboardPlugUserAccountsSystemdUnitProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_switchboard_plug_user_accounts_systemd_unit_dbus_interface_info));
}

static gchar**
switchboard_plug_user_accounts_systemd_unit_dbus_proxy_get_names (SwitchboardPlugUserAccountsSystemdUnit* self,
                                                                  gint* result_length1)
{
	GVariant *_inner_reply;
	gchar** _result;
	gint _result_length1;
	gchar** _tmp0_;
	gint _tmp0__length;
	gint _tmp0__size;
	gint _tmp0__length1;
	GVariantIter _tmp1_;
	GVariant* _tmp2_;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Names");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.systemd1.Unit"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Names"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result_length1 = 0;
	_tmp0_ = g_new (gchar*, 5);
	_tmp0__length = 0;
	_tmp0__size = 4;
	_tmp0__length1 = 0;
	g_variant_iter_init (&_tmp1_, _inner_reply);
	for (; (_tmp2_ = g_variant_iter_next_value (&_tmp1_)) != NULL; _tmp0__length1++) {
		if (_tmp0__size == _tmp0__length) {
			_tmp0__size = 2 * _tmp0__size;
			_tmp0_ = g_renew (gchar*, _tmp0_, _tmp0__size + 1);
		}
		_tmp0_[_tmp0__length++] = g_variant_dup_string (_tmp2_, NULL);
		g_variant_unref (_tmp2_);
	}
	_result_length1 = _tmp0__length1;
	_tmp0_[_tmp0__length] = NULL;
	_result = _tmp0_;
	*result_length1 = _result_length1;
	g_variant_unref (_inner_reply);
	return _result;
}

static void
switchboard_plug_user_accounts_systemd_unit_proxy_switchboard_plug_user_accounts_systemd_unit_interface_init (SwitchboardPlugUserAccountsSystemdUnitIface* iface)
{
	iface->get_names = switchboard_plug_user_accounts_systemd_unit_dbus_proxy_get_names;
}

static void
switchboard_plug_user_accounts_systemd_unit_dbus_interface_method_call (GDBusConnection* connection,
                                                                        const gchar* sender,
                                                                        const gchar* object_path,
                                                                        const gchar* interface_name,
                                                                        const gchar* method_name,
                                                                        GVariant* parameters,
                                                                        GDBusMethodInvocation* invocation,
                                                                        gpointer user_data)
{
	g_object_unref (invocation);
}

static GVariant*
_dbus_switchboard_plug_user_accounts_systemd_unit_get_names (SwitchboardPlugUserAccountsSystemdUnit* self)
{
	gchar** result;
	gint result_length1 = 0;
	GVariant* _reply;
	gchar** _tmp3_;
	GVariantBuilder _tmp4_;
	gint _tmp5_;
	result = switchboard_plug_user_accounts_systemd_unit_get_names (self, &result_length1);
	_tmp3_ = result;
	g_variant_builder_init (&_tmp4_, G_VARIANT_TYPE ("as"));
	for (_tmp5_ = 0; _tmp5_ < result_length1; _tmp5_++) {
		g_variant_builder_add_value (&_tmp4_, g_variant_new_string (*_tmp3_));
		_tmp3_++;
	}
	_reply = g_variant_builder_end (&_tmp4_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	return _reply;
}

static GVariant*
switchboard_plug_user_accounts_systemd_unit_dbus_interface_get_property (GDBusConnection* connection,
                                                                         const gchar* sender,
                                                                         const gchar* object_path,
                                                                         const gchar* interface_name,
                                                                         const gchar* property_name,
                                                                         GError** error,
                                                                         gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Names") == 0) {
		return _dbus_switchboard_plug_user_accounts_systemd_unit_get_names (object);
	}
	return NULL;
}

static gboolean
switchboard_plug_user_accounts_systemd_unit_dbus_interface_set_property (GDBusConnection* connection,
                                                                         const gchar* sender,
                                                                         const gchar* object_path,
                                                                         const gchar* interface_name,
                                                                         const gchar* property_name,
                                                                         GVariant* value,
                                                                         GError** error,
                                                                         gpointer user_data)
{
	return FALSE;
}

guint
switchboard_plug_user_accounts_systemd_unit_register_object (gpointer object,
                                                             GDBusConnection* connection,
                                                             const gchar* path,
                                                             GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_switchboard_plug_user_accounts_systemd_unit_dbus_interface_info), &_switchboard_plug_user_accounts_systemd_unit_dbus_interface_vtable, data, _switchboard_plug_user_accounts_systemd_unit_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

char*
switchboard_plug_user_accounts_systemd_manager_get_unit (SwitchboardPlugUserAccountsSystemdManager* self,
                                                         const gchar* name,
                                                         GError** error)
{
	SwitchboardPlugUserAccountsSystemdManagerIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SWITCHBOARD_PLUG_USER_ACCOUNTS_SYSTEMD_MANAGER_GET_INTERFACE (self);
	if (_iface_->get_unit) {
		return _iface_->get_unit (self, name, error);
	}
	return NULL;
}

static void
switchboard_plug_user_accounts_systemd_manager_default_init (SwitchboardPlugUserAccountsSystemdManagerIface * iface,
                                                             gpointer iface_data)
{
}

static GType
switchboard_plug_user_accounts_systemd_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugUserAccountsSystemdManagerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_user_accounts_systemd_manager_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType switchboard_plug_user_accounts_systemd_manager_type_id;
	switchboard_plug_user_accounts_systemd_manager_type_id = g_type_register_static (G_TYPE_INTERFACE, "SwitchboardPlugUserAccountsSystemdManager", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (switchboard_plug_user_accounts_systemd_manager_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_manager_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) switchboard_plug_user_accounts_systemd_manager_proxy_get_type);
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.systemd1.Manager");
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_manager_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_switchboard_plug_user_accounts_systemd_manager_dbus_interface_info));
	g_type_set_qdata (switchboard_plug_user_accounts_systemd_manager_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) switchboard_plug_user_accounts_systemd_manager_register_object);
	return switchboard_plug_user_accounts_systemd_manager_type_id;
}

GType
switchboard_plug_user_accounts_systemd_manager_get_type (void)
{
	static volatile gsize switchboard_plug_user_accounts_systemd_manager_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_user_accounts_systemd_manager_type_id__once)) {
		GType switchboard_plug_user_accounts_systemd_manager_type_id;
		switchboard_plug_user_accounts_systemd_manager_type_id = switchboard_plug_user_accounts_systemd_manager_get_type_once ();
		g_once_init_leave (&switchboard_plug_user_accounts_systemd_manager_type_id__once, switchboard_plug_user_accounts_systemd_manager_type_id);
	}
	return switchboard_plug_user_accounts_systemd_manager_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SwitchboardPlugUserAccountsSystemdManagerProxy, switchboard_plug_user_accounts_systemd_manager_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_SYSTEMD_MANAGER, switchboard_plug_user_accounts_systemd_manager_proxy_switchboard_plug_user_accounts_systemd_manager_interface_init) )
static void
switchboard_plug_user_accounts_systemd_manager_proxy_class_init (SwitchboardPlugUserAccountsSystemdManagerProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = switchboard_plug_user_accounts_systemd_manager_proxy_g_signal;
}

static void
switchboard_plug_user_accounts_systemd_manager_proxy_g_signal (GDBusProxy* proxy,
                                                               const gchar* sender_name,
                                                               const gchar* signal_name,
                                                               GVariant* parameters)
{
}

static void
switchboard_plug_user_accounts_systemd_manager_proxy_init (SwitchboardPlugUserAccountsSystemdManagerProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_switchboard_plug_user_accounts_systemd_manager_dbus_interface_info));
}

static char*
switchboard_plug_user_accounts_systemd_manager_proxy_get_unit (SwitchboardPlugUserAccountsSystemdManager* self,
                                                               const gchar* name,
                                                               GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	char* _result = NULL;
	GVariant* _tmp6_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.systemd1.Manager", "GetUnit");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (name));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp6_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp6_, NULL);
	g_variant_unref (_tmp6_);
	g_object_unref (_reply_message);
	return _result;
}

static void
switchboard_plug_user_accounts_systemd_manager_proxy_switchboard_plug_user_accounts_systemd_manager_interface_init (SwitchboardPlugUserAccountsSystemdManagerIface* iface)
{
	iface->get_unit = switchboard_plug_user_accounts_systemd_manager_proxy_get_unit;
}

static void
_dbus_switchboard_plug_user_accounts_systemd_manager_get_unit (SwitchboardPlugUserAccountsSystemdManager* self,
                                                               GVariant* _parameters_,
                                                               GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* name = NULL;
	GVariant* _tmp7_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	char* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	name = g_variant_dup_string (_tmp7_, NULL);
	g_variant_unref (_tmp7_);
	result = switchboard_plug_user_accounts_systemd_manager_get_unit (self, name, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_object_path (result));
	_g_free0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (name);
	;
}

static void
switchboard_plug_user_accounts_systemd_manager_dbus_interface_method_call (GDBusConnection* connection,
                                                                           const gchar* sender,
                                                                           const gchar* object_path,
                                                                           const gchar* interface_name,
                                                                           const gchar* method_name,
                                                                           GVariant* parameters,
                                                                           GDBusMethodInvocation* invocation,
                                                                           gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetUnit") == 0) {
		_dbus_switchboard_plug_user_accounts_systemd_manager_get_unit (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
switchboard_plug_user_accounts_systemd_manager_dbus_interface_get_property (GDBusConnection* connection,
                                                                            const gchar* sender,
                                                                            const gchar* object_path,
                                                                            const gchar* interface_name,
                                                                            const gchar* property_name,
                                                                            GError** error,
                                                                            gpointer user_data)
{
	return NULL;
}

static gboolean
switchboard_plug_user_accounts_systemd_manager_dbus_interface_set_property (GDBusConnection* connection,
                                                                            const gchar* sender,
                                                                            const gchar* object_path,
                                                                            const gchar* interface_name,
                                                                            const gchar* property_name,
                                                                            GVariant* value,
                                                                            GError** error,
                                                                            gpointer user_data)
{
	return FALSE;
}

guint
switchboard_plug_user_accounts_systemd_manager_register_object (gpointer object,
                                                                GDBusConnection* connection,
                                                                const gchar* path,
                                                                GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_switchboard_plug_user_accounts_systemd_manager_dbus_interface_info), &_switchboard_plug_user_accounts_systemd_manager_dbus_interface_vtable, data, _switchboard_plug_user_accounts_systemd_manager_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

gchar**
switchboard_plug_user_accounts_locale1_proxy_get_locale (SwitchboardPlugUserAccountsLocale1Proxy* self,
                                                         gint* result_length1)
{
	SwitchboardPlugUserAccountsLocale1ProxyIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SWITCHBOARD_PLUG_USER_ACCOUNTS_LOCALE1_PROXY_GET_INTERFACE (self);
	if (_iface_->get_locale) {
		return _iface_->get_locale (self, result_length1);
	}
	return NULL;
}

static void
switchboard_plug_user_accounts_locale1_proxy_default_init (SwitchboardPlugUserAccountsLocale1ProxyIface * iface,
                                                           gpointer iface_data)
{
}

static GType
switchboard_plug_user_accounts_locale1_proxy_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugUserAccountsLocale1ProxyIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_user_accounts_locale1_proxy_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType switchboard_plug_user_accounts_locale1_proxy_type_id;
	switchboard_plug_user_accounts_locale1_proxy_type_id = g_type_register_static (G_TYPE_INTERFACE, "SwitchboardPlugUserAccountsLocale1Proxy", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (switchboard_plug_user_accounts_locale1_proxy_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (switchboard_plug_user_accounts_locale1_proxy_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) switchboard_plug_user_accounts_locale1_proxy_proxy_get_type);
	g_type_set_qdata (switchboard_plug_user_accounts_locale1_proxy_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.locale1");
	g_type_set_qdata (switchboard_plug_user_accounts_locale1_proxy_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_switchboard_plug_user_accounts_locale1_proxy_dbus_interface_info));
	g_type_set_qdata (switchboard_plug_user_accounts_locale1_proxy_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) switchboard_plug_user_accounts_locale1_proxy_register_object);
	return switchboard_plug_user_accounts_locale1_proxy_type_id;
}

GType
switchboard_plug_user_accounts_locale1_proxy_get_type (void)
{
	static volatile gsize switchboard_plug_user_accounts_locale1_proxy_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_user_accounts_locale1_proxy_type_id__once)) {
		GType switchboard_plug_user_accounts_locale1_proxy_type_id;
		switchboard_plug_user_accounts_locale1_proxy_type_id = switchboard_plug_user_accounts_locale1_proxy_get_type_once ();
		g_once_init_leave (&switchboard_plug_user_accounts_locale1_proxy_type_id__once, switchboard_plug_user_accounts_locale1_proxy_type_id);
	}
	return switchboard_plug_user_accounts_locale1_proxy_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SwitchboardPlugUserAccountsLocale1ProxyProxy, switchboard_plug_user_accounts_locale1_proxy_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_LOCALE1_PROXY, switchboard_plug_user_accounts_locale1_proxy_proxy_switchboard_plug_user_accounts_locale1_proxy_interface_init) )
static void
switchboard_plug_user_accounts_locale1_proxy_proxy_class_init (SwitchboardPlugUserAccountsLocale1ProxyProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = switchboard_plug_user_accounts_locale1_proxy_proxy_g_signal;
}

static void
switchboard_plug_user_accounts_locale1_proxy_proxy_g_signal (GDBusProxy* proxy,
                                                             const gchar* sender_name,
                                                             const gchar* signal_name,
                                                             GVariant* parameters)
{
}

static void
switchboard_plug_user_accounts_locale1_proxy_proxy_init (SwitchboardPlugUserAccountsLocale1ProxyProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_switchboard_plug_user_accounts_locale1_proxy_dbus_interface_info));
}

static gchar**
switchboard_plug_user_accounts_locale1_proxy_dbus_proxy_get_locale (SwitchboardPlugUserAccountsLocale1Proxy* self,
                                                                    gint* result_length1)
{
	GVariant *_inner_reply;
	gchar** _result;
	gint _result_length1;
	gchar** _tmp8_;
	gint _tmp8__length;
	gint _tmp8__size;
	gint _tmp8__length1;
	GVariantIter _tmp9_;
	GVariant* _tmp10_;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Locale");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.locale1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Locale"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result_length1 = 0;
	_tmp8_ = g_new (gchar*, 5);
	_tmp8__length = 0;
	_tmp8__size = 4;
	_tmp8__length1 = 0;
	g_variant_iter_init (&_tmp9_, _inner_reply);
	for (; (_tmp10_ = g_variant_iter_next_value (&_tmp9_)) != NULL; _tmp8__length1++) {
		if (_tmp8__size == _tmp8__length) {
			_tmp8__size = 2 * _tmp8__size;
			_tmp8_ = g_renew (gchar*, _tmp8_, _tmp8__size + 1);
		}
		_tmp8_[_tmp8__length++] = g_variant_dup_string (_tmp10_, NULL);
		g_variant_unref (_tmp10_);
	}
	_result_length1 = _tmp8__length1;
	_tmp8_[_tmp8__length] = NULL;
	_result = _tmp8_;
	*result_length1 = _result_length1;
	g_variant_unref (_inner_reply);
	return _result;
}

static void
switchboard_plug_user_accounts_locale1_proxy_proxy_switchboard_plug_user_accounts_locale1_proxy_interface_init (SwitchboardPlugUserAccountsLocale1ProxyIface* iface)
{
	iface->get_locale = switchboard_plug_user_accounts_locale1_proxy_dbus_proxy_get_locale;
}

static void
switchboard_plug_user_accounts_locale1_proxy_dbus_interface_method_call (GDBusConnection* connection,
                                                                         const gchar* sender,
                                                                         const gchar* object_path,
                                                                         const gchar* interface_name,
                                                                         const gchar* method_name,
                                                                         GVariant* parameters,
                                                                         GDBusMethodInvocation* invocation,
                                                                         gpointer user_data)
{
	g_object_unref (invocation);
}

static GVariant*
_dbus_switchboard_plug_user_accounts_locale1_proxy_get_locale (SwitchboardPlugUserAccountsLocale1Proxy* self)
{
	gchar** result;
	gint result_length1 = 0;
	GVariant* _reply;
	gchar** _tmp11_;
	GVariantBuilder _tmp12_;
	gint _tmp13_;
	result = switchboard_plug_user_accounts_locale1_proxy_get_locale (self, &result_length1);
	_tmp11_ = result;
	g_variant_builder_init (&_tmp12_, G_VARIANT_TYPE ("as"));
	for (_tmp13_ = 0; _tmp13_ < result_length1; _tmp13_++) {
		g_variant_builder_add_value (&_tmp12_, g_variant_new_string (*_tmp11_));
		_tmp11_++;
	}
	_reply = g_variant_builder_end (&_tmp12_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	return _reply;
}

static GVariant*
switchboard_plug_user_accounts_locale1_proxy_dbus_interface_get_property (GDBusConnection* connection,
                                                                          const gchar* sender,
                                                                          const gchar* object_path,
                                                                          const gchar* interface_name,
                                                                          const gchar* property_name,
                                                                          GError** error,
                                                                          gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Locale") == 0) {
		return _dbus_switchboard_plug_user_accounts_locale1_proxy_get_locale (object);
	}
	return NULL;
}

static gboolean
switchboard_plug_user_accounts_locale1_proxy_dbus_interface_set_property (GDBusConnection* connection,
                                                                          const gchar* sender,
                                                                          const gchar* object_path,
                                                                          const gchar* interface_name,
                                                                          const gchar* property_name,
                                                                          GVariant* value,
                                                                          GError** error,
                                                                          gpointer user_data)
{
	return FALSE;
}

guint
switchboard_plug_user_accounts_locale1_proxy_register_object (gpointer object,
                                                              GDBusConnection* connection,
                                                              const gchar* path,
                                                              GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_switchboard_plug_user_accounts_locale1_proxy_dbus_interface_info), &_switchboard_plug_user_accounts_locale1_proxy_dbus_interface_vtable, data, _switchboard_plug_user_accounts_locale1_proxy_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

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

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gchar**
_vala_array_dup2 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

gchar**
switchboard_plug_user_accounts_get_installed_languages (gint* result_length1)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar** result;
	_tmp0_ = switchboard_plug_user_accounts_installed_languages;
	_tmp0__length1 = switchboard_plug_user_accounts_installed_languages_length1;
	if (_tmp0_ != NULL) {
		gchar** _tmp1_;
		gint _tmp1__length1;
		gchar** _tmp2_;
		gint _tmp2__length1;
		gchar** _tmp3_;
		gint _tmp3__length1;
		_tmp1_ = switchboard_plug_user_accounts_installed_languages;
		_tmp1__length1 = switchboard_plug_user_accounts_installed_languages_length1;
		_tmp2_ = (_tmp1_ != NULL) ? _vala_array_dup1 (_tmp1_, _tmp1__length1) : _tmp1_;
		_tmp2__length1 = _tmp1__length1;
		_tmp3_ = _tmp2_;
		_tmp3__length1 = _tmp2__length1;
		if (result_length1) {
			*result_length1 = _tmp3__length1;
		}
		result = _tmp3_;
		return result;
	}
	_tmp5_ = _tmp4_ = gnome_get_all_locales ();
	switchboard_plug_user_accounts_installed_languages = (_vala_array_free (switchboard_plug_user_accounts_installed_languages, switchboard_plug_user_accounts_installed_languages_length1, (GDestroyNotify) g_free), NULL);
	switchboard_plug_user_accounts_installed_languages = _tmp5_;
	switchboard_plug_user_accounts_installed_languages_length1 = _vala_array_length (_tmp4_);
	_switchboard_plug_user_accounts_installed_languages_size_ = switchboard_plug_user_accounts_installed_languages_length1;
	_tmp6_ = switchboard_plug_user_accounts_installed_languages;
	_tmp6__length1 = switchboard_plug_user_accounts_installed_languages_length1;
	_tmp7_ = (_tmp6_ != NULL) ? _vala_array_dup2 (_tmp6_, _tmp6__length1) : _tmp6_;
	_tmp7__length1 = _tmp6__length1;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = _tmp7__length1;
	if (result_length1) {
		*result_length1 = _tmp8__length1;
	}
	result = _tmp8_;
	return result;
}

static gint
string_index_of (const gchar* self,
                 const gchar* needle,
                 gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (needle != NULL, -1);
	_tmp0_ = strstr (((gchar*) self) + start_index, (gchar*) needle);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

GeeHashMap*
switchboard_plug_user_accounts_get_default_regions (void)
{
	GeeHashMap* _tmp0_;
	gchar* file = NULL;
	gchar* _tmp2_;
	gchar* output = NULL;
	gchar* _tmp3_;
	GeeHashMap* _tmp8_;
	gchar** output_array = NULL;
	const gchar* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gint output_array_length1;
	gint _output_array_size_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	GeeHashMap* _tmp25_;
	GError* _inner_error0_ = NULL;
	GeeHashMap* result;
	_tmp0_ = switchboard_plug_user_accounts_default_regions;
	if (_tmp0_ != NULL) {
		GeeHashMap* _tmp1_;
		_tmp1_ = switchboard_plug_user_accounts_default_regions;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = g_strdup ("/usr/share/language-tools/main-countries");
	file = _tmp2_;
	_tmp3_ = g_strdup ("");
	output = _tmp3_;
	{
		const gchar* _tmp4_;
		gchar* _tmp5_ = NULL;
		_tmp4_ = file;
		g_file_get_contents (_tmp4_, &_tmp5_, NULL, &_inner_error0_);
		_g_free0 (output);
		output = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("Utils.vala:61: %s", _tmp7_);
		result = NULL;
		_g_error_free0 (e);
		_g_free0 (output);
		_g_free0 (file);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (output);
		_g_free0 (file);
		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;
	}
	_tmp8_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (switchboard_plug_user_accounts_default_regions);
	switchboard_plug_user_accounts_default_regions = _tmp8_;
	_tmp9_ = output;
	_tmp11_ = _tmp10_ = g_strsplit (_tmp9_, "\n", 0);
	output_array = _tmp11_;
	output_array_length1 = _vala_array_length (_tmp10_);
	_output_array_size_ = output_array_length1;
	_tmp12_ = output_array;
	_tmp12__length1 = output_array_length1;
	{
		gchar** line_collection = NULL;
		gint line_collection_length1 = 0;
		gint _line_collection_size_ = 0;
		gint line_it = 0;
		line_collection = _tmp12_;
		line_collection_length1 = _tmp12__length1;
		for (line_it = 0; line_it < line_collection_length1; line_it = line_it + 1) {
			gchar* _tmp13_;
			gchar* line = NULL;
			_tmp13_ = g_strdup (line_collection[line_it]);
			line = _tmp13_;
			{
				gboolean _tmp14_ = FALSE;
				const gchar* _tmp15_;
				_tmp15_ = line;
				if (g_strcmp0 (_tmp15_, "") != 0) {
					const gchar* _tmp16_;
					_tmp16_ = line;
					_tmp14_ = string_index_of (_tmp16_, "#", 0) == -1;
				} else {
					_tmp14_ = FALSE;
				}
				if (_tmp14_) {
					gchar** line_array = NULL;
					const gchar* _tmp17_;
					gchar** _tmp18_;
					gchar** _tmp19_;
					gint line_array_length1;
					gint _line_array_size_;
					GeeHashMap* _tmp20_;
					gchar** _tmp21_;
					gint _tmp21__length1;
					const gchar* _tmp22_;
					gchar** _tmp23_;
					gint _tmp23__length1;
					const gchar* _tmp24_;
					_tmp17_ = line;
					_tmp19_ = _tmp18_ = g_strsplit (_tmp17_, "\t", 0);
					line_array = _tmp19_;
					line_array_length1 = _vala_array_length (_tmp18_);
					_line_array_size_ = line_array_length1;
					_tmp20_ = switchboard_plug_user_accounts_default_regions;
					_tmp21_ = line_array;
					_tmp21__length1 = line_array_length1;
					_tmp22_ = _tmp21_[0];
					_tmp23_ = line_array;
					_tmp23__length1 = line_array_length1;
					_tmp24_ = _tmp23_[1];
					gee_abstract_map_set ((GeeAbstractMap*) _tmp20_, _tmp22_, _tmp24_);
					line_array = (_vala_array_free (line_array, line_array_length1, (GDestroyNotify) g_free), NULL);
				}
				_g_free0 (line);
			}
		}
	}
	_tmp25_ = switchboard_plug_user_accounts_default_regions;
	result = _tmp25_;
	output_array = (_vala_array_free (output_array, output_array_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (output);
	_g_free0 (file);
	return result;
}

GeeArrayList*
switchboard_plug_user_accounts_get_languages (void)
{
	GeeArrayList* languages = NULL;
	GeeArrayList* _tmp0_;
	gint _tmp1_ = 0;
	gchar** _tmp2_;
	GeeArrayList* result;
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	languages = _tmp0_;
	_tmp2_ = switchboard_plug_user_accounts_get_installed_languages (&_tmp1_);
	{
		gchar** locale_collection = NULL;
		gint locale_collection_length1 = 0;
		gint _locale_collection_size_ = 0;
		gint locale_it = 0;
		locale_collection = _tmp2_;
		locale_collection_length1 = _tmp1_;
		for (locale_it = 0; locale_it < locale_collection_length1; locale_it = locale_it + 1) {
			gchar* _tmp3_;
			gchar* locale = NULL;
			_tmp3_ = g_strdup (locale_collection[locale_it]);
			locale = _tmp3_;
			{
				gchar* code = NULL;
				const gchar* _tmp4_;
				gchar* _tmp5_ = NULL;
				gboolean _tmp6_;
				GeeArrayList* _tmp7_;
				const gchar* _tmp8_;
				_tmp4_ = locale;
				_tmp6_ = gnome_parse_locale (_tmp4_, &_tmp5_, NULL, NULL, NULL);
				_g_free0 (code);
				code = _tmp5_;
				if (!_tmp6_) {
					_g_free0 (code);
					_g_free0 (locale);
					continue;
				}
				_tmp7_ = languages;
				_tmp8_ = code;
				if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp7_, _tmp8_)) {
					GeeArrayList* _tmp9_;
					const gchar* _tmp10_;
					_tmp9_ = languages;
					_tmp10_ = code;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
				}
				_g_free0 (code);
				_g_free0 (locale);
			}
		}
		locale_collection = (_vala_array_free (locale_collection, locale_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = languages;
	return result;
}

GeeArrayList*
switchboard_plug_user_accounts_get_regions (const gchar* language)
{
	GeeArrayList* regions = NULL;
	GeeArrayList* _tmp0_;
	gint _tmp1_ = 0;
	gchar** _tmp2_;
	GeeArrayList* result;
	g_return_val_if_fail (language != NULL, NULL);
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	regions = _tmp0_;
	_tmp2_ = switchboard_plug_user_accounts_get_installed_languages (&_tmp1_);
	{
		gchar** locale_collection = NULL;
		gint locale_collection_length1 = 0;
		gint _locale_collection_size_ = 0;
		gint locale_it = 0;
		locale_collection = _tmp2_;
		locale_collection_length1 = _tmp1_;
		for (locale_it = 0; locale_it < locale_collection_length1; locale_it = locale_it + 1) {
			gchar* _tmp3_;
			gchar* locale = NULL;
			_tmp3_ = g_strdup (locale_collection[locale_it]);
			locale = _tmp3_;
			{
				gchar* code = NULL;
				gchar* region = NULL;
				const gchar* _tmp4_;
				gchar* _tmp5_ = NULL;
				gchar* _tmp6_ = NULL;
				gboolean _tmp7_;
				gboolean _tmp8_ = FALSE;
				GeeArrayList* _tmp9_;
				const gchar* _tmp10_;
				_tmp4_ = locale;
				_tmp7_ = gnome_parse_locale (_tmp4_, &_tmp5_, &_tmp6_, NULL, NULL);
				_g_free0 (code);
				code = _tmp5_;
				_g_free0 (region);
				region = _tmp6_;
				if (!_tmp7_) {
					_g_free0 (region);
					_g_free0 (code);
					_g_free0 (locale);
					continue;
				}
				_tmp9_ = regions;
				_tmp10_ = region;
				if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp9_, _tmp10_)) {
					const gchar* _tmp11_;
					_tmp11_ = code;
					_tmp8_ = g_strcmp0 (_tmp11_, language) == 0;
				} else {
					_tmp8_ = FALSE;
				}
				if (_tmp8_) {
					GeeArrayList* _tmp12_;
					const gchar* _tmp13_;
					_tmp12_ = regions;
					_tmp13_ = region;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
				}
				_g_free0 (region);
				_g_free0 (code);
				_g_free0 (locale);
			}
		}
		locale_collection = (_vala_array_free (locale_collection, locale_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = regions;
	return result;
}

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

PolkitPermission*
switchboard_plug_user_accounts_get_permission (void)
{
	PolkitPermission* _tmp0_;
	GError* _inner_error0_ = NULL;
	PolkitPermission* result;
	_tmp0_ = switchboard_plug_user_accounts_permission;
	if (_tmp0_ != NULL) {
		PolkitPermission* _tmp1_;
		PolkitPermission* _tmp2_;
		_tmp1_ = switchboard_plug_user_accounts_permission;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		result = _tmp2_;
		return result;
	}
	{
		PolkitPermission* _tmp3_ = NULL;
		PolkitUnixProcess* _tmp4_;
		PolkitUnixProcess* _tmp5_;
		PolkitPermission* _tmp6_;
		PolkitPermission* _tmp7_;
		PolkitPermission* _tmp8_;
		PolkitPermission* _tmp9_;
		PolkitPermission* _tmp10_;
		_tmp4_ = (PolkitUnixProcess*) polkit_unix_process_new ((gint) getpid ());
		_tmp5_ = _tmp4_;
		_tmp6_ = (PolkitPermission*) polkit_permission_new_sync ("io.elementary.settings.useraccounts.administration", (PolkitSubject*) _tmp5_, NULL, &_inner_error0_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_tmp3_ = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp8_ = _tmp3_;
		_tmp3_ = NULL;
		_g_object_unref0 (switchboard_plug_user_accounts_permission);
		switchboard_plug_user_accounts_permission = _tmp8_;
		_tmp9_ = switchboard_plug_user_accounts_permission;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		result = _tmp10_;
		_g_object_unref0 (_tmp3_);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp11_;
		const gchar* _tmp12_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp11_ = e;
		_tmp12_ = _tmp11_->message;
		g_critical ("Utils.vala:117: %s", _tmp12_);
		result = NULL;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	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;
}

ActUserManager*
switchboard_plug_user_accounts_get_usermanager (void)
{
	gboolean _tmp0_ = FALSE;
	ActUserManager* _tmp1_;
	ActUserManager* _tmp6_;
	ActUserManager* _tmp7_;
	ActUserManager* _tmp8_;
	ActUserManager* result;
	_tmp1_ = switchboard_plug_user_accounts_usermanager;
	if (_tmp1_ != NULL) {
		ActUserManager* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = switchboard_plug_user_accounts_usermanager;
		g_object_get (_tmp2_, "is-loaded", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ActUserManager* _tmp5_;
		_tmp5_ = switchboard_plug_user_accounts_usermanager;
		result = _tmp5_;
		return result;
	}
	_tmp6_ = act_user_manager_get_default ();
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_g_object_unref0 (switchboard_plug_user_accounts_usermanager);
	switchboard_plug_user_accounts_usermanager = _tmp7_;
	_tmp8_ = switchboard_plug_user_accounts_usermanager;
	result = _tmp8_;
	return result;
}

ActUser*
switchboard_plug_user_accounts_get_current_user (void)
{
	ActUser* _tmp0_;
	ActUserManager* _tmp2_;
	GSList* _tmp3_;
	ActUser* _tmp9_;
	ActUser* result;
	_tmp0_ = switchboard_plug_user_accounts_current_user;
	if (_tmp0_ != NULL) {
		ActUser* _tmp1_;
		_tmp1_ = switchboard_plug_user_accounts_current_user;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = switchboard_plug_user_accounts_get_usermanager ();
	_tmp3_ = act_user_manager_list_users (_tmp2_);
	{
		GSList* user_collection = NULL;
		GSList* user_it = NULL;
		user_collection = _tmp3_;
		for (user_it = user_collection; user_it != NULL; user_it = user_it->next) {
			ActUser* user = NULL;
			user = (ActUser*) user_it->data;
			{
				ActUser* _tmp4_;
				const gchar* _tmp5_;
				const gchar* _tmp6_;
				_tmp4_ = user;
				_tmp5_ = act_user_get_user_name (_tmp4_);
				_tmp6_ = g_get_user_name ();
				if (g_strcmp0 (_tmp5_, _tmp6_) == 0) {
					ActUser* _tmp7_;
					ActUser* _tmp8_;
					_tmp7_ = user;
					_tmp8_ = _g_object_ref0 (_tmp7_);
					_g_object_unref0 (switchboard_plug_user_accounts_current_user);
					switchboard_plug_user_accounts_current_user = _tmp8_;
					break;
				}
			}
		}
		(user_collection == NULL) ? NULL : (user_collection = (g_slist_free (user_collection), NULL));
	}
	_tmp9_ = switchboard_plug_user_accounts_current_user;
	result = _tmp9_;
	return result;
}

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

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

GList*
switchboard_plug_user_accounts_get_removal_list (void)
{
	GList* _tmp0_;
	GList* _tmp2_;
	GList* result;
	_tmp0_ = switchboard_plug_user_accounts_removal_list;
	if (_tmp0_ != NULL) {
		GList* _tmp1_;
		_tmp1_ = switchboard_plug_user_accounts_removal_list;
		result = _tmp1_;
		return result;
	}
	(switchboard_plug_user_accounts_removal_list == NULL) ? NULL : (switchboard_plug_user_accounts_removal_list = (_g_list_free__g_object_unref0_ (switchboard_plug_user_accounts_removal_list), NULL));
	switchboard_plug_user_accounts_removal_list = NULL;
	_tmp2_ = switchboard_plug_user_accounts_removal_list;
	result = _tmp2_;
	return result;
}

void
switchboard_plug_user_accounts_clear_removal_list (void)
{
	(switchboard_plug_user_accounts_removal_list == NULL) ? NULL : (switchboard_plug_user_accounts_removal_list = (_g_list_free__g_object_unref0_ (switchboard_plug_user_accounts_removal_list), NULL));
	switchboard_plug_user_accounts_removal_list = NULL;
}

void
switchboard_plug_user_accounts_mark_removal (ActUser* user)
{
	GList* _tmp0_;
	ActUser* _tmp1_;
	g_return_if_fail (user != NULL);
	_tmp0_ = switchboard_plug_user_accounts_removal_list;
	if (_tmp0_ == NULL) {
		switchboard_plug_user_accounts_get_removal_list ();
	}
	_tmp1_ = _g_object_ref0 (user);
	switchboard_plug_user_accounts_removal_list = g_list_append (switchboard_plug_user_accounts_removal_list, _tmp1_);
}

static GList*
vala_g_list_remove_full (GList* self,
                         gconstpointer data,
                         GFreeFunc func)
{
	GList* l = NULL;
	GList* result;
	l = self;
	while (TRUE) {
		GList* _tmp0_;
		GList* _tmp1_;
		gconstpointer _tmp2_;
		_tmp0_ = l;
		if (!(_tmp0_ != NULL)) {
			break;
		}
		_tmp1_ = l;
		_tmp2_ = ((GList*) _tmp1_)->data;
		if (_tmp2_ != data) {
			GList* _tmp3_;
			GList* _tmp4_;
			_tmp3_ = l;
			_tmp4_ = ((GList*) _tmp3_)->next;
			l = _tmp4_;
		} else {
			GList* _tmp5_;
			gconstpointer _tmp6_;
			GList* _tmp7_;
			_tmp5_ = l;
			_tmp6_ = ((GList*) _tmp5_)->data;
			func (_tmp6_);
			_tmp7_ = l;
			self = g_list_delete_link (self, (GList*) _tmp7_);
			break;
		}
	}
	result = self;
	return result;
}

void
switchboard_plug_user_accounts_undo_removal (void)
{
	gboolean _tmp0_ = FALSE;
	GList* _tmp1_;
	_tmp1_ = switchboard_plug_user_accounts_removal_list;
	if (_tmp1_ != NULL) {
		GList* _tmp2_;
		GList* _tmp3_;
		_tmp2_ = switchboard_plug_user_accounts_removal_list;
		_tmp3_ = g_list_last (_tmp2_);
		_tmp0_ = _tmp3_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GList* _tmp4_;
		GList* _tmp5_;
		gconstpointer _tmp6_;
		_tmp4_ = switchboard_plug_user_accounts_removal_list;
		_tmp5_ = g_list_last (_tmp4_);
		_tmp6_ = _tmp5_->data;
		switchboard_plug_user_accounts_removal_list = vala_g_list_remove_full (switchboard_plug_user_accounts_removal_list, (ActUser*) _tmp6_, _g_object_unref0_);
	}
}

gboolean
switchboard_plug_user_accounts_check_removal (ActUser* user)
{
	gboolean _tmp0_ = FALSE;
	GList* _tmp1_;
	gboolean result;
	g_return_val_if_fail (user != NULL, FALSE);
	_tmp1_ = switchboard_plug_user_accounts_removal_list;
	if (_tmp1_ != NULL) {
		GList* _tmp2_;
		GList* _tmp3_;
		_tmp2_ = switchboard_plug_user_accounts_removal_list;
		_tmp3_ = g_list_last (_tmp2_);
		_tmp0_ = _tmp3_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GList* find = NULL;
		GList* _tmp4_;
		GList* _tmp5_;
		GList* _tmp6_;
		_tmp4_ = switchboard_plug_user_accounts_removal_list;
		_tmp5_ = g_list_find (_tmp4_, user);
		find = _tmp5_;
		_tmp6_ = find;
		if (_tmp6_ != NULL) {
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

gboolean
switchboard_plug_user_accounts_is_last_admin (ActUser* user)
{
	gboolean result;
	if (user != NULL) {
		ActUserManager* _tmp0_;
		GSList* _tmp1_;
		_tmp0_ = switchboard_plug_user_accounts_get_usermanager ();
		_tmp1_ = act_user_manager_list_users (_tmp0_);
		{
			GSList* temp_user_collection = NULL;
			GSList* temp_user_it = NULL;
			temp_user_collection = _tmp1_;
			for (temp_user_it = temp_user_collection; temp_user_it != NULL; temp_user_it = temp_user_it->next) {
				ActUser* temp_user = NULL;
				temp_user = (ActUser*) temp_user_it->data;
				{
					gboolean _tmp2_ = FALSE;
					ActUser* _tmp3_;
					_tmp3_ = temp_user;
					if (_tmp3_ != user) {
						ActUser* _tmp4_;
						_tmp4_ = temp_user;
						_tmp2_ = act_user_get_account_type (_tmp4_) == ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR;
					} else {
						_tmp2_ = FALSE;
					}
					if (_tmp2_) {
						result = FALSE;
						(temp_user_collection == NULL) ? NULL : (temp_user_collection = (g_slist_free (temp_user_collection), NULL));
						return result;
					}
				}
			}
			(temp_user_collection == NULL) ? NULL : (temp_user_collection = (g_slist_free (temp_user_collection), NULL));
		}
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gboolean
switchboard_plug_user_accounts_is_valid_username (const gchar* username)
{
	gboolean _tmp4_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (username != NULL, FALSE);
	{
		GRegex* _tmp0_ = NULL;
		GRegex* _tmp1_;
		_tmp1_ = g_regex_new ("^[a-z]+[a-z0-9]*$", 0, 0, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (g_regex_match (_tmp0_, username, 0, NULL)) {
			result = TRUE;
			_g_regex_unref0 (_tmp0_);
			return result;
		}
		result = FALSE;
		_g_regex_unref0 (_tmp0_);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_critical ("Utils.vala:205: %s", _tmp3_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	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 _tmp4_;
}

gboolean
switchboard_plug_user_accounts_is_taken_username (const gchar* username)
{
	ActUserManager* _tmp0_;
	GSList* _tmp1_;
	gboolean result;
	g_return_val_if_fail (username != NULL, FALSE);
	_tmp0_ = switchboard_plug_user_accounts_get_usermanager ();
	_tmp1_ = act_user_manager_list_users (_tmp0_);
	{
		GSList* user_collection = NULL;
		GSList* user_it = NULL;
		user_collection = _tmp1_;
		for (user_it = user_collection; user_it != NULL; user_it = user_it->next) {
			ActUser* user = NULL;
			user = (ActUser*) user_it->data;
			{
				ActUser* _tmp2_;
				const gchar* _tmp3_;
				_tmp2_ = user;
				_tmp3_ = act_user_get_user_name (_tmp2_);
				if (g_strcmp0 (_tmp3_, username) == 0) {
					result = TRUE;
					(user_collection == NULL) ? NULL : (user_collection = (g_slist_free (user_collection), NULL));
					return result;
				}
			}
		}
		(user_collection == NULL) ? NULL : (user_collection = (g_slist_free (user_collection), NULL));
	}
	result = FALSE;
	return result;
}

static gchar*
string_to_utf8 (const gchar* self,
                gint* result_length1)
{
	gint string_length = 0;
	gint _tmp0_;
	gint _tmp1_;
	gchar* _result_ = NULL;
	gchar* _tmp2_;
	gint _result__length1;
	gint __result__size_;
	gint _tmp3_;
	gchar* _tmp4_;
	gint _tmp4__length1;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = _tmp1_;
	_tmp2_ = g_new0 (gchar, string_length + 1);
	_result_ = _tmp2_;
	_result__length1 = string_length + 1;
	__result__size_ = _result__length1;
	_tmp3_ = _result__length1;
	_result__length1 = _tmp3_ - 1;
	memcpy (_result_, self, (gsize) string_length);
	_tmp4_ = _result_;
	_tmp4__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}

gchar*
switchboard_plug_user_accounts_gen_username (const gchar* fullname)
{
	gchar* username = NULL;
	gchar* _tmp0_;
	gboolean met_alpha = FALSE;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_ = 0;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint _tmp5__length1;
	gchar* result;
	g_return_val_if_fail (fullname != NULL, NULL);
	_tmp0_ = g_strdup ("");
	username = _tmp0_;
	met_alpha = FALSE;
	_tmp1_ = g_str_to_ascii (fullname, NULL);
	_tmp2_ = _tmp1_;
	_tmp4_ = string_to_utf8 (_tmp2_, &_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp3_;
	_g_free0 (_tmp2_);
	{
		gchar* c_collection = NULL;
		gint c_collection_length1 = 0;
		gint _c_collection_size_ = 0;
		gint c_it = 0;
		c_collection = _tmp5_;
		c_collection_length1 = _tmp5__length1;
		for (c_it = 0; c_it < c_collection_length1; c_it = c_it + 1) {
			gchar c = '\0';
			c = c_collection[c_it];
			{
				if (g_ascii_isalpha (c)) {
					const gchar* _tmp6_;
					gchar* _tmp7_;
					gchar* _tmp8_;
					gchar* _tmp9_;
					gchar* _tmp10_;
					gchar* _tmp11_;
					_tmp6_ = username;
					_tmp7_ = g_strdup_printf ("%c", c);
					_tmp8_ = _tmp7_;
					_tmp9_ = g_utf8_strdown (_tmp8_, (gssize) -1);
					_tmp10_ = _tmp9_;
					_tmp11_ = g_strconcat (_tmp6_, _tmp10_, NULL);
					_g_free0 (username);
					username = _tmp11_;
					_g_free0 (_tmp10_);
					_g_free0 (_tmp8_);
					met_alpha = TRUE;
				} else {
					gboolean _tmp12_ = FALSE;
					if (g_ascii_isdigit (c)) {
						_tmp12_ = met_alpha;
					} else {
						_tmp12_ = FALSE;
					}
					if (_tmp12_) {
						const gchar* _tmp13_;
						gchar* _tmp14_;
						gchar* _tmp15_;
						gchar* _tmp16_;
						_tmp13_ = username;
						_tmp14_ = g_strdup_printf ("%c", c);
						_tmp15_ = _tmp14_;
						_tmp16_ = g_strconcat (_tmp13_, _tmp15_, NULL);
						_g_free0 (username);
						username = _tmp16_;
						_g_free0 (_tmp15_);
					}
				}
			}
		}
		c_collection = (g_free (c_collection), NULL);
	}
	result = username;
	return result;
}

 PasswdHandler*
switchboard_plug_user_accounts_get_passwd_handler (gboolean _force_new)
{
	gboolean _tmp0_ = FALSE;
	 PasswdHandler* _tmp1_;
	 PasswdHandler* _tmp3_;
	 PasswdHandler* _tmp4_;
	 PasswdHandler* result;
	_tmp1_ = switchboard_plug_user_accounts_passwd_handler;
	if (_tmp1_ != NULL) {
		_tmp0_ = !_force_new;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		 PasswdHandler* _tmp2_;
		_tmp2_ = switchboard_plug_user_accounts_passwd_handler;
		result = _tmp2_;
		return result;
	}
	_tmp3_ = passwd_init ();
	_passwd_destroy0 (switchboard_plug_user_accounts_passwd_handler);
	switchboard_plug_user_accounts_passwd_handler = _tmp3_;
	_tmp4_ = switchboard_plug_user_accounts_passwd_handler;
	result = _tmp4_;
	return result;
}

gboolean
switchboard_plug_user_accounts_get_guest_session_state (const gchar* option)
{
	const gchar* _tmp0_;
	gchar* output = NULL;
	gint status = 0;
	gboolean _tmp15_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (option != NULL, FALSE);
	_tmp0_ = switchboard_plug_user_accounts_get_display_manager ();
	if (g_strcmp0 (_tmp0_, "lightdm") != 0) {
		result = FALSE;
		return result;
	}
	{
		gchar* cli = NULL;
		gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar** _tmp5_;
		gchar** _tmp6_;
		gint _tmp6__length1;
		gchar** _tmp7_;
		gchar** _tmp8_;
		gchar** _tmp9_;
		gint _tmp9__length1;
		gchar* _tmp10_ = NULL;
		gint _tmp11_ = 0;
		const gchar* _tmp12_;
		_tmp1_ = g_strdup_printf ("%s/guest-session-toggle", BUILD_PKGDATADIR);
		cli = _tmp1_;
		_tmp2_ = cli;
		_tmp3_ = g_strdup (_tmp2_);
		_tmp4_ = g_strdup_printf ("--%s", option);
		_tmp5_ = g_new0 (gchar*, 2 + 1);
		_tmp5_[0] = _tmp3_;
		_tmp5_[1] = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp6__length1 = 2;
		_tmp8_ = _tmp7_ = g_get_environ ();
		_tmp9_ = _tmp8_;
		_tmp9__length1 = _vala_array_length (_tmp7_);
		g_spawn_sync (NULL, _tmp6_, _tmp9_, G_SPAWN_SEARCH_PATH, NULL, NULL, &_tmp10_, NULL, &_tmp11_, &_inner_error0_);
		_g_free0 (output);
		output = _tmp10_;
		status = _tmp11_;
		_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_free), NULL);
		_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (cli);
			goto __catch0_g_error;
		}
		_tmp12_ = output;
		result = g_strcmp0 (_tmp12_, "on\n") == 0;
		_g_free0 (cli);
		_g_free0 (output);
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		g_warning ("Utils.vala:268: %s", _tmp14_);
		result = FALSE;
		_g_error_free0 (e);
		_g_free0 (output);
		return result;
	}
	__finally0:
	_g_free0 (output);
	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 _tmp15_;
}

void
switchboard_plug_user_accounts_set_guest_session_state (const gchar* option)
{
	const gchar* _tmp0_;
	PolkitPermission* _tmp1_;
	PolkitPermission* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (option != NULL);
	_tmp0_ = switchboard_plug_user_accounts_get_display_manager ();
	if (g_strcmp0 (_tmp0_, "lightdm") != 0) {
		return;
	}
	_tmp1_ = switchboard_plug_user_accounts_get_permission ();
	_tmp2_ = _tmp1_;
	_tmp3_ = g_permission_get_allowed ((GPermission*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	if (_tmp5_) {
		gchar* output = NULL;
		gint status = 0;
		{
			gchar* cli = NULL;
			gchar* _tmp6_;
			gchar* _tmp7_;
			const gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			gchar** _tmp11_;
			gchar** _tmp12_;
			gint _tmp12__length1;
			gchar** _tmp13_;
			gchar** _tmp14_;
			gchar** _tmp15_;
			gint _tmp15__length1;
			gchar* _tmp16_ = NULL;
			gint _tmp17_ = 0;
			_tmp6_ = g_strdup_printf ("%s/guest-session-toggle", BUILD_PKGDATADIR);
			cli = _tmp6_;
			_tmp7_ = g_strdup ("pkexec");
			_tmp8_ = cli;
			_tmp9_ = g_strdup (_tmp8_);
			_tmp10_ = g_strdup_printf ("--%s", option);
			_tmp11_ = g_new0 (gchar*, 3 + 1);
			_tmp11_[0] = _tmp7_;
			_tmp11_[1] = _tmp9_;
			_tmp11_[2] = _tmp10_;
			_tmp12_ = _tmp11_;
			_tmp12__length1 = 3;
			_tmp14_ = _tmp13_ = g_get_environ ();
			_tmp15_ = _tmp14_;
			_tmp15__length1 = _vala_array_length (_tmp13_);
			g_spawn_sync (NULL, _tmp12_, _tmp15_, G_SPAWN_SEARCH_PATH, NULL, NULL, &_tmp16_, NULL, &_tmp17_, &_inner_error0_);
			_g_free0 (output);
			output = _tmp16_;
			status = _tmp17_;
			_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
			_tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (cli);
				goto __catch0_g_error;
			}
			_g_free0 (cli);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp18_;
			const gchar* _tmp19_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp18_ = e;
			_tmp19_ = _tmp18_->message;
			g_warning ("Utils.vala:294: %s", _tmp19_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (output);
			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;
		}
		_g_free0 (output);
	}
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static gint
string_last_index_of (const gchar* self,
                      const gchar* needle,
                      gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (needle != NULL, -1);
	_tmp0_ = g_strrstr (((gchar*) self) + start_index, (gchar*) needle);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

static gchar*
string_chomp (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strchomp (_result_);
	result = _result_;
	return result;
}

const gchar*
switchboard_plug_user_accounts_get_display_manager (void)
{
	const gchar* _tmp0_;
	gchar* output = NULL;
	gchar* _tmp17_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	gint _tmp24_;
	gint _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	GError* _inner_error0_ = NULL;
	const gchar* result;
	_tmp0_ = switchboard_plug_user_accounts_display_manager;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		_tmp1_ = switchboard_plug_user_accounts_display_manager;
		result = _tmp1_;
		return result;
	}
	{
		SwitchboardPlugUserAccountsSystemdManager* systemd = NULL;
		SwitchboardPlugUserAccountsSystemdManager* _tmp2_;
		char* dm_path = NULL;
		SwitchboardPlugUserAccountsSystemdManager* _tmp3_;
		char* _tmp4_;
		SwitchboardPlugUserAccountsSystemdUnit* dm = NULL;
		const char* _tmp5_;
		SwitchboardPlugUserAccountsSystemdUnit* _tmp6_;
		SwitchboardPlugUserAccountsSystemdUnit* _tmp7_;
		gchar** _tmp8_;
		gint _tmp8__length1;
		gint _tmp9_ = 0;
		gchar** _tmp10_;
		gint _tmp10__length1;
		_tmp2_ = (SwitchboardPlugUserAccountsSystemdManager*) g_initable_new (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_SYSTEMD_MANAGER_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.systemd1", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", "/org/freedesktop/systemd1", "g-interface-name", "org.freedesktop.systemd1.Manager", NULL);
		systemd = (SwitchboardPlugUserAccountsSystemdManager*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = systemd;
		_tmp4_ = switchboard_plug_user_accounts_systemd_manager_get_unit (_tmp3_, "display-manager.service", &_inner_error0_);
		dm_path = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (systemd);
			goto __catch0_g_error;
		}
		_tmp5_ = dm_path;
		_tmp6_ = (SwitchboardPlugUserAccountsSystemdUnit*) g_initable_new (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_SYSTEMD_UNIT_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.systemd1", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", (const gchar*) _tmp5_, "g-interface-name", "org.freedesktop.systemd1.Unit", NULL);
		dm = (SwitchboardPlugUserAccountsSystemdUnit*) _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (dm_path);
			_g_object_unref0 (systemd);
			goto __catch0_g_error;
		}
		_tmp7_ = dm;
		_tmp8_ = switchboard_plug_user_accounts_systemd_unit_get_names (_tmp7_, &_tmp9_);
		_tmp8__length1 = _tmp9_;
		_tmp10_ = _tmp8_;
		_tmp10__length1 = _tmp8__length1;
		{
			gchar** name_collection = NULL;
			gint name_collection_length1 = 0;
			gint _name_collection_size_ = 0;
			gint name_it = 0;
			name_collection = _tmp10_;
			name_collection_length1 = _tmp10__length1;
			for (name_it = 0; name_it < name_collection_length1; name_it = name_it + 1) {
				const gchar* name = NULL;
				name = name_collection[name_it];
				{
					const gchar* _tmp11_;
					_tmp11_ = name;
					if (g_strcmp0 (_tmp11_, "display-manager.service") != 0) {
						const gchar* _tmp12_;
						gchar* _tmp13_;
						const gchar* _tmp14_;
						_tmp12_ = name;
						_tmp13_ = string_replace (_tmp12_, ".service", "");
						_g_free0 (switchboard_plug_user_accounts_display_manager);
						switchboard_plug_user_accounts_display_manager = _tmp13_;
						_tmp14_ = switchboard_plug_user_accounts_display_manager;
						result = _tmp14_;
						name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_object_unref0 (dm);
						_g_free0 (dm_path);
						_g_object_unref0 (systemd);
						return result;
					}
				}
			}
			name_collection = (_vala_array_free (name_collection, name_collection_length1, (GDestroyNotify) g_free), NULL);
		}
		_g_object_unref0 (dm);
		_g_free0 (dm_path);
		_g_object_unref0 (systemd);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp15_;
		const gchar* _tmp16_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp15_ = e;
		_tmp16_ = _tmp15_->message;
		g_warning ("Utils.vala:330: Unable to get display manager name from systemd, falli" \
"ng back to config files: %s", _tmp16_);
		_g_error_free0 (e);
	}
	__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 NULL;
	}
	_tmp17_ = g_strdup ("");
	output = _tmp17_;
	{
		gchar* _tmp18_ = NULL;
		g_file_get_contents ("/etc/X11/default-display-manager", &_tmp18_, NULL, &_inner_error0_);
		_g_free0 (output);
		output = _tmp18_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = e;
		_tmp20_ = _tmp19_->message;
		g_critical ("Utils.vala:339: %s", _tmp20_);
		result = "";
		_g_error_free0 (e);
		_g_free0 (output);
		return result;
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (output);
		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;
	}
	_tmp21_ = output;
	_tmp22_ = output;
	_tmp23_ = output;
	_tmp24_ = strlen (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = string_slice (_tmp21_, (glong) (string_last_index_of (_tmp22_, "/", 0) + 1), (glong) _tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = string_chomp (_tmp27_);
	_g_free0 (switchboard_plug_user_accounts_display_manager);
	switchboard_plug_user_accounts_display_manager = _tmp28_;
	_g_free0 (_tmp27_);
	_tmp29_ = switchboard_plug_user_accounts_display_manager;
	result = _tmp29_;
	_g_free0 (output);
	return result;
}

gchar*
switchboard_plug_user_accounts_get_system_locale (void)
{
	GError* _inner_error0_ = NULL;
	gchar* result;
	{
		SwitchboardPlugUserAccountsLocale1Proxy* locale_bus = NULL;
		SwitchboardPlugUserAccountsLocale1Proxy* _tmp0_;
		gchar** _tmp1_;
		gint _tmp1__length1;
		gint _tmp2_ = 0;
		gchar** _tmp3_;
		gint _tmp3__length1;
		_tmp0_ = (SwitchboardPlugUserAccountsLocale1Proxy*) g_initable_new (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_LOCALE1_PROXY_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.freedesktop.locale1", "g-bus-type", G_BUS_TYPE_SYSTEM, "g-object-path", "/org/freedesktop/locale1", "g-interface-name", "org.freedesktop.locale1", NULL);
		locale_bus = (SwitchboardPlugUserAccountsLocale1Proxy*) _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = switchboard_plug_user_accounts_locale1_proxy_get_locale (locale_bus, &_tmp2_);
		_tmp1__length1 = _tmp2_;
		_tmp3_ = _tmp1_;
		_tmp3__length1 = _tmp1__length1;
		{
			gchar** locale_collection = NULL;
			gint locale_collection_length1 = 0;
			gint _locale_collection_size_ = 0;
			gint locale_it = 0;
			locale_collection = _tmp3_;
			locale_collection_length1 = _tmp3__length1;
			for (locale_it = 0; locale_it < locale_collection_length1; locale_it = locale_it + 1) {
				const gchar* locale = NULL;
				locale = locale_collection[locale_it];
				{
					const gchar* _tmp4_;
					_tmp4_ = locale;
					if (g_str_has_prefix (_tmp4_, "LANG=")) {
						const gchar* _tmp5_;
						gchar* _tmp6_;
						_tmp5_ = locale;
						_tmp6_ = string_replace (_tmp5_, "LANG=", "");
						result = _tmp6_;
						locale_collection = (_vala_array_free (locale_collection, locale_collection_length1, (GDestroyNotify) g_free), NULL);
						_g_object_unref0 (locale_bus);
						return result;
					}
				}
			}
			locale_collection = (_vala_array_free (locale_collection, locale_collection_length1, (GDestroyNotify) g_free), NULL);
		}
		_g_object_unref0 (locale_bus);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_warning ("Utils.vala:361: Unable to get locale from locale1 bus: %s", _tmp8_);
		result = NULL;
		_g_error_free0 (e);
		return result;
	}
	__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 NULL;
	}
	result = NULL;
	return result;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

