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

/* 
 *      Copyright 2011 Julien Lavergne <gilir@ubuntu.com>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 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.
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <unistd.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define LXSESSION_TYPE_LXSESSION_ENV (lxsession_lxsession_env_get_type ())
#define LXSESSION_LXSESSION_ENV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_LXSESSION_ENV, LxsessionLxsessionEnv))
#define LXSESSION_LXSESSION_ENV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_LXSESSION_ENV, LxsessionLxsessionEnvClass))
#define LXSESSION_IS_LXSESSION_ENV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_LXSESSION_ENV))
#define LXSESSION_IS_LXSESSION_ENV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_LXSESSION_ENV))
#define LXSESSION_LXSESSION_ENV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_LXSESSION_ENV, LxsessionLxsessionEnvClass))

typedef struct _LxsessionLxsessionEnv LxsessionLxsessionEnv;
typedef struct _LxsessionLxsessionEnvClass LxsessionLxsessionEnvClass;
typedef struct _LxsessionLxsessionEnvPrivate LxsessionLxsessionEnvPrivate;
enum  {
	LXSESSION_LXSESSION_ENV_0_PROPERTY,
	LXSESSION_LXSESSION_ENV_NUM_PROPERTIES
};
static GParamSpec* lxsession_lxsession_env_properties[LXSESSION_LXSESSION_ENV_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define LXSESSION_TYPE_LXSESSION_CONFIG (lxsession_lxsession_config_get_type ())
#define LXSESSION_LXSESSION_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_LXSESSION_CONFIG, LxsessionLxsessionConfig))
#define LXSESSION_LXSESSION_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_LXSESSION_CONFIG, LxsessionLxsessionConfigClass))
#define LXSESSION_IS_LXSESSION_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_LXSESSION_CONFIG))
#define LXSESSION_IS_LXSESSION_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_LXSESSION_CONFIG))
#define LXSESSION_LXSESSION_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_LXSESSION_CONFIG, LxsessionLxsessionConfigClass))

typedef struct _LxsessionLxsessionConfig LxsessionLxsessionConfig;
typedef struct _LxsessionLxsessionConfigClass LxsessionLxsessionConfigClass;

#define LXSESSION_TYPE_LXSESSION_CONFIG_KEY_FILE (lxsession_lxsession_config_key_file_get_type ())
#define LXSESSION_LXSESSION_CONFIG_KEY_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_LXSESSION_CONFIG_KEY_FILE, LxsessionLxsessionConfigKeyFile))
#define LXSESSION_LXSESSION_CONFIG_KEY_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_LXSESSION_CONFIG_KEY_FILE, LxsessionLxsessionConfigKeyFileClass))
#define LXSESSION_IS_LXSESSION_CONFIG_KEY_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_LXSESSION_CONFIG_KEY_FILE))
#define LXSESSION_IS_LXSESSION_CONFIG_KEY_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_LXSESSION_CONFIG_KEY_FILE))
#define LXSESSION_LXSESSION_CONFIG_KEY_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_LXSESSION_CONFIG_KEY_FILE, LxsessionLxsessionConfigKeyFileClass))

typedef struct _LxsessionLxsessionConfigKeyFile LxsessionLxsessionConfigKeyFile;
typedef struct _LxsessionLxsessionConfigKeyFileClass LxsessionLxsessionConfigKeyFileClass;
#define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _LxsessionLxsessionEnv {
	GObject parent_instance;
	LxsessionLxsessionEnvPrivate * priv;
};

struct _LxsessionLxsessionEnvClass {
	GObjectClass parent_class;
};

struct _LxsessionLxsessionEnvPrivate {
	gchar* display_env;
	gchar* pid_env;
	gchar* session_env;
	gchar* desktop_environment_env;
	gchar* display_name;
	gchar* pid_str;
	gchar* session;
	gchar* desktop_environment;
	gchar* config_home;
	gchar* config_dirs;
	gchar* data_dirs;
	gchar* home_path;
};

static gint LxsessionLxsessionEnv_private_offset;
static gpointer lxsession_lxsession_env_parent_class = NULL;
VALA_EXTERN LxsessionLxsessionConfigKeyFile* lxsession_global_settings;

VALA_EXTERN GType lxsession_lxsession_env_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionLxsessionEnv, g_object_unref)
VALA_EXTERN LxsessionLxsessionEnv* lxsession_lxsession_env_new (const gchar* session_arg,
                                                    const gchar* desktop_environment_arg);
VALA_EXTERN LxsessionLxsessionEnv* lxsession_lxsession_env_construct (GType object_type,
                                                          const gchar* session_arg,
                                                          const gchar* desktop_environment_arg);
VALA_EXTERN void lxsession_lxsession_env_export_primary_env (LxsessionLxsessionEnv* self);
VALA_EXTERN void lxsession_lxsession_env_set_xdg_dirs (LxsessionLxsessionEnv* self,
                                           const gchar* mode);
VALA_EXTERN void lxsession_lxsession_env_export_env (LxsessionLxsessionEnv* self);
VALA_EXTERN GType lxsession_lxsession_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionLxsessionConfig, g_object_unref)
VALA_EXTERN GType lxsession_lxsession_config_key_file_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionLxsessionConfigKeyFile, g_object_unref)
VALA_EXTERN gchar* lxsession_lxsession_config_get_item_string (LxsessionLxsessionConfig* self,
                                                   const gchar* categorie,
                                                   const gchar* key1,
                                                   const gchar* key2);
VALA_EXTERN void lxsession_lxsession_env_set_export (LxsessionLxsessionEnv* self);
VALA_EXTERN void lxsession_lxsession_env_set_misc (LxsessionLxsessionEnv* self);
VALA_EXTERN gboolean lxsession_lxsession_env_check_alone (LxsessionLxsessionEnv* self);
VALA_EXTERN GKeyFile* lxsession_load_keyfile (const gchar* config_path);
VALA_EXTERN gchar* lxsession_get_config_path (const gchar* conf_file);
VALA_EXTERN void lxsession_lxsession_spawn_command_line_async (const gchar* command_line);
static void lxsession_lxsession_env_finalize (GObject * obj);
static GType lxsession_lxsession_env_get_type_once (void);
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 inline gpointer
lxsession_lxsession_env_get_instance_private (LxsessionLxsessionEnv* self)
{
	return G_STRUCT_MEMBER_P (self, LxsessionLxsessionEnv_private_offset);
}

LxsessionLxsessionEnv*
lxsession_lxsession_env_construct (GType object_type,
                                   const gchar* session_arg,
                                   const gchar* desktop_environment_arg)
{
	LxsessionLxsessionEnv * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	g_return_val_if_fail (session_arg != NULL, NULL);
	g_return_val_if_fail (desktop_environment_arg != NULL, NULL);
	self = (LxsessionLxsessionEnv*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (session_arg);
	_g_free0 (self->priv->session);
	self->priv->session = _tmp0_;
	_tmp1_ = g_strdup (desktop_environment_arg);
	_g_free0 (self->priv->desktop_environment);
	self->priv->desktop_environment = _tmp1_;
	_tmp2_ = self->priv->display_env;
	_tmp3_ = g_getenv (_tmp2_);
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (self->priv->display_name);
	self->priv->display_name = _tmp4_;
	_tmp5_ = g_getenv ("HOME");
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (self->priv->home_path);
	self->priv->home_path = _tmp6_;
	_tmp7_ = g_getenv ("XDG_CONFIG_HOME");
	_tmp8_ = g_strdup (_tmp7_);
	_g_free0 (self->priv->config_home);
	self->priv->config_home = _tmp8_;
	return self;
}

LxsessionLxsessionEnv*
lxsession_lxsession_env_new (const gchar* session_arg,
                             const gchar* desktop_environment_arg)
{
	return lxsession_lxsession_env_construct (LXSESSION_TYPE_LXSESSION_ENV, session_arg, desktop_environment_arg);
}

void
lxsession_lxsession_env_export_primary_env (LxsessionLxsessionEnv* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	g_message ("environement.vala:58: Exporting primary_variable");
	_tmp0_ = self->priv->desktop_environment_env;
	g_message ("environement.vala:59: desktop_environnement %s", _tmp0_);
	_tmp1_ = g_strdup_printf ("%d", (gint) getpid ());
	_g_free0 (self->priv->pid_str);
	self->priv->pid_str = _tmp1_;
	_tmp2_ = self->priv->session_env;
	_tmp3_ = self->priv->session;
	g_setenv (_tmp2_, _tmp3_, TRUE);
	_tmp4_ = self->priv->desktop_environment_env;
	_tmp5_ = self->priv->desktop_environment;
	g_setenv (_tmp4_, _tmp5_, TRUE);
	_tmp6_ = self->priv->pid_env;
	_tmp7_ = self->priv->pid_str;
	g_setenv (_tmp6_, _tmp7_, TRUE);
	_tmp8_ = self->priv->display_env;
	_tmp9_ = self->priv->display_name;
	g_setenv (_tmp8_, _tmp9_, TRUE);
	g_set_application_name ("lxsession");
	_tmp10_ = self->priv->config_home;
	if (_tmp10_ == NULL) {
		const gchar* _tmp11_;
		gchar* _tmp12_;
		const gchar* _tmp13_;
		_tmp11_ = self->priv->home_path;
		_tmp12_ = g_strconcat (_tmp11_, "/.config", NULL);
		_g_free0 (self->priv->config_home);
		self->priv->config_home = _tmp12_;
		_tmp13_ = self->priv->config_home;
		g_setenv ("XDG_CONFIG_HOME", _tmp13_, TRUE);
	}
	lxsession_lxsession_env_set_xdg_dirs (self, NULL);
}

void
lxsession_lxsession_env_export_env (LxsessionLxsessionEnv* self)
{
	const gchar* _tmp0_;
	LxsessionLxsessionConfigKeyFile* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_message ("environement.vala:79: Exporting variable");
	_tmp0_ = self->priv->desktop_environment_env;
	g_message ("environement.vala:80: desktop_environnement %s", _tmp0_);
	_tmp1_ = lxsession_global_settings;
	_tmp2_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp1_, "Environment", "menu_prefix", NULL);
	_tmp3_ = _tmp2_;
	g_setenv ("XDG_MENU_PREFIX", _tmp3_, TRUE);
	_g_free0 (_tmp3_);
	lxsession_lxsession_env_set_xdg_dirs (self, "all");
	lxsession_lxsession_env_set_export (self);
	lxsession_lxsession_env_set_misc (self);
}

gboolean
lxsession_lxsession_env_check_alone (LxsessionLxsessionEnv* self)
{
	gchar* lxsession_pid = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_message ("environement.vala:94: Getting lxsession pid");
	_tmp0_ = self->priv->pid_env;
	_tmp1_ = g_getenv (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (lxsession_pid);
	lxsession_pid = _tmp2_;
	_tmp3_ = lxsession_pid;
	g_message ("environement.vala:97: Checking pid : %s", _tmp3_);
	_tmp4_ = lxsession_pid;
	if (_tmp4_ == NULL) {
		g_message ("environement.vala:101: Lxsession not detected");
		result = TRUE;
		_g_free0 (lxsession_pid);
		return result;
	} else {
		g_message ("environement.vala:106: Lxsession detected");
		result = FALSE;
		_g_free0 (lxsession_pid);
		return result;
	}
}

void
lxsession_lxsession_env_set_xdg_dirs (LxsessionLxsessionEnv* self,
                                      const gchar* mode)
{
	gchar* custom_config = NULL;
	gchar* custom_data = NULL;
	gchar* return_config = NULL;
	gchar* return_data = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp16_;
	const gchar* _tmp44_;
	const gchar* _tmp46_;
	const gchar* _tmp74_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_getenv ("XDG_CONFIG_DIRS");
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->config_dirs);
	self->priv->config_dirs = _tmp1_;
	_tmp2_ = g_getenv ("XDG_DATA_DIRS");
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (self->priv->data_dirs);
	self->priv->data_dirs = _tmp3_;
	_tmp4_ = self->priv->session;
	if (g_strcmp0 (_tmp4_, "Lubuntu") == 0) {
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = g_strdup ("/etc/xdg/lubuntu:/etc/xdg");
		_g_free0 (custom_config);
		custom_config = _tmp5_;
		_tmp6_ = g_strdup ("/etc/xdg/lubuntu:/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/m" \
"enu-xdg");
		_g_free0 (custom_data);
		custom_data = _tmp6_;
	} else {
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp7_ = g_strdup ("/etc/xdg");
		_g_free0 (custom_config);
		custom_config = _tmp7_;
		_tmp8_ = g_strdup ("/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/menu-xdg");
		_g_free0 (custom_data);
		custom_data = _tmp8_;
	}
	if (g_strcmp0 (mode, "all") == 0) {
		LxsessionLxsessionConfigKeyFile* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		GQuark _tmp13_ = 0U;
		static GQuark _tmp12_label0 = 0;
		_tmp9_ = lxsession_global_settings;
		_tmp10_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp9_, "Environment", "type", NULL);
		_tmp11_ = _tmp10_;
		_tmp13_ = (NULL == _tmp11_) ? 0 : g_quark_from_string (_tmp11_);
		g_free (_tmp11_);
		if (_tmp13_ == ((0 != _tmp12_label0) ? _tmp12_label0 : (_tmp12_label0 = g_quark_from_static_string ("lubuntu")))) {
			switch (0) {
				default:
				{
					gchar* _tmp14_;
					gchar* _tmp15_;
					_tmp14_ = g_strdup ("/etc/xdg/lubuntu:/etc/xdg");
					_g_free0 (custom_config);
					custom_config = _tmp14_;
					_tmp15_ = g_strdup ("/etc/xdg/lubuntu:/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/m" \
"enu-xdg");
					_g_free0 (custom_data);
					custom_data = _tmp15_;
					break;
				}
			}
		} else {
			switch (0) {
				default:
				{
					break;
				}
			}
		}
	}
	_tmp16_ = self->priv->config_dirs;
	if (_tmp16_ == NULL) {
		const gchar* _tmp17_;
		gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp17_ = custom_config;
		_tmp18_ = g_strdup (_tmp17_);
		_g_free0 (return_config);
		return_config = _tmp18_;
		_tmp19_ = return_config;
		g_message ("environement.vala:150: confir_dirs is null, export : %s", _tmp19_);
	} else {
		gchar** custom_config_array = NULL;
		const gchar* _tmp20_;
		gchar** _tmp21_;
		gchar** _tmp22_;
		gint custom_config_array_length1;
		gint _custom_config_array_size_;
		gchar** config_dirs_array = NULL;
		const gchar* _tmp23_;
		gchar** _tmp24_;
		gchar** _tmp25_;
		gint config_dirs_array_length1;
		gint _config_dirs_array_size_;
		gchar* custom_config_check = NULL;
		gchar* _tmp26_;
		gchar** _tmp27_;
		gint _tmp27__length1;
		const gchar* _tmp38_;
		const gchar* _tmp39_;
		gchar* _tmp40_;
		const gchar* _tmp41_;
		const gchar* _tmp42_;
		const gchar* _tmp43_;
		_tmp20_ = custom_config;
		_tmp22_ = _tmp21_ = g_strsplit_set (_tmp20_, ":", 0);
		custom_config_array = _tmp22_;
		custom_config_array_length1 = _vala_array_length (_tmp21_);
		_custom_config_array_size_ = custom_config_array_length1;
		_tmp23_ = self->priv->config_dirs;
		_tmp25_ = _tmp24_ = g_strsplit_set (_tmp23_, ":", 0);
		config_dirs_array = _tmp25_;
		config_dirs_array_length1 = _vala_array_length (_tmp24_);
		_config_dirs_array_size_ = config_dirs_array_length1;
		_tmp26_ = g_strdup ("");
		custom_config_check = _tmp26_;
		_tmp27_ = custom_config_array;
		_tmp27__length1 = custom_config_array_length1;
		{
			gchar** custom_str_collection = NULL;
			gint custom_str_collection_length1 = 0;
			gint _custom_str_collection_size_ = 0;
			gint custom_str_it = 0;
			custom_str_collection = _tmp27_;
			custom_str_collection_length1 = _tmp27__length1;
			for (custom_str_it = 0; custom_str_it < custom_str_collection_length1; custom_str_it = custom_str_it + 1) {
				gchar* _tmp28_;
				gchar* custom_str = NULL;
				_tmp28_ = g_strdup (custom_str_collection[custom_str_it]);
				custom_str = _tmp28_;
				{
					gboolean delete_str = FALSE;
					gchar** _tmp29_;
					gint _tmp29__length1;
					delete_str = FALSE;
					_tmp29_ = config_dirs_array;
					_tmp29__length1 = config_dirs_array_length1;
					{
						gchar** config_str_collection = NULL;
						gint config_str_collection_length1 = 0;
						gint _config_str_collection_size_ = 0;
						gint config_str_it = 0;
						config_str_collection = _tmp29_;
						config_str_collection_length1 = _tmp29__length1;
						for (config_str_it = 0; config_str_it < config_str_collection_length1; config_str_it = config_str_it + 1) {
							gchar* _tmp30_;
							gchar* config_str = NULL;
							_tmp30_ = g_strdup (config_str_collection[config_str_it]);
							config_str = _tmp30_;
							{
								const gchar* _tmp31_;
								const gchar* _tmp32_;
								_tmp31_ = custom_str;
								_tmp32_ = config_str;
								if (g_strcmp0 (_tmp31_, _tmp32_) == 0) {
									delete_str = TRUE;
								}
								_g_free0 (config_str);
							}
						}
					}
					if (delete_str == FALSE) {
						const gchar* _tmp33_;
						const gchar* _tmp34_;
						gchar* _tmp35_;
						gchar* _tmp36_;
						gchar* _tmp37_;
						_tmp33_ = custom_config_check;
						_tmp34_ = custom_str;
						_tmp35_ = g_strconcat (_tmp33_, _tmp34_, NULL);
						_tmp36_ = _tmp35_;
						_tmp37_ = g_strconcat (_tmp36_, ":", NULL);
						_g_free0 (custom_config_check);
						custom_config_check = _tmp37_;
						_g_free0 (_tmp36_);
					}
					_g_free0 (custom_str);
				}
			}
		}
		_tmp38_ = custom_config_check;
		_tmp39_ = self->priv->config_dirs;
		_tmp40_ = g_strconcat (_tmp38_, _tmp39_, NULL);
		_g_free0 (return_config);
		return_config = _tmp40_;
		_tmp41_ = custom_config_check;
		g_message ("environement.vala:177: custom_config :%s", _tmp41_);
		_tmp42_ = self->priv->config_dirs;
		g_message ("environement.vala:178: config_dirs :%s", _tmp42_);
		_tmp43_ = return_config;
		g_message ("environement.vala:179: confir_dirs not null, export : %s", _tmp43_);
		_g_free0 (custom_config_check);
		config_dirs_array = (_vala_array_free (config_dirs_array, config_dirs_array_length1, (GDestroyNotify) g_free), NULL);
		custom_config_array = (_vala_array_free (custom_config_array, custom_config_array_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp44_ = return_config;
	if (_tmp44_ != NULL) {
		const gchar* _tmp45_;
		g_message ("environement.vala:184: Exporting XDG_CONFIG_DIRS");
		_tmp45_ = return_config;
		g_setenv ("XDG_CONFIG_DIRS", _tmp45_, TRUE);
	}
	_tmp46_ = self->priv->data_dirs;
	if (_tmp46_ == NULL) {
		const gchar* _tmp47_;
		gchar* _tmp48_;
		const gchar* _tmp49_;
		_tmp47_ = custom_data;
		_tmp48_ = g_strdup (_tmp47_);
		_g_free0 (return_data);
		return_data = _tmp48_;
		_tmp49_ = return_data;
		g_message ("environement.vala:191: data_dirs is null, export : %s", _tmp49_);
	} else {
		gchar** custom_data_array = NULL;
		const gchar* _tmp50_;
		gchar** _tmp51_;
		gchar** _tmp52_;
		gint custom_data_array_length1;
		gint _custom_data_array_size_;
		gchar** data_dirs_array = NULL;
		const gchar* _tmp53_;
		gchar** _tmp54_;
		gchar** _tmp55_;
		gint data_dirs_array_length1;
		gint _data_dirs_array_size_;
		gchar* custom_data_check = NULL;
		gchar* _tmp56_;
		gchar** _tmp57_;
		gint _tmp57__length1;
		const gchar* _tmp68_;
		const gchar* _tmp69_;
		gchar* _tmp70_;
		const gchar* _tmp71_;
		const gchar* _tmp72_;
		const gchar* _tmp73_;
		_tmp50_ = custom_data;
		_tmp52_ = _tmp51_ = g_strsplit_set (_tmp50_, ":", 0);
		custom_data_array = _tmp52_;
		custom_data_array_length1 = _vala_array_length (_tmp51_);
		_custom_data_array_size_ = custom_data_array_length1;
		_tmp53_ = self->priv->data_dirs;
		_tmp55_ = _tmp54_ = g_strsplit_set (_tmp53_, ":", 0);
		data_dirs_array = _tmp55_;
		data_dirs_array_length1 = _vala_array_length (_tmp54_);
		_data_dirs_array_size_ = data_dirs_array_length1;
		_tmp56_ = g_strdup ("");
		custom_data_check = _tmp56_;
		_tmp57_ = custom_data_array;
		_tmp57__length1 = custom_data_array_length1;
		{
			gchar** custom_data_str_collection = NULL;
			gint custom_data_str_collection_length1 = 0;
			gint _custom_data_str_collection_size_ = 0;
			gint custom_data_str_it = 0;
			custom_data_str_collection = _tmp57_;
			custom_data_str_collection_length1 = _tmp57__length1;
			for (custom_data_str_it = 0; custom_data_str_it < custom_data_str_collection_length1; custom_data_str_it = custom_data_str_it + 1) {
				gchar* _tmp58_;
				gchar* custom_data_str = NULL;
				_tmp58_ = g_strdup (custom_data_str_collection[custom_data_str_it]);
				custom_data_str = _tmp58_;
				{
					gboolean delete_data_str = FALSE;
					gchar** _tmp59_;
					gint _tmp59__length1;
					delete_data_str = FALSE;
					_tmp59_ = data_dirs_array;
					_tmp59__length1 = data_dirs_array_length1;
					{
						gchar** data_str_collection = NULL;
						gint data_str_collection_length1 = 0;
						gint _data_str_collection_size_ = 0;
						gint data_str_it = 0;
						data_str_collection = _tmp59_;
						data_str_collection_length1 = _tmp59__length1;
						for (data_str_it = 0; data_str_it < data_str_collection_length1; data_str_it = data_str_it + 1) {
							gchar* _tmp60_;
							gchar* data_str = NULL;
							_tmp60_ = g_strdup (data_str_collection[data_str_it]);
							data_str = _tmp60_;
							{
								const gchar* _tmp61_;
								const gchar* _tmp62_;
								_tmp61_ = custom_data_str;
								_tmp62_ = data_str;
								if (g_strcmp0 (_tmp61_, _tmp62_) == 0) {
									delete_data_str = TRUE;
								}
								_g_free0 (data_str);
							}
						}
					}
					if (delete_data_str == FALSE) {
						const gchar* _tmp63_;
						const gchar* _tmp64_;
						gchar* _tmp65_;
						gchar* _tmp66_;
						gchar* _tmp67_;
						_tmp63_ = custom_data_check;
						_tmp64_ = custom_data_str;
						_tmp65_ = g_strconcat (_tmp63_, _tmp64_, NULL);
						_tmp66_ = _tmp65_;
						_tmp67_ = g_strconcat (_tmp66_, ":", NULL);
						_g_free0 (custom_data_check);
						custom_data_check = _tmp67_;
						_g_free0 (_tmp66_);
					}
					_g_free0 (custom_data_str);
				}
			}
		}
		_tmp68_ = custom_data_check;
		_tmp69_ = self->priv->data_dirs;
		_tmp70_ = g_strconcat (_tmp68_, _tmp69_, NULL);
		_g_free0 (return_data);
		return_data = _tmp70_;
		_tmp71_ = custom_data_check;
		g_message ("environement.vala:218: custom_data :%s", _tmp71_);
		_tmp72_ = self->priv->data_dirs;
		g_message ("environement.vala:219: data_dirs :%s", _tmp72_);
		_tmp73_ = return_data;
		g_message ("environement.vala:220: data_dirs not null, export : %s", _tmp73_);
		_g_free0 (custom_data_check);
		data_dirs_array = (_vala_array_free (data_dirs_array, data_dirs_array_length1, (GDestroyNotify) g_free), NULL);
		custom_data_array = (_vala_array_free (custom_data_array, custom_data_array_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp74_ = return_data;
	if (_tmp74_ != NULL) {
		const gchar* _tmp75_;
		g_message ("environement.vala:225: Exporting XDG_DATA_DIRS");
		_tmp75_ = return_data;
		g_setenv ("XDG_DATA_DIRS", _tmp75_, TRUE);
	}
	_g_free0 (return_data);
	_g_free0 (return_config);
	_g_free0 (custom_data);
	_g_free0 (custom_config);
}

void
lxsession_lxsession_env_set_export (LxsessionLxsessionEnv* self)
{
	GKeyFile* env_kf = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GKeyFile* _tmp2_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = lxsession_get_config_path ("desktop.conf");
	_tmp1_ = _tmp0_;
	_tmp2_ = lxsession_load_keyfile (_tmp1_);
	_g_key_file_unref0 (env_kf);
	env_kf = _tmp2_;
	_g_free0 (_tmp1_);
	{
		gchar** _tmp3_ = NULL;
		GKeyFile* _tmp4_;
		gsize _tmp5_ = 0;
		gchar** _tmp6_;
		gint _tmp3__length1;
		gint __tmp3__size_;
		_tmp4_ = env_kf;
		_tmp6_ = g_key_file_get_keys (_tmp4_, "Environment_variable", &_tmp5_, &_inner_error0_);
		_tmp3_ = _tmp6_;
		_tmp3__length1 = _tmp5_;
		__tmp3__size_ = _tmp3__length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch0_g_key_file_error;
			}
			_g_key_file_unref0 (env_kf);
			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;
		}
		if (_tmp3_ != NULL) {
			gchar** env_list = NULL;
			GKeyFile* _tmp7_;
			gsize _tmp8_ = 0;
			gchar** _tmp9_;
			gint env_list_length1;
			gint _env_list_size_;
			gchar** _tmp10_;
			gint _tmp10__length1;
			_tmp7_ = env_kf;
			_tmp9_ = g_key_file_get_keys (_tmp7_, "Environment_variable", &_tmp8_, &_inner_error0_);
			env_list = _tmp9_;
			env_list_length1 = _tmp8_;
			_env_list_size_ = env_list_length1;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
				if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
					goto __catch0_g_key_file_error;
				}
				_g_key_file_unref0 (env_kf);
				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;
			}
			_tmp10_ = env_list;
			_tmp10__length1 = env_list_length1;
			{
				gchar** entry_collection = NULL;
				gint entry_collection_length1 = 0;
				gint _entry_collection_size_ = 0;
				gint entry_it = 0;
				entry_collection = _tmp10_;
				entry_collection_length1 = _tmp10__length1;
				for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
					gchar* _tmp11_;
					gchar* entry = NULL;
					_tmp11_ = g_strdup (entry_collection[entry_it]);
					entry = _tmp11_;
					{
						const gchar* _tmp12_;
						_tmp12_ = entry;
						if (_tmp12_ != NULL) {
							const gchar* _tmp13_;
							gchar* _tmp14_ = NULL;
							GKeyFile* _tmp15_;
							const gchar* _tmp16_;
							gchar* _tmp17_;
							const gchar* _tmp18_;
							_tmp13_ = entry;
							g_debug ("environement.vala:246: set_export, entry: %s", _tmp13_);
							_tmp15_ = env_kf;
							_tmp16_ = entry;
							_tmp17_ = g_key_file_get_value (_tmp15_, "Environment_variable", _tmp16_, &_inner_error0_);
							_tmp14_ = _tmp17_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_free0 (entry);
								env_list = (_vala_array_free (env_list, env_list_length1, (GDestroyNotify) g_free), NULL);
								_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
								if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
									goto __catch0_g_key_file_error;
								}
								_g_key_file_unref0 (env_kf);
								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;
							}
							_tmp18_ = entry;
							g_setenv (_tmp18_, _tmp14_, TRUE);
							_g_free0 (_tmp14_);
						}
						_g_free0 (entry);
					}
				}
			}
			env_list = (_vala_array_free (env_list, env_list_length1, (GDestroyNotify) g_free), NULL);
		}
		_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
	}
	goto __finally0;
	__catch0_g_key_file_error:
	{
		GError* e = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = e;
		_tmp20_ = _tmp19_->message;
		g_message ("environement.vala:254: No entry in [Environment_variable]. %s", _tmp20_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_key_file_unref0 (env_kf);
		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_key_file_unref0 (env_kf);
}

void
lxsession_lxsession_env_set_misc (LxsessionLxsessionEnv* self)
{
	LxsessionLxsessionConfigKeyFile* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	LxsessionLxsessionConfigKeyFile* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gboolean _tmp13_;
	LxsessionLxsessionConfigKeyFile* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gboolean _tmp17_;
	gchar* qt_plugin = NULL;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	const gchar* _tmp23_;
	LxsessionLxsessionConfigKeyFile* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gboolean _tmp31_;
	LxsessionLxsessionConfigKeyFile* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gboolean _tmp35_;
	LxsessionLxsessionConfigKeyFile* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gboolean _tmp48_;
	g_return_if_fail (self != NULL);
	lxsession_lxsession_spawn_command_line_async ("xprop -root -remove _NET_NUMBER_OF_DESKTOPS -remove _NET_DESKTOP_NAMES" \
" -remove _NET_CURRENT_DESKTOP");
	_tmp0_ = lxsession_global_settings;
	_tmp1_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp0_, "Environment", "toolkit_integration", NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, "true") == 0;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		gchar* toolkit_variable = NULL;
		LxsessionLxsessionConfigKeyFile* _tmp4_;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		GQuark _tmp9_ = 0U;
		static GQuark _tmp8_label0 = 0;
		static GQuark _tmp8_label1 = 0;
		static GQuark _tmp8_label2 = 0;
		static GQuark _tmp8_label3 = 0;
		static GQuark _tmp8_label4 = 0;
		static GQuark _tmp8_label5 = 0;
		static GQuark _tmp8_label6 = 0;
		static GQuark _tmp8_label7 = 0;
		_tmp4_ = lxsession_global_settings;
		_tmp5_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp4_, "Environment", "toolkit_integration", NULL);
		toolkit_variable = _tmp5_;
		_tmp6_ = toolkit_variable;
		_tmp7_ = _tmp6_;
		_tmp9_ = (NULL == _tmp7_) ? 0 : g_quark_from_string (_tmp7_);
		if (_tmp9_ == ((0 != _tmp8_label0) ? _tmp8_label0 : (_tmp8_label0 = g_quark_from_static_string ("gtk2")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "gtk", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label1) ? _tmp8_label1 : (_tmp8_label1 = g_quark_from_static_string ("gtk3")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "gtk3", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label2) ? _tmp8_label2 : (_tmp8_label2 = g_quark_from_static_string ("gtk")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "gtk", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label3) ? _tmp8_label3 : (_tmp8_label3 = g_quark_from_static_string ("gen")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "gen", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label4) ? _tmp8_label4 : (_tmp8_label4 = g_quark_from_static_string ("kde4")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "kde4", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label5) ? _tmp8_label5 : (_tmp8_label5 = g_quark_from_static_string ("kde")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "kde4", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label6) ? _tmp8_label6 : (_tmp8_label6 = g_quark_from_static_string ("qt")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "kde4", TRUE);
					break;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label7) ? _tmp8_label7 : (_tmp8_label7 = g_quark_from_static_string ("qt4")))) {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "kde4", TRUE);
					break;
				}
			}
		} else {
			switch (0) {
				default:
				{
					g_setenv ("SAL_USE_VCLPLUGIN", "gtk", TRUE);
					break;
				}
			}
		}
		_g_free0 (toolkit_variable);
	}
	_tmp10_ = lxsession_global_settings;
	_tmp11_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp10_, "Environment", "gtk", "overlay_scrollbar_disable");
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strcmp0 (_tmp12_, "true") == 0;
	_g_free0 (_tmp12_);
	if (_tmp13_) {
		g_setenv ("GTK_OVERLAY_SCROLLING", "0", TRUE);
	}
	_tmp14_ = lxsession_global_settings;
	_tmp15_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp14_, "Environment", "qt", "force_theme");
	_tmp16_ = _tmp15_;
	_tmp17_ = _tmp16_ != NULL;
	_g_free0 (_tmp16_);
	if (_tmp17_) {
		LxsessionLxsessionConfigKeyFile* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		_tmp18_ = lxsession_global_settings;
		_tmp19_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp18_, "Environment", "qt", "force_theme");
		_tmp20_ = _tmp19_;
		g_setenv ("QT_STYLE_OVERRIDE", _tmp20_, TRUE);
		_g_free0 (_tmp20_);
	}
	_tmp21_ = g_getenv ("QT_PLUGIN_PATH");
	_tmp22_ = g_strdup (_tmp21_);
	_g_free0 (qt_plugin);
	qt_plugin = _tmp22_;
	_tmp23_ = qt_plugin;
	if (_tmp23_ != NULL) {
		const gchar* _tmp24_;
		_tmp24_ = qt_plugin;
		if (g_strcmp0 (_tmp24_, "") != 0) {
			const gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			_tmp25_ = qt_plugin;
			_tmp26_ = g_strconcat (_tmp25_, ":/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins", NULL);
			_tmp27_ = _tmp26_;
			g_setenv ("QT_PLUGIN_PATH", _tmp27_, TRUE);
			_g_free0 (_tmp27_);
		}
	}
	_tmp28_ = lxsession_global_settings;
	_tmp29_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp28_, "Environment", "ubuntu_menuproxy", NULL);
	_tmp30_ = _tmp29_;
	_tmp31_ = g_strcmp0 (_tmp30_, "true") == 0;
	_g_free0 (_tmp30_);
	if (_tmp31_) {
		g_setenv ("UBUNTU_MENUPROXY", "libappmenu.so", TRUE);
	}
	_tmp32_ = lxsession_global_settings;
	_tmp33_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp32_, "Session", "im_manager", "command");
	_tmp34_ = _tmp33_;
	_tmp35_ = _tmp34_ != NULL;
	_g_free0 (_tmp34_);
	if (_tmp35_) {
		LxsessionLxsessionConfigKeyFile* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
		LxsessionLxsessionConfigKeyFile* _tmp39_;
		gchar* _tmp40_;
		gchar* _tmp41_;
		LxsessionLxsessionConfigKeyFile* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		_tmp36_ = lxsession_global_settings;
		_tmp37_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp36_, "Session", "im_manager", "command");
		_tmp38_ = _tmp37_;
		g_setenv ("GTK_IM_MODULE", _tmp38_, TRUE);
		_g_free0 (_tmp38_);
		_tmp39_ = lxsession_global_settings;
		_tmp40_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp39_, "Session", "im_manager", "command");
		_tmp41_ = _tmp40_;
		g_setenv ("QT_IM_MODULE", _tmp41_, TRUE);
		_g_free0 (_tmp41_);
		_tmp42_ = lxsession_global_settings;
		_tmp43_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp42_, "Session", "im_manager", "command");
		_tmp44_ = _tmp43_;
		g_setenv ("XMODIFIERS=@im", _tmp44_, TRUE);
		_g_free0 (_tmp44_);
	}
	_tmp45_ = lxsession_global_settings;
	_tmp46_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp45_, "Environment", "qt", "platform");
	_tmp47_ = _tmp46_;
	_tmp48_ = _tmp47_ != NULL;
	_g_free0 (_tmp47_);
	if (_tmp48_) {
		LxsessionLxsessionConfigKeyFile* _tmp49_;
		gchar* _tmp50_;
		gchar* _tmp51_;
		LxsessionLxsessionConfigKeyFile* _tmp52_;
		gchar* _tmp53_;
		gchar* _tmp54_;
		_tmp49_ = lxsession_global_settings;
		_tmp50_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp49_, "Environment", "qt", "platform");
		_tmp51_ = _tmp50_;
		g_setenv ("QT_PLATFORM_PLUGIN", _tmp51_, TRUE);
		_g_free0 (_tmp51_);
		_tmp52_ = lxsession_global_settings;
		_tmp53_ = lxsession_lxsession_config_get_item_string ((LxsessionLxsessionConfig*) _tmp52_, "Environment", "qt", "platform");
		_tmp54_ = _tmp53_;
		g_setenv ("QT_QPA_PLATFORMTHEME", _tmp54_, TRUE);
		_g_free0 (_tmp54_);
	}
	_g_free0 (qt_plugin);
}

static void
lxsession_lxsession_env_class_init (LxsessionLxsessionEnvClass * klass,
                                    gpointer klass_data)
{
	lxsession_lxsession_env_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LxsessionLxsessionEnv_private_offset);
	G_OBJECT_CLASS (klass)->finalize = lxsession_lxsession_env_finalize;
}

static void
lxsession_lxsession_env_instance_init (LxsessionLxsessionEnv * self,
                                       gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	self->priv = lxsession_lxsession_env_get_instance_private (self);
	_tmp0_ = g_strdup ("DISPLAY");
	self->priv->display_env = _tmp0_;
	_tmp1_ = g_strdup ("_LXSESSION_PID");
	self->priv->pid_env = _tmp1_;
	_tmp2_ = g_strdup ("DESKTOP_SESSION");
	self->priv->session_env = _tmp2_;
	_tmp3_ = g_strdup ("XDG_CURRENT_DESKTOP");
	self->priv->desktop_environment_env = _tmp3_;
}

static void
lxsession_lxsession_env_finalize (GObject * obj)
{
	LxsessionLxsessionEnv * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LXSESSION_TYPE_LXSESSION_ENV, LxsessionLxsessionEnv);
	_g_free0 (self->priv->display_env);
	_g_free0 (self->priv->pid_env);
	_g_free0 (self->priv->session_env);
	_g_free0 (self->priv->desktop_environment_env);
	_g_free0 (self->priv->display_name);
	_g_free0 (self->priv->pid_str);
	_g_free0 (self->priv->session);
	_g_free0 (self->priv->desktop_environment);
	_g_free0 (self->priv->config_home);
	_g_free0 (self->priv->config_dirs);
	_g_free0 (self->priv->data_dirs);
	_g_free0 (self->priv->home_path);
	G_OBJECT_CLASS (lxsession_lxsession_env_parent_class)->finalize (obj);
}

static GType
lxsession_lxsession_env_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LxsessionLxsessionEnvClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lxsession_lxsession_env_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LxsessionLxsessionEnv), 0, (GInstanceInitFunc) lxsession_lxsession_env_instance_init, NULL };
	GType lxsession_lxsession_env_type_id;
	lxsession_lxsession_env_type_id = g_type_register_static (G_TYPE_OBJECT, "LxsessionLxsessionEnv", &g_define_type_info, 0);
	LxsessionLxsessionEnv_private_offset = g_type_add_instance_private (lxsession_lxsession_env_type_id, sizeof (LxsessionLxsessionEnvPrivate));
	return lxsession_lxsession_env_type_id;
}

GType
lxsession_lxsession_env_get_type (void)
{
	static volatile gsize lxsession_lxsession_env_type_id__once = 0;
	if (g_once_init_enter (&lxsession_lxsession_env_type_id__once)) {
		GType lxsession_lxsession_env_type_id;
		lxsession_lxsession_env_type_id = lxsession_lxsession_env_get_type_once ();
		g_once_init_leave (&lxsession_lxsession_env_type_id__once, lxsession_lxsession_env_type_id);
	}
	return lxsession_lxsession_env_type_id__once;
}

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;
}

