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

/* 
    Copyright 2012 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 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <stdio.h>
#include <glib/gstdio.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_DB_DEFAULT_APPS (lxsession_db_default_apps_get_type ())
#define LXSESSION_DB_DEFAULT_APPS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LXSESSION_TYPE_DB_DEFAULT_APPS, LxsessionDBDefaultApps))
#define LXSESSION_DB_DEFAULT_APPS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LXSESSION_TYPE_DB_DEFAULT_APPS, LxsessionDBDefaultAppsClass))
#define LXSESSION_IS_DB_DEFAULT_APPS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LXSESSION_TYPE_DB_DEFAULT_APPS))
#define LXSESSION_IS_DB_DEFAULT_APPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LXSESSION_TYPE_DB_DEFAULT_APPS))
#define LXSESSION_DB_DEFAULT_APPS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LXSESSION_TYPE_DB_DEFAULT_APPS, LxsessionDBDefaultAppsClass))

typedef struct _LxsessionDBDefaultApps LxsessionDBDefaultApps;
typedef struct _LxsessionDBDefaultAppsClass LxsessionDBDefaultAppsClass;
typedef struct _LxsessionDBDefaultAppsPrivate LxsessionDBDefaultAppsPrivate;
enum  {
	LXSESSION_DB_DEFAULT_APPS_0_PROPERTY,
	LXSESSION_DB_DEFAULT_APPS_NUM_PROPERTIES
};
static GParamSpec* lxsession_db_default_apps_properties[LXSESSION_DB_DEFAULT_APPS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#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)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _LxsessionDbDefaultAppsListDesktopFilesData LxsessionDbDefaultAppsListDesktopFilesData;
enum  {
	LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_INSTALLED_SIGNAL,
	LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_AVAILABLE_SIGNAL,
	LXSESSION_DB_DEFAULT_APPS_EXIT_NOW_SIGNAL,
	LXSESSION_DB_DEFAULT_APPS_NUM_SIGNALS
};
static guint lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_NUM_SIGNALS] = {0};

struct _LxsessionDBDefaultApps {
	GObject parent_instance;
	LxsessionDBDefaultAppsPrivate * priv;
	GList* webbrowser_installed;
	GList* webbrowser_available;
	gchar* webbrowser_installed_blacklist;
	GList* email_installed;
	GList* email_available;
	gchar* email_installed_blacklist;
	GList* file_manager_installed;
	GList* file_manager_available;
	gchar* file_manager_blacklist;
	gchar* screensaver_blacklist;
	GList* screensaver_installed;
	GList* screensaver_available;
	gchar* composite_manager_blacklist;
	GList* composite_manager_installed;
	GList* composite_manager_available;
	gchar* desktop_manager_blacklist;
	GList* desktop_manager_installed;
	GList* desktop_manager_available;
	gchar* power_manager_blacklist;
	GList* power_manager_installed;
	GList* power_manager_available;
	gchar* polkit_blacklist;
	GList* polkit_installed;
	GList* polkit_available;
	gchar* im_blacklist;
	GList* im_installed;
	GList* im_available;
	gchar* widget_blacklist;
	GList* widget_installed;
	GList* widget_available;
	gchar* terminal_manager_blacklist;
	GList* terminal_manager_installed;
	GList* terminal_manager_available;
	gchar* audio_blacklist;
	GList* audio_installed;
	GList* audio_available;
	gchar* video_blacklist;
	GList* video_installed;
	GList* video_available;
	gchar* audio_video_blacklist;
	gchar* viewer_blacklist;
	GList* image_display_installed;
	GList* pdf_reader_installed;
	GList* image_display_available;
	GList* pdf_reader_available;
	gchar* text_editor_blacklist;
	GList* text_editor_installed;
	GList* text_editor_available;
	gchar* archive_blacklist;
	GList* archive_installed;
	GList* archive_available;
	gchar* spreadsheet_blacklist;
	GList* spreadsheet_installed;
	GList* spreadsheet_available;
	gchar* bittorent_blacklist;
	GList* bittorent_installed;
	GList* bittorent_available;
	gchar* document_blacklist;
	GList* document_installed;
	GList* document_available;
	gchar* burn_blacklist;
	GList* burn_installed;
	GList* burn_available;
	gchar* tasks_blacklist;
	GList* tasks_installed;
	GList* tasks_available;
	gboolean state_installed;
	gboolean state_available;
};

struct _LxsessionDBDefaultAppsClass {
	GObjectClass parent_class;
};

struct _LxsessionDBDefaultAppsPrivate {
	gchar** MimeFoldersInstalledGet;
	gint MimeFoldersInstalledGet_length1;
	gint _MimeFoldersInstalledGet_size_;
	gchar** MimeFoldersAvailableGet;
	gint MimeFoldersAvailableGet_length1;
	gint _MimeFoldersAvailableGet_size_;
	gchar* mode;
	GKeyFile* kf;
	gchar* config_path;
};

struct _LxsessionDbDefaultAppsListDesktopFilesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	LxsessionDBDefaultApps* self;
	gchar* path;
	gchar* mode;
	GFile* dir;
	GFile* _tmp0_;
	GKeyFile* kf;
	GKeyFile* _tmp1_;
	GFileEnumerator* e;
	GFile* _tmp2_;
	GFileEnumerator* _tmp3_;
	GList* files;
	GFileEnumerator* _tmp4_;
	GList* _tmp5_;
	GList* _tmp6_;
	GList* _tmp7_;
	GList* info_collection;
	GList* info_it;
	GFileInfo* _tmp8_;
	GFileInfo* info;
	gchar* desktop_path;
	GFileInfo* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	GKeyFile* _tmp12_;
	const gchar* _tmp13_;
	gboolean _tmp14_;
	GKeyFile* _tmp15_;
	GKeyFile* _tmp16_;
	const gchar* _tmp17_;
	GFileInfo* _tmp18_;
	const gchar* _tmp19_;
	GError* err;
	GError* _tmp20_;
	const gchar* _tmp21_;
	GError* _vala1_err;
	FILE* _tmp22_;
	GError* _tmp23_;
	const gchar* _tmp24_;
	GError* _inner_error0_;
};

static gint LxsessionDBDefaultApps_private_offset;
static gpointer lxsession_db_default_apps_parent_class = NULL;
VALA_EXTERN LxsessionDBDefaultApps* lxsession_global_db;

VALA_EXTERN GType lxsession_db_default_apps_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LxsessionDBDefaultApps, g_object_unref)
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
VALA_EXTERN LxsessionDBDefaultApps* lxsession_db_default_apps_new (const gchar* mode_argument);
VALA_EXTERN LxsessionDBDefaultApps* lxsession_db_default_apps_construct (GType object_type,
                                                             const gchar* mode_argument);
VALA_EXTERN void lxsession_db_default_apps_init (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_on_finish_scanning_installed (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_print_values_installed (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_save_values_installed (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_on_finish_scanning_available (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_print_values_available (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_save_values_available (LxsessionDBDefaultApps* self);
VALA_EXTERN void lxsession_db_default_apps_update_installed (LxsessionDBDefaultApps* self);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static void lxsession_db_default_apps_list_desktop_files (LxsessionDBDefaultApps* self,
                                                   const gchar* path,
                                                   const gchar* mode,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void lxsession_db_default_apps_list_desktop_files_finish (LxsessionDBDefaultApps* self,
                                                          GAsyncResult* _res_);
VALA_EXTERN void lxsession_db_default_apps_update_available (LxsessionDBDefaultApps* self);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
VALA_EXTERN void lxsession_db_default_apps_update (LxsessionDBDefaultApps* self);
static void _lxsession_db_default_apps_on_finish_scanning_installed_lxsession_db_default_apps_finish_scanning_installed (LxsessionDBDefaultApps* _sender,
                                                                                                                  gpointer self);
static void _lxsession_db_default_apps_on_finish_scanning_available_lxsession_db_default_apps_finish_scanning_available (LxsessionDBDefaultApps* _sender,
                                                                                                                  gpointer self);
static void lxsession_db_default_apps_list_desktop_files_data_free (gpointer _data);
static gboolean lxsession_db_default_apps_list_desktop_files_co (LxsessionDbDefaultAppsListDesktopFilesData* _data_);
static void lxsession_db_default_apps_list_desktop_files_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN void lxsession_db_default_apps_find_list (LxsessionDBDefaultApps* self,
                                          GKeyFile* kf,
                                          const gchar* desktop_path,
                                          const gchar* name,
                                          const gchar* mode);
VALA_EXTERN gchar* lxsession_db_default_apps_create_entry (LxsessionDBDefaultApps* self,
                                               GKeyFile* kf,
                                               const gchar* desktop_path);
VALA_EXTERN gchar* lxsession_db_default_apps_create_exec_string (LxsessionDBDefaultApps* self,
                                                     GKeyFile* kf);
VALA_EXTERN void lxsession_db_default_apps_keyfile_set_list_string (LxsessionDBDefaultApps* self,
                                                        GKeyFile* kf,
                                                        const gchar* categorie,
                                                        const gchar* key1,
                                                        GList* list);
VALA_EXTERN void lxsession_db_default_apps_save_keyfile (LxsessionDBDefaultApps* self);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void lxsession_db_default_apps_finalize (GObject * obj);
static GType lxsession_db_default_apps_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_db_default_apps_get_instance_private (LxsessionDBDefaultApps* self)
{
	return G_STRUCT_MEMBER_P (self, LxsessionDBDefaultApps_private_offset);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

LxsessionDBDefaultApps*
lxsession_db_default_apps_construct (GType object_type,
                                     const gchar* mode_argument)
{
	LxsessionDBDefaultApps * self = NULL;
	g_return_val_if_fail (mode_argument != NULL, NULL);
	self = (LxsessionDBDefaultApps*) g_object_new (object_type, NULL);
	lxsession_db_default_apps_init (self);
	if (mode_argument == NULL) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("display");
		_g_free0 (self->priv->mode);
		self->priv->mode = _tmp0_;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (mode_argument);
		_g_free0 (self->priv->mode);
		self->priv->mode = _tmp1_;
	}
	return self;
}

LxsessionDBDefaultApps*
lxsession_db_default_apps_new (const gchar* mode_argument)
{
	return lxsession_db_default_apps_construct (LXSESSION_TYPE_DB_DEFAULT_APPS, mode_argument);
}

void
lxsession_db_default_apps_init (LxsessionDBDefaultApps* self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	GKeyFile* _tmp24_;
	const gchar* _tmp25_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("lxde-x-www-browser.desktop;");
	_g_free0 (self->webbrowser_installed_blacklist);
	self->webbrowser_installed_blacklist = _tmp0_;
	_tmp1_ = g_strdup ("");
	_g_free0 (self->email_installed_blacklist);
	self->email_installed_blacklist = _tmp1_;
	_tmp2_ = g_strdup ("");
	_g_free0 (self->file_manager_blacklist);
	self->file_manager_blacklist = _tmp2_;
	_tmp3_ = g_strdup ("");
	_g_free0 (self->screensaver_blacklist);
	self->screensaver_blacklist = _tmp3_;
	_tmp4_ = g_strdup ("");
	_g_free0 (self->composite_manager_blacklist);
	self->composite_manager_blacklist = _tmp4_;
	_tmp5_ = g_strdup ("");
	_g_free0 (self->desktop_manager_blacklist);
	self->desktop_manager_blacklist = _tmp5_;
	_tmp6_ = g_strdup ("");
	_g_free0 (self->power_manager_blacklist);
	self->power_manager_blacklist = _tmp6_;
	_tmp7_ = g_strdup ("");
	_g_free0 (self->polkit_blacklist);
	self->polkit_blacklist = _tmp7_;
	_tmp8_ = g_strdup ("");
	_g_free0 (self->im_blacklist);
	self->im_blacklist = _tmp8_;
	_tmp9_ = g_strdup ("");
	_g_free0 (self->widget_blacklist);
	self->widget_blacklist = _tmp9_;
	_tmp10_ = g_strdup ("");
	_g_free0 (self->terminal_manager_blacklist);
	self->terminal_manager_blacklist = _tmp10_;
	_tmp11_ = g_strdup ("");
	_g_free0 (self->audio_blacklist);
	self->audio_blacklist = _tmp11_;
	_tmp12_ = g_strdup ("");
	_g_free0 (self->video_blacklist);
	self->video_blacklist = _tmp12_;
	_tmp13_ = g_strdup ("");
	_g_free0 (self->audio_video_blacklist);
	self->audio_video_blacklist = _tmp13_;
	_tmp14_ = g_strdup ("");
	_g_free0 (self->viewer_blacklist);
	self->viewer_blacklist = _tmp14_;
	_tmp15_ = g_strdup ("");
	_g_free0 (self->text_editor_blacklist);
	self->text_editor_blacklist = _tmp15_;
	_tmp16_ = g_strdup ("");
	_g_free0 (self->archive_blacklist);
	self->archive_blacklist = _tmp16_;
	_tmp17_ = g_strdup ("");
	_g_free0 (self->spreadsheet_blacklist);
	self->spreadsheet_blacklist = _tmp17_;
	_tmp18_ = g_strdup ("");
	_g_free0 (self->bittorent_blacklist);
	self->bittorent_blacklist = _tmp18_;
	_tmp19_ = g_strdup ("");
	_g_free0 (self->document_blacklist);
	self->document_blacklist = _tmp19_;
	_tmp20_ = g_strdup ("");
	_g_free0 (self->burn_blacklist);
	self->burn_blacklist = _tmp20_;
	_tmp21_ = g_strdup ("");
	_g_free0 (self->tasks_blacklist);
	self->tasks_blacklist = _tmp21_;
	_tmp22_ = g_get_user_config_dir ();
	_tmp23_ = g_build_filename (_tmp22_, "lxsession-default-apps", "settings.conf", NULL);
	_g_free0 (self->priv->config_path);
	self->priv->config_path = _tmp23_;
	_tmp24_ = g_key_file_new ();
	_g_key_file_unref0 (self->priv->kf);
	self->priv->kf = _tmp24_;
	_tmp25_ = self->priv->config_path;
	g_message ("desktop-files-backend.vala:171: test config_path: %s", _tmp25_);
	{
		GKeyFile* _tmp26_;
		const gchar* _tmp27_;
		_tmp26_ = self->priv->kf;
		_tmp27_ = self->priv->config_path;
		g_key_file_load_from_file (_tmp26_, _tmp27_, G_KEY_FILE_NONE, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch0_g_key_file_error;
			}
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch0_g_file_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;
		}
	}
	goto __finally0;
	__catch0_g_key_file_error:
	{
		GError* err = NULL;
		GError* _tmp28_;
		const gchar* _tmp29_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp28_ = err;
		_tmp29_ = _tmp28_->message;
		g_warning ("desktop-files-backend.vala:179: %s", _tmp29_);
		_g_error_free0 (err);
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		GError* err = NULL;
		GError* _tmp30_;
		const gchar* _tmp31_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp30_ = err;
		_tmp31_ = _tmp30_->message;
		g_warning ("desktop-files-backend.vala:183: %s", _tmp31_);
		_g_error_free0 (err);
	}
	__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;
	}
}

void
lxsession_db_default_apps_on_finish_scanning_installed (LxsessionDBDefaultApps* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->mode;
	g_message ("desktop-files-backend.vala:189: Signal finish scanning installed with " \
"mode: %s", _tmp0_);
	_tmp1_ = self->priv->mode;
	if (g_strcmp0 (_tmp1_, "display") == 0) {
		lxsession_db_default_apps_print_values_installed (self);
	} else {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->mode;
		if (g_strcmp0 (_tmp2_, "write") == 0) {
			lxsession_db_default_apps_save_values_installed (self);
		}
	}
	self->state_installed = TRUE;
	if (self->state_available == TRUE) {
		g_signal_emit (self, lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_EXIT_NOW_SIGNAL], 0);
	}
}

void
lxsession_db_default_apps_on_finish_scanning_available (LxsessionDBDefaultApps* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->mode;
	g_message ("desktop-files-backend.vala:209: Signal finish scanning available with " \
"mode: %s", _tmp0_);
	_tmp1_ = self->priv->mode;
	if (g_strcmp0 (_tmp1_, "display") == 0) {
		LxsessionDBDefaultApps* _tmp2_;
		_tmp2_ = lxsession_global_db;
		lxsession_db_default_apps_print_values_available (_tmp2_);
	} else {
		const gchar* _tmp3_;
		_tmp3_ = self->priv->mode;
		if (g_strcmp0 (_tmp3_, "write") == 0) {
			LxsessionDBDefaultApps* _tmp4_;
			_tmp4_ = lxsession_global_db;
			lxsession_db_default_apps_save_values_available (_tmp4_);
		}
	}
	self->state_available = TRUE;
	if (self->state_installed == TRUE) {
		g_signal_emit (self, lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_EXIT_NOW_SIGNAL], 0);
	}
}

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

void
lxsession_db_default_apps_update_installed (LxsessionDBDefaultApps* self)
{
	gchar** default_install = NULL;
	gint default_install_length1;
	gint _default_install_size_;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (self != NULL);
	default_install = NULL;
	default_install_length1 = 0;
	_default_install_size_ = default_install_length1;
	_tmp0_ = self->priv->MimeFoldersInstalledGet;
	_tmp0__length1 = self->priv->MimeFoldersInstalledGet_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	default_install = (_vala_array_free (default_install, default_install_length1, (GDestroyNotify) g_free), NULL);
	default_install = _tmp1_;
	default_install_length1 = _tmp1__length1;
	_default_install_size_ = default_install_length1;
	_tmp2_ = default_install;
	_tmp2__length1 = default_install_length1;
	if (_tmp2_ != NULL) {
		gchar** _tmp3_;
		gint _tmp3__length1;
		_tmp3_ = default_install;
		_tmp3__length1 = default_install_length1;
		{
			gchar** folder_collection = NULL;
			gint folder_collection_length1 = 0;
			gint _folder_collection_size_ = 0;
			gint folder_it = 0;
			folder_collection = _tmp3_;
			folder_collection_length1 = _tmp3__length1;
			for (folder_it = 0; folder_it < folder_collection_length1; folder_it = folder_it + 1) {
				gchar* _tmp4_;
				gchar* folder = NULL;
				_tmp4_ = g_strdup (folder_collection[folder_it]);
				folder = _tmp4_;
				{
					const gchar* _tmp5_;
					const gchar* _tmp6_;
					_tmp5_ = folder;
					g_message ("desktop-files-backend.vala:237: Scanning folder: %s", _tmp5_);
					_tmp6_ = folder;
					lxsession_db_default_apps_list_desktop_files (self, _tmp6_, "installed", NULL, NULL);
					_g_free0 (folder);
				}
			}
		}
	} else {
		g_message ("desktop-files-backend.vala:243: No folders installed set. Abort");
	}
	default_install = (_vala_array_free (default_install, default_install_length1, (GDestroyNotify) g_free), 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;
}

void
lxsession_db_default_apps_update_available (LxsessionDBDefaultApps* self)
{
	gchar** default_available = NULL;
	gint default_available_length1;
	gint _default_available_size_;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (self != NULL);
	default_available = NULL;
	default_available_length1 = 0;
	_default_available_size_ = default_available_length1;
	_tmp0_ = self->priv->MimeFoldersAvailableGet;
	_tmp0__length1 = self->priv->MimeFoldersAvailableGet_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup2 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	default_available = (_vala_array_free (default_available, default_available_length1, (GDestroyNotify) g_free), NULL);
	default_available = _tmp1_;
	default_available_length1 = _tmp1__length1;
	_default_available_size_ = default_available_length1;
	_tmp2_ = default_available;
	_tmp2__length1 = default_available_length1;
	if (_tmp2_ != NULL) {
		gchar** _tmp3_;
		gint _tmp3__length1;
		_tmp3_ = default_available;
		_tmp3__length1 = default_available_length1;
		{
			gchar** folder_collection = NULL;
			gint folder_collection_length1 = 0;
			gint _folder_collection_size_ = 0;
			gint folder_it = 0;
			folder_collection = _tmp3_;
			folder_collection_length1 = _tmp3__length1;
			for (folder_it = 0; folder_it < folder_collection_length1; folder_it = folder_it + 1) {
				gchar* _tmp4_;
				gchar* folder = NULL;
				_tmp4_ = g_strdup (folder_collection[folder_it]);
				folder = _tmp4_;
				{
					GFile* dir_log = NULL;
					const gchar* _tmp5_;
					GFile* _tmp6_;
					GFile* _tmp7_;
					_tmp5_ = folder;
					_tmp6_ = g_file_new_for_path (_tmp5_);
					dir_log = _tmp6_;
					_tmp7_ = dir_log;
					if (g_file_query_exists (_tmp7_, NULL)) {
						const gchar* _tmp8_;
						const gchar* _tmp9_;
						_tmp8_ = folder;
						g_message ("desktop-files-backend.vala:260: Scanning folder: %s", _tmp8_);
						_tmp9_ = folder;
						lxsession_db_default_apps_list_desktop_files (self, _tmp9_, "available", NULL, NULL);
					} else {
						const gchar* _tmp10_;
						_tmp10_ = folder;
						g_message ("desktop-files-backend.vala:265: %s doesn't exist. Pass", _tmp10_);
						g_signal_emit (self, lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_AVAILABLE_SIGNAL], 0);
					}
					_g_object_unref0 (dir_log);
					_g_free0 (folder);
				}
			}
		}
	} else {
		g_message ("desktop-files-backend.vala:272: No folders available set. Abort");
	}
	default_available = (_vala_array_free (default_available, default_available_length1, (GDestroyNotify) g_free), NULL);
}

static void
_lxsession_db_default_apps_on_finish_scanning_installed_lxsession_db_default_apps_finish_scanning_installed (LxsessionDBDefaultApps* _sender,
                                                                                                             gpointer self)
{
	lxsession_db_default_apps_on_finish_scanning_installed ((LxsessionDBDefaultApps*) self);
}

static void
_lxsession_db_default_apps_on_finish_scanning_available_lxsession_db_default_apps_finish_scanning_available (LxsessionDBDefaultApps* _sender,
                                                                                                             gpointer self)
{
	lxsession_db_default_apps_on_finish_scanning_available ((LxsessionDBDefaultApps*) self);
}

void
lxsession_db_default_apps_update (LxsessionDBDefaultApps* self)
{
	g_return_if_fail (self != NULL);
	g_signal_connect_object (self, "finish-scanning-installed", (GCallback) _lxsession_db_default_apps_on_finish_scanning_installed_lxsession_db_default_apps_finish_scanning_installed, self, 0);
	g_signal_connect_object (self, "finish-scanning-available", (GCallback) _lxsession_db_default_apps_on_finish_scanning_available_lxsession_db_default_apps_finish_scanning_available, self, 0);
	lxsession_db_default_apps_update_installed (self);
	lxsession_db_default_apps_update_available (self);
}

static void
lxsession_db_default_apps_list_desktop_files_data_free (gpointer _data)
{
	LxsessionDbDefaultAppsListDesktopFilesData* _data_;
	_data_ = _data;
	_g_free0 (_data_->path);
	_g_free0 (_data_->mode);
	_g_object_unref0 (_data_->self);
	g_slice_free (LxsessionDbDefaultAppsListDesktopFilesData, _data_);
}

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

static void
lxsession_db_default_apps_list_desktop_files (LxsessionDBDefaultApps* self,
                                              const gchar* path,
                                              const gchar* mode,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	LxsessionDbDefaultAppsListDesktopFilesData* _data_;
	LxsessionDBDefaultApps* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (mode != NULL);
	_data_ = g_slice_new0 (LxsessionDbDefaultAppsListDesktopFilesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, lxsession_db_default_apps_list_desktop_files_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (path);
	_g_free0 (_data_->path);
	_data_->path = _tmp1_;
	_tmp2_ = g_strdup (mode);
	_g_free0 (_data_->mode);
	_data_->mode = _tmp2_;
	lxsession_db_default_apps_list_desktop_files_co (_data_);
}

static void
lxsession_db_default_apps_list_desktop_files_finish (LxsessionDBDefaultApps* self,
                                                     GAsyncResult* _res_)
{
	LxsessionDbDefaultAppsListDesktopFilesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
lxsession_db_default_apps_list_desktop_files_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	LxsessionDbDefaultAppsListDesktopFilesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	lxsession_db_default_apps_list_desktop_files_co (_data_);
}

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

static gboolean
lxsession_db_default_apps_list_desktop_files_co (LxsessionDbDefaultAppsListDesktopFilesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_message ("desktop-files-backend.vala:287: Start scanning\n");
	_data_->_tmp0_ = g_file_new_for_path (_data_->path);
	_data_->dir = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_key_file_new ();
		_data_->kf = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->dir;
		_data_->_state_ = 1;
		g_file_enumerate_children_async (_data_->_tmp2_, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, G_PRIORITY_DEFAULT, NULL, lxsession_db_default_apps_list_desktop_files_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = g_file_enumerate_children_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		_data_->e = _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_key_file_unref0 (_data_->kf);
			goto __catch0_g_error;
		}
		while (TRUE) {
			_data_->_tmp4_ = _data_->e;
			_data_->_state_ = 2;
			g_file_enumerator_next_files_async (_data_->_tmp4_, 10, G_PRIORITY_DEFAULT, NULL, lxsession_db_default_apps_list_desktop_files_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp5_ = g_file_enumerator_next_files_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error0_);
			_data_->files = _data_->_tmp5_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->e);
				_g_key_file_unref0 (_data_->kf);
				goto __catch0_g_error;
			}
			_data_->_tmp6_ = _data_->files;
			if (_data_->_tmp6_ == NULL) {
				(_data_->files == NULL) ? NULL : (_data_->files = (_g_list_free__g_object_unref0_ (_data_->files), NULL));
				break;
			}
			_data_->_tmp7_ = _data_->files;
			{
				_data_->info_collection = _data_->_tmp7_;
				for (_data_->info_it = _data_->info_collection; _data_->info_it != NULL; _data_->info_it = _data_->info_it->next) {
					_data_->_tmp8_ = _g_object_ref0 ((GFileInfo*) _data_->info_it->data);
					_data_->info = _data_->_tmp8_;
					{
						{
							_data_->_tmp9_ = _data_->info;
							_data_->_tmp10_ = g_file_info_get_name (_data_->_tmp9_);
							_data_->_tmp11_ = g_build_filename (_data_->path, _data_->_tmp10_, NULL);
							_data_->desktop_path = _data_->_tmp11_;
							_data_->_tmp12_ = _data_->kf;
							_data_->_tmp13_ = _data_->desktop_path;
							g_key_file_load_from_file (_data_->_tmp12_, _data_->_tmp13_, G_KEY_FILE_NONE, &_data_->_inner_error0_);
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
								_g_free0 (_data_->desktop_path);
								if (_data_->_inner_error0_->domain == G_KEY_FILE_ERROR) {
									goto __catch1_g_key_file_error;
								}
								if (_data_->_inner_error0_->domain == G_FILE_ERROR) {
									goto __catch1_g_file_error;
								}
								_g_object_unref0 (_data_->info);
								(_data_->files == NULL) ? NULL : (_data_->files = (_g_list_free__g_object_unref0_ (_data_->files), NULL));
								_g_object_unref0 (_data_->e);
								_g_key_file_unref0 (_data_->kf);
								_g_object_unref0 (_data_->dir);
								g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
								g_clear_error (&_data_->_inner_error0_);
								g_object_unref (_data_->_async_result);
								return FALSE;
							}
							_data_->_tmp15_ = _data_->kf;
							_data_->_tmp14_ = g_key_file_has_key (_data_->_tmp15_, "Desktop Entry", "Categories", &_data_->_inner_error0_);
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
								_g_free0 (_data_->desktop_path);
								if (_data_->_inner_error0_->domain == G_KEY_FILE_ERROR) {
									goto __catch1_g_key_file_error;
								}
								if (_data_->_inner_error0_->domain == G_FILE_ERROR) {
									goto __catch1_g_file_error;
								}
								_g_object_unref0 (_data_->info);
								(_data_->files == NULL) ? NULL : (_data_->files = (_g_list_free__g_object_unref0_ (_data_->files), NULL));
								_g_object_unref0 (_data_->e);
								_g_key_file_unref0 (_data_->kf);
								_g_object_unref0 (_data_->dir);
								g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
								g_clear_error (&_data_->_inner_error0_);
								g_object_unref (_data_->_async_result);
								return FALSE;
							}
							if (_data_->_tmp14_ == TRUE) {
								_data_->_tmp16_ = _data_->kf;
								_data_->_tmp17_ = _data_->desktop_path;
								_data_->_tmp18_ = _data_->info;
								_data_->_tmp19_ = g_file_info_get_name (_data_->_tmp18_);
								lxsession_db_default_apps_find_list (_data_->self, _data_->_tmp16_, _data_->_tmp17_, _data_->_tmp19_, _data_->mode);
							}
							_g_free0 (_data_->desktop_path);
						}
						goto __finally1;
						__catch1_g_key_file_error:
						{
							g_clear_error (&_data_->_inner_error0_);
						}
						goto __finally1;
						__catch1_g_file_error:
						{
							_data_->err = _data_->_inner_error0_;
							_data_->_inner_error0_ = NULL;
							_data_->_tmp20_ = _data_->err;
							_data_->_tmp21_ = _data_->_tmp20_->message;
							g_warning ("desktop-files-backend.vala:323: %s", _data_->_tmp21_);
							_g_error_free0 (_data_->err);
						}
						__finally1:
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							_g_object_unref0 (_data_->info);
							(_data_->files == NULL) ? NULL : (_data_->files = (_g_list_free__g_object_unref0_ (_data_->files), NULL));
							_g_object_unref0 (_data_->e);
							_g_key_file_unref0 (_data_->kf);
							goto __catch0_g_error;
						}
						_g_object_unref0 (_data_->info);
					}
				}
			}
			(_data_->files == NULL) ? NULL : (_data_->files = (_g_list_free__g_object_unref0_ (_data_->files), NULL));
		}
		if (g_strcmp0 (_data_->mode, "installed") == 0) {
			g_signal_emit (_data_->self, lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_INSTALLED_SIGNAL], 0);
		} else {
			if (g_strcmp0 (_data_->mode, "available") == 0) {
				g_signal_emit (_data_->self, lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_AVAILABLE_SIGNAL], 0);
			}
		}
		_g_object_unref0 (_data_->e);
		_g_key_file_unref0 (_data_->kf);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_vala1_err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp22_ = stderr;
		_data_->_tmp23_ = _data_->_vala1_err;
		_data_->_tmp24_ = _data_->_tmp23_->message;
		fprintf (_data_->_tmp22_, "Error: list_files failed: %s\n", _data_->_tmp24_);
		_g_error_free0 (_data_->_vala1_err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->dir);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_message ("desktop-files-backend.vala:342: Finishing scanning\n");
	_g_object_unref0 (_data_->dir);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gchar*
lxsession_db_default_apps_create_entry (LxsessionDBDefaultApps* self,
                                        GKeyFile* kf,
                                        const gchar* desktop_path)
{
	gchar* entry = NULL;
	gchar* _tmp0_;
	gchar* tmp_name = NULL;
	gchar* _tmp1_;
	gchar* tmp_icon = NULL;
	gchar* _tmp2_;
	gchar* tmp_install_package = NULL;
	gchar* _tmp3_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	const gchar* _tmp31_;
	gchar* _tmp32_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (kf != NULL, NULL);
	g_return_val_if_fail (desktop_path != NULL, NULL);
	_tmp0_ = g_strdup ("");
	entry = _tmp0_;
	_tmp1_ = g_strdup ("");
	tmp_name = _tmp1_;
	_tmp2_ = g_strdup ("");
	tmp_icon = _tmp2_;
	_tmp3_ = g_strdup ("");
	tmp_install_package = _tmp3_;
	{
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = g_key_file_get_locale_string (kf, "Desktop Entry", "Name", NULL, &_inner_error0_);
		_tmp4_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch0_g_key_file_error;
			}
			_g_free0 (tmp_install_package);
			_g_free0 (tmp_icon);
			_g_free0 (tmp_name);
			_g_free0 (entry);
			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;
		}
		_tmp6_ = _tmp4_;
		_tmp4_ = NULL;
		_g_free0 (tmp_name);
		tmp_name = _tmp6_;
		_g_free0 (_tmp4_);
	}
	goto __finally0;
	__catch0_g_key_file_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (tmp_install_package);
		_g_free0 (tmp_icon);
		_g_free0 (tmp_name);
		_g_free0 (entry);
		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;
	}
	{
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp8_ = g_key_file_get_value (kf, "Desktop Entry", "Icon", &_inner_error0_);
		_tmp7_ = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch1_g_key_file_error;
			}
			_g_free0 (tmp_install_package);
			_g_free0 (tmp_icon);
			_g_free0 (tmp_name);
			_g_free0 (entry);
			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;
		}
		_tmp9_ = _tmp7_;
		_tmp7_ = NULL;
		_g_free0 (tmp_icon);
		tmp_icon = _tmp9_;
		_g_free0 (_tmp7_);
	}
	goto __finally1;
	__catch1_g_key_file_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (tmp_install_package);
		_g_free0 (tmp_icon);
		_g_free0 (tmp_name);
		_g_free0 (entry);
		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;
	}
	{
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp11_ = g_key_file_get_value (kf, "Desktop Entry", "X-AppInstall-Package", &_inner_error0_);
		_tmp10_ = _tmp11_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch2_g_key_file_error;
			}
			_g_free0 (tmp_install_package);
			_g_free0 (tmp_icon);
			_g_free0 (tmp_name);
			_g_free0 (entry);
			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;
		}
		_tmp12_ = _tmp10_;
		_tmp10_ = NULL;
		_g_free0 (tmp_install_package);
		tmp_install_package = _tmp12_;
		_g_free0 (_tmp10_);
	}
	goto __finally2;
	__catch2_g_key_file_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (tmp_install_package);
		_g_free0 (tmp_icon);
		_g_free0 (tmp_name);
		_g_free0 (entry);
		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;
	}
	_tmp13_ = tmp_name;
	_tmp14_ = g_strconcat (_tmp13_, ",", NULL);
	_tmp15_ = _tmp14_;
	_tmp16_ = lxsession_db_default_apps_create_exec_string (self, kf);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (_tmp15_, _tmp17_, NULL);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_strconcat (_tmp19_, ",", NULL);
	_tmp21_ = _tmp20_;
	_tmp22_ = tmp_icon;
	_tmp23_ = g_strconcat (_tmp21_, _tmp22_, NULL);
	_tmp24_ = _tmp23_;
	_tmp25_ = g_strconcat (_tmp24_, ",", NULL);
	_tmp26_ = _tmp25_;
	_tmp27_ = g_strconcat (_tmp26_, desktop_path, NULL);
	_tmp28_ = _tmp27_;
	_tmp29_ = g_strconcat (_tmp28_, ",", NULL);
	_tmp30_ = _tmp29_;
	_tmp31_ = tmp_install_package;
	_tmp32_ = g_strconcat (_tmp30_, _tmp31_, NULL);
	_g_free0 (entry);
	entry = _tmp32_;
	_g_free0 (_tmp30_);
	_g_free0 (_tmp28_);
	_g_free0 (_tmp26_);
	_g_free0 (_tmp24_);
	_g_free0 (_tmp21_);
	_g_free0 (_tmp19_);
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	result = entry;
	_g_free0 (tmp_install_package);
	_g_free0 (tmp_icon);
	_g_free0 (tmp_name);
	return result;
}

gchar*
lxsession_db_default_apps_create_exec_string (LxsessionDBDefaultApps* self,
                                              GKeyFile* kf)
{
	gchar* tmp_string = NULL;
	gchar* _tmp0_;
	gchar** tmp_value = NULL;
	const gchar* _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gint tmp_value_length1;
	gint _tmp_value_size_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (kf != NULL, NULL);
	_tmp0_ = g_strdup ("");
	tmp_string = _tmp0_;
	{
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = g_key_file_get_value (kf, "Desktop Entry", "Exec", &_inner_error0_);
		_tmp1_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch0_g_key_file_error;
			}
			_g_free0 (tmp_string);
			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;
		}
		_tmp3_ = _tmp1_;
		_tmp1_ = NULL;
		_g_free0 (tmp_string);
		tmp_string = _tmp3_;
		_g_free0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_key_file_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (tmp_string);
		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;
	}
	_tmp4_ = tmp_string;
	_tmp6_ = _tmp5_ = g_strsplit_set (_tmp4_, " ", 0);
	tmp_value = _tmp6_;
	tmp_value_length1 = _vala_array_length (_tmp5_);
	_tmp_value_size_ = tmp_value_length1;
	_tmp7_ = tmp_value[0];
	_tmp8_ = g_strdup (_tmp7_);
	result = _tmp8_;
	tmp_value = (_vala_array_free (tmp_value, tmp_value_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (tmp_string);
	return result;
}

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

void
lxsession_db_default_apps_find_list (LxsessionDBDefaultApps* self,
                                     GKeyFile* kf,
                                     const gchar* desktop_path,
                                     const gchar* name,
                                     const gchar* mode)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (kf != NULL);
	g_return_if_fail (desktop_path != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (mode != NULL);
	{
		gchar* categories = NULL;
		gchar* _tmp0_;
		_tmp0_ = g_key_file_get_value (kf, "Desktop Entry", "Categories", &_inner_error0_);
		categories = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_KEY_FILE_ERROR) {
				goto __catch0_g_key_file_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;
		}
		if (categories != NULL) {
			if (string_contains (categories, "WebBrowser")) {
				const gchar* _tmp1_;
				_tmp1_ = self->webbrowser_installed_blacklist;
				if (string_contains (_tmp1_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp2_;
					_tmp2_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp2_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp3_;
						gchar* _tmp4_;
						_tmp3_ = new_entry;
						_tmp4_ = g_strdup (_tmp3_);
						self->webbrowser_installed = g_list_append (self->webbrowser_installed, _tmp4_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp5_;
							gchar* _tmp6_;
							_tmp5_ = new_entry;
							_tmp6_ = g_strdup (_tmp5_);
							self->webbrowser_available = g_list_append (self->webbrowser_available, _tmp6_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Email")) {
				const gchar* _tmp7_;
				_tmp7_ = self->email_installed_blacklist;
				if (string_contains (_tmp7_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp8_;
					_tmp8_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp8_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp9_;
						gchar* _tmp10_;
						_tmp9_ = new_entry;
						_tmp10_ = g_strdup (_tmp9_);
						self->email_installed = g_list_append (self->email_installed, _tmp10_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp11_;
							gchar* _tmp12_;
							_tmp11_ = new_entry;
							_tmp12_ = g_strdup (_tmp11_);
							self->email_available = g_list_append (self->email_available, _tmp12_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "FileManager")) {
				const gchar* _tmp13_;
				_tmp13_ = self->file_manager_blacklist;
				if (string_contains (_tmp13_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp14_;
					_tmp14_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp14_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp15_;
						gchar* _tmp16_;
						_tmp15_ = new_entry;
						_tmp16_ = g_strdup (_tmp15_);
						self->file_manager_installed = g_list_append (self->file_manager_installed, _tmp16_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp17_;
							gchar* _tmp18_;
							_tmp17_ = new_entry;
							_tmp18_ = g_strdup (_tmp17_);
							self->file_manager_available = g_list_append (self->file_manager_available, _tmp18_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Screensaver")) {
				const gchar* _tmp19_;
				_tmp19_ = self->screensaver_blacklist;
				if (string_contains (_tmp19_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp20_;
					_tmp20_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp20_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp21_;
						gchar* _tmp22_;
						_tmp21_ = new_entry;
						_tmp22_ = g_strdup (_tmp21_);
						self->screensaver_installed = g_list_append (self->screensaver_installed, _tmp22_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp23_;
							gchar* _tmp24_;
							_tmp23_ = new_entry;
							_tmp24_ = g_strdup (_tmp23_);
							self->screensaver_available = g_list_append (self->screensaver_available, _tmp24_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Composite")) {
				const gchar* _tmp25_;
				_tmp25_ = self->composite_manager_blacklist;
				if (string_contains (_tmp25_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp26_;
					_tmp26_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp26_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp27_;
						gchar* _tmp28_;
						_tmp27_ = new_entry;
						_tmp28_ = g_strdup (_tmp27_);
						self->composite_manager_installed = g_list_append (self->composite_manager_installed, _tmp28_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp29_;
							gchar* _tmp30_;
							_tmp29_ = new_entry;
							_tmp30_ = g_strdup (_tmp29_);
							self->composite_manager_available = g_list_append (self->composite_manager_available, _tmp30_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Desktop")) {
				const gchar* _tmp31_;
				_tmp31_ = self->desktop_manager_blacklist;
				if (string_contains (_tmp31_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp32_;
					_tmp32_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp32_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp33_;
						gchar* _tmp34_;
						_tmp33_ = new_entry;
						_tmp34_ = g_strdup (_tmp33_);
						self->desktop_manager_installed = g_list_append (self->desktop_manager_installed, _tmp34_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp35_;
							gchar* _tmp36_;
							_tmp35_ = new_entry;
							_tmp36_ = g_strdup (_tmp35_);
							self->desktop_manager_available = g_list_append (self->desktop_manager_available, _tmp36_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Power")) {
				const gchar* _tmp37_;
				_tmp37_ = self->power_manager_blacklist;
				if (string_contains (_tmp37_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp38_;
					_tmp38_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp38_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp39_;
						gchar* _tmp40_;
						_tmp39_ = new_entry;
						_tmp40_ = g_strdup (_tmp39_);
						self->power_manager_installed = g_list_append (self->power_manager_installed, _tmp40_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp41_;
							gchar* _tmp42_;
							_tmp41_ = new_entry;
							_tmp42_ = g_strdup (_tmp41_);
							self->power_manager_available = g_list_append (self->power_manager_available, _tmp42_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Polkit")) {
				const gchar* _tmp43_;
				_tmp43_ = self->polkit_blacklist;
				if (string_contains (_tmp43_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp44_;
					_tmp44_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp44_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp45_;
						gchar* _tmp46_;
						_tmp45_ = new_entry;
						_tmp46_ = g_strdup (_tmp45_);
						self->polkit_installed = g_list_append (self->polkit_installed, _tmp46_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp47_;
							gchar* _tmp48_;
							_tmp47_ = new_entry;
							_tmp48_ = g_strdup (_tmp47_);
							self->polkit_available = g_list_append (self->polkit_available, _tmp48_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "InstantMessaging")) {
				const gchar* _tmp49_;
				_tmp49_ = self->im_blacklist;
				if (string_contains (_tmp49_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp50_;
					_tmp50_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp50_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp51_;
						gchar* _tmp52_;
						_tmp51_ = new_entry;
						_tmp52_ = g_strdup (_tmp51_);
						self->im_installed = g_list_append (self->im_installed, _tmp52_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp53_;
							gchar* _tmp54_;
							_tmp53_ = new_entry;
							_tmp54_ = g_strdup (_tmp53_);
							self->im_available = g_list_append (self->im_available, _tmp54_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Widget")) {
				const gchar* _tmp55_;
				_tmp55_ = self->widget_blacklist;
				if (string_contains (_tmp55_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp56_;
					_tmp56_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp56_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp57_;
						gchar* _tmp58_;
						_tmp57_ = new_entry;
						_tmp58_ = g_strdup (_tmp57_);
						self->widget_installed = g_list_append (self->widget_installed, _tmp58_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp59_;
							gchar* _tmp60_;
							_tmp59_ = new_entry;
							_tmp60_ = g_strdup (_tmp59_);
							self->widget_available = g_list_append (self->widget_available, _tmp60_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Terminal")) {
				const gchar* _tmp61_;
				_tmp61_ = self->terminal_manager_blacklist;
				if (string_contains (_tmp61_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp62_;
					_tmp62_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp62_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp63_;
						gchar* _tmp64_;
						_tmp63_ = new_entry;
						_tmp64_ = g_strdup (_tmp63_);
						self->terminal_manager_installed = g_list_append (self->terminal_manager_installed, _tmp64_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp65_;
							gchar* _tmp66_;
							_tmp65_ = new_entry;
							_tmp66_ = g_strdup (_tmp65_);
							self->terminal_manager_available = g_list_append (self->terminal_manager_available, _tmp66_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "AudioVideo")) {
				const gchar* _tmp67_;
				_tmp67_ = self->audio_video_blacklist;
				if (string_contains (_tmp67_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp68_;
					_tmp68_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp68_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp69_;
						gchar* _tmp70_;
						const gchar* _tmp71_;
						gchar* _tmp72_;
						_tmp69_ = new_entry;
						_tmp70_ = g_strdup (_tmp69_);
						self->audio_installed = g_list_append (self->audio_installed, _tmp70_);
						_tmp71_ = new_entry;
						_tmp72_ = g_strdup (_tmp71_);
						self->video_installed = g_list_append (self->video_installed, _tmp72_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp73_;
							gchar* _tmp74_;
							const gchar* _tmp75_;
							gchar* _tmp76_;
							_tmp73_ = new_entry;
							_tmp74_ = g_strdup (_tmp73_);
							self->audio_installed = g_list_append (self->audio_installed, _tmp74_);
							_tmp75_ = new_entry;
							_tmp76_ = g_strdup (_tmp75_);
							self->video_available = g_list_append (self->video_available, _tmp76_);
						}
					}
					_g_free0 (new_entry);
				}
			} else {
				if (string_contains (categories, "Audio")) {
					const gchar* _tmp77_;
					_tmp77_ = self->audio_blacklist;
					if (string_contains (_tmp77_, name)) {
					} else {
						gchar* new_entry = NULL;
						gchar* _tmp78_;
						_tmp78_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
						new_entry = _tmp78_;
						if (g_strcmp0 (mode, "installed") == 0) {
							const gchar* _tmp79_;
							gchar* _tmp80_;
							_tmp79_ = new_entry;
							_tmp80_ = g_strdup (_tmp79_);
							self->audio_installed = g_list_append (self->audio_installed, _tmp80_);
						} else {
							if (g_strcmp0 (mode, "available") == 0) {
								const gchar* _tmp81_;
								gchar* _tmp82_;
								_tmp81_ = new_entry;
								_tmp82_ = g_strdup (_tmp81_);
								self->audio_available = g_list_append (self->audio_available, _tmp82_);
							}
						}
						_g_free0 (new_entry);
					}
				} else {
					if (string_contains (categories, "Video")) {
						const gchar* _tmp83_;
						_tmp83_ = self->video_blacklist;
						if (string_contains (_tmp83_, name)) {
						} else {
							gchar* new_entry = NULL;
							gchar* _tmp84_;
							_tmp84_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
							new_entry = _tmp84_;
							if (g_strcmp0 (mode, "installed") == 0) {
								const gchar* _tmp85_;
								gchar* _tmp86_;
								_tmp85_ = new_entry;
								_tmp86_ = g_strdup (_tmp85_);
								self->video_installed = g_list_append (self->video_installed, _tmp86_);
							} else {
								if (g_strcmp0 (mode, "available") == 0) {
									const gchar* _tmp87_;
									gchar* _tmp88_;
									_tmp87_ = new_entry;
									_tmp88_ = g_strdup (_tmp87_);
									self->video_available = g_list_append (self->video_available, _tmp88_);
								}
							}
							_g_free0 (new_entry);
						}
					}
				}
			}
			if (string_contains (categories, "Viewer")) {
				const gchar* _tmp89_;
				_tmp89_ = self->viewer_blacklist;
				if (string_contains (_tmp89_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp90_;
					_tmp90_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp90_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp91_;
						gchar* _tmp92_;
						const gchar* _tmp93_;
						gchar* _tmp94_;
						_tmp91_ = new_entry;
						_tmp92_ = g_strdup (_tmp91_);
						self->image_display_installed = g_list_append (self->image_display_installed, _tmp92_);
						_tmp93_ = new_entry;
						_tmp94_ = g_strdup (_tmp93_);
						self->pdf_reader_installed = g_list_append (self->pdf_reader_installed, _tmp94_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp95_;
							gchar* _tmp96_;
							const gchar* _tmp97_;
							gchar* _tmp98_;
							_tmp95_ = new_entry;
							_tmp96_ = g_strdup (_tmp95_);
							self->image_display_available = g_list_append (self->image_display_available, _tmp96_);
							_tmp97_ = new_entry;
							_tmp98_ = g_strdup (_tmp97_);
							self->pdf_reader_available = g_list_append (self->pdf_reader_available, _tmp98_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "TextEditor")) {
				const gchar* _tmp99_;
				_tmp99_ = self->text_editor_blacklist;
				if (string_contains (_tmp99_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp100_;
					_tmp100_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp100_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp101_;
						gchar* _tmp102_;
						_tmp101_ = new_entry;
						_tmp102_ = g_strdup (_tmp101_);
						self->text_editor_installed = g_list_append (self->text_editor_installed, _tmp102_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp103_;
							gchar* _tmp104_;
							_tmp103_ = new_entry;
							_tmp104_ = g_strdup (_tmp103_);
							self->text_editor_available = g_list_append (self->text_editor_available, _tmp104_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Archiving")) {
				const gchar* _tmp105_;
				_tmp105_ = self->archive_blacklist;
				if (string_contains (_tmp105_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp106_;
					_tmp106_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp106_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp107_;
						gchar* _tmp108_;
						_tmp107_ = new_entry;
						_tmp108_ = g_strdup (_tmp107_);
						self->archive_installed = g_list_append (self->archive_installed, _tmp108_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp109_;
							gchar* _tmp110_;
							_tmp109_ = new_entry;
							_tmp110_ = g_strdup (_tmp109_);
							self->archive_available = g_list_append (self->archive_available, _tmp110_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Spreadsheet")) {
				const gchar* _tmp111_;
				_tmp111_ = self->spreadsheet_blacklist;
				if (string_contains (_tmp111_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp112_;
					_tmp112_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp112_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp113_;
						gchar* _tmp114_;
						_tmp113_ = new_entry;
						_tmp114_ = g_strdup (_tmp113_);
						self->spreadsheet_installed = g_list_append (self->spreadsheet_installed, _tmp114_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp115_;
							gchar* _tmp116_;
							_tmp115_ = new_entry;
							_tmp116_ = g_strdup (_tmp115_);
							self->spreadsheet_available = g_list_append (self->spreadsheet_available, _tmp116_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "P2P")) {
				const gchar* _tmp117_;
				_tmp117_ = self->bittorent_blacklist;
				if (string_contains (_tmp117_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp118_;
					_tmp118_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp118_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp119_;
						gchar* _tmp120_;
						_tmp119_ = new_entry;
						_tmp120_ = g_strdup (_tmp119_);
						self->bittorent_installed = g_list_append (self->bittorent_installed, _tmp120_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp121_;
							gchar* _tmp122_;
							_tmp121_ = new_entry;
							_tmp122_ = g_strdup (_tmp121_);
							self->bittorent_available = g_list_append (self->bittorent_available, _tmp122_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "WordProcessor")) {
				const gchar* _tmp123_;
				_tmp123_ = self->document_blacklist;
				if (string_contains (_tmp123_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp124_;
					_tmp124_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp124_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp125_;
						gchar* _tmp126_;
						_tmp125_ = new_entry;
						_tmp126_ = g_strdup (_tmp125_);
						self->document_installed = g_list_append (self->document_installed, _tmp126_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp127_;
							gchar* _tmp128_;
							_tmp127_ = new_entry;
							_tmp128_ = g_strdup (_tmp127_);
							self->document_available = g_list_append (self->document_available, _tmp128_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "DiscBurning")) {
				const gchar* _tmp129_;
				_tmp129_ = self->burn_blacklist;
				if (string_contains (_tmp129_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp130_;
					_tmp130_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp130_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp131_;
						gchar* _tmp132_;
						_tmp131_ = new_entry;
						_tmp132_ = g_strdup (_tmp131_);
						self->burn_installed = g_list_append (self->burn_installed, _tmp132_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp133_;
							gchar* _tmp134_;
							_tmp133_ = new_entry;
							_tmp134_ = g_strdup (_tmp133_);
							self->burn_available = g_list_append (self->burn_available, _tmp134_);
						}
					}
					_g_free0 (new_entry);
				}
			}
			if (string_contains (categories, "Monitor")) {
				const gchar* _tmp135_;
				_tmp135_ = self->tasks_blacklist;
				if (string_contains (_tmp135_, name)) {
				} else {
					gchar* new_entry = NULL;
					gchar* _tmp136_;
					_tmp136_ = lxsession_db_default_apps_create_entry (self, kf, desktop_path);
					new_entry = _tmp136_;
					if (g_strcmp0 (mode, "installed") == 0) {
						const gchar* _tmp137_;
						gchar* _tmp138_;
						_tmp137_ = new_entry;
						_tmp138_ = g_strdup (_tmp137_);
						self->tasks_installed = g_list_append (self->tasks_installed, _tmp138_);
					} else {
						if (g_strcmp0 (mode, "available") == 0) {
							const gchar* _tmp139_;
							gchar* _tmp140_;
							_tmp139_ = new_entry;
							_tmp140_ = g_strdup (_tmp139_);
							self->tasks_available = g_list_append (self->tasks_available, _tmp140_);
						}
					}
					_g_free0 (new_entry);
				}
			}
		}
		_g_free0 (categories);
	}
	goto __finally0;
	__catch0_g_key_file_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

void
lxsession_db_default_apps_print_values_available (LxsessionDBDefaultApps* self)
{
	GList* _tmp0_;
	GList* _tmp3_;
	g_return_if_fail (self != NULL);
	g_message ("desktop-files-backend.vala:863: Printing available webbrowser");
	_tmp0_ = self->webbrowser_available;
	{
		GList* entry_collection = NULL;
		GList* entry_it = NULL;
		entry_collection = _tmp0_;
		for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
			gchar* _tmp1_;
			gchar* entry = NULL;
			_tmp1_ = g_strdup ((const gchar*) entry_it->data);
			entry = _tmp1_;
			{
				const gchar* _tmp2_;
				_tmp2_ = entry;
				g_message ("desktop-files-backend.vala:866: %s", _tmp2_);
				_g_free0 (entry);
			}
		}
	}
	g_message ("desktop-files-backend.vala:869: Printing available email");
	_tmp3_ = self->email_available;
	{
		GList* entry_collection = NULL;
		GList* entry_it = NULL;
		entry_collection = _tmp3_;
		for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
			gchar* _tmp4_;
			gchar* entry = NULL;
			_tmp4_ = g_strdup ((const gchar*) entry_it->data);
			entry = _tmp4_;
			{
				const gchar* _tmp5_;
				_tmp5_ = entry;
				g_message ("desktop-files-backend.vala:872: %s", _tmp5_);
				_g_free0 (entry);
			}
		}
	}
}

void
lxsession_db_default_apps_print_values_installed (LxsessionDBDefaultApps* self)
{
	GList* _tmp0_;
	GList* _tmp3_;
	g_return_if_fail (self != NULL);
	g_message ("desktop-files-backend.vala:878: Printing installed webbrowser");
	_tmp0_ = self->webbrowser_installed;
	{
		GList* entry_collection = NULL;
		GList* entry_it = NULL;
		entry_collection = _tmp0_;
		for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
			gchar* _tmp1_;
			gchar* entry = NULL;
			_tmp1_ = g_strdup ((const gchar*) entry_it->data);
			entry = _tmp1_;
			{
				const gchar* _tmp2_;
				_tmp2_ = entry;
				g_message ("desktop-files-backend.vala:881: %s", _tmp2_);
				_g_free0 (entry);
			}
		}
	}
	g_message ("desktop-files-backend.vala:884: Printing installed email");
	_tmp3_ = self->email_installed;
	{
		GList* entry_collection = NULL;
		GList* entry_it = NULL;
		entry_collection = _tmp3_;
		for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
			gchar* _tmp4_;
			gchar* entry = NULL;
			_tmp4_ = g_strdup ((const gchar*) entry_it->data);
			entry = _tmp4_;
			{
				const gchar* _tmp5_;
				_tmp5_ = entry;
				g_message ("desktop-files-backend.vala:887: %s", _tmp5_);
				_g_free0 (entry);
			}
		}
	}
}

void
lxsession_db_default_apps_save_values_installed (LxsessionDBDefaultApps* self)
{
	GKeyFile* _tmp0_;
	GList* _tmp1_;
	GKeyFile* _tmp2_;
	GList* _tmp3_;
	GKeyFile* _tmp4_;
	GList* _tmp5_;
	GKeyFile* _tmp6_;
	GList* _tmp7_;
	GKeyFile* _tmp8_;
	GList* _tmp9_;
	GKeyFile* _tmp10_;
	GList* _tmp11_;
	GKeyFile* _tmp12_;
	GList* _tmp13_;
	GKeyFile* _tmp14_;
	GList* _tmp15_;
	GKeyFile* _tmp16_;
	GList* _tmp17_;
	GKeyFile* _tmp18_;
	GList* _tmp19_;
	GKeyFile* _tmp20_;
	GList* _tmp21_;
	GKeyFile* _tmp22_;
	GList* _tmp23_;
	GKeyFile* _tmp24_;
	GList* _tmp25_;
	GKeyFile* _tmp26_;
	GList* _tmp27_;
	GKeyFile* _tmp28_;
	GList* _tmp29_;
	GKeyFile* _tmp30_;
	GList* _tmp31_;
	GKeyFile* _tmp32_;
	GList* _tmp33_;
	GKeyFile* _tmp34_;
	GList* _tmp35_;
	GKeyFile* _tmp36_;
	GList* _tmp37_;
	GKeyFile* _tmp38_;
	GList* _tmp39_;
	GKeyFile* _tmp40_;
	GList* _tmp41_;
	GKeyFile* _tmp42_;
	GList* _tmp43_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->kf;
	_tmp1_ = self->webbrowser_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp0_, "Mime", "webbrowser/installed", _tmp1_);
	_tmp2_ = self->priv->kf;
	_tmp3_ = self->email_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp2_, "Mime", "email/installed", _tmp3_);
	_tmp4_ = self->priv->kf;
	_tmp5_ = self->file_manager_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp4_, "Mime", "file_manager/installed", _tmp5_);
	_tmp6_ = self->priv->kf;
	_tmp7_ = self->screensaver_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp6_, "Mime", "screensaver/installed", _tmp7_);
	_tmp8_ = self->priv->kf;
	_tmp9_ = self->composite_manager_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp8_, "Mime", "composite_manager/installed", _tmp9_);
	_tmp10_ = self->priv->kf;
	_tmp11_ = self->desktop_manager_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp10_, "Mime", "desktop_manager/installed", _tmp11_);
	_tmp12_ = self->priv->kf;
	_tmp13_ = self->power_manager_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp12_, "Mime", "power_manager/installed", _tmp13_);
	_tmp14_ = self->priv->kf;
	_tmp15_ = self->polkit_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp14_, "Mime", "polkit/installed", _tmp15_);
	_tmp16_ = self->priv->kf;
	_tmp17_ = self->im_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp16_, "Mime", "im/installed", _tmp17_);
	_tmp18_ = self->priv->kf;
	_tmp19_ = self->widget_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp18_, "Mime", "widget/installed", _tmp19_);
	_tmp20_ = self->priv->kf;
	_tmp21_ = self->terminal_manager_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp20_, "Mime", "terminal_manager/installed", _tmp21_);
	_tmp22_ = self->priv->kf;
	_tmp23_ = self->audio_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp22_, "Mime", "audio_player/installed", _tmp23_);
	_tmp24_ = self->priv->kf;
	_tmp25_ = self->video_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp24_, "Mime", "video_player/installed", _tmp25_);
	_tmp26_ = self->priv->kf;
	_tmp27_ = self->pdf_reader_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp26_, "Mime", "pdf_reader/installed", _tmp27_);
	_tmp28_ = self->priv->kf;
	_tmp29_ = self->image_display_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp28_, "Mime", "image_display/installed", _tmp29_);
	_tmp30_ = self->priv->kf;
	_tmp31_ = self->text_editor_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp30_, "Mime", "text_editor/installed", _tmp31_);
	_tmp32_ = self->priv->kf;
	_tmp33_ = self->archive_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp32_, "Mime", "archive/installed", _tmp33_);
	_tmp34_ = self->priv->kf;
	_tmp35_ = self->spreadsheet_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp34_, "Mime", "spreadsheet/installed", _tmp35_);
	_tmp36_ = self->priv->kf;
	_tmp37_ = self->bittorent_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp36_, "Mime", "bittorent/installed", _tmp37_);
	_tmp38_ = self->priv->kf;
	_tmp39_ = self->document_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp38_, "Mime", "document/installed", _tmp39_);
	_tmp40_ = self->priv->kf;
	_tmp41_ = self->burn_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp40_, "Mime", "burn/installed", _tmp41_);
	_tmp42_ = self->priv->kf;
	_tmp43_ = self->tasks_installed;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp42_, "Mime", "tasks/installed", _tmp43_);
	lxsession_db_default_apps_save_keyfile (self);
}

void
lxsession_db_default_apps_save_values_available (LxsessionDBDefaultApps* self)
{
	GKeyFile* _tmp0_;
	GList* _tmp1_;
	GKeyFile* _tmp2_;
	GList* _tmp3_;
	GKeyFile* _tmp4_;
	GList* _tmp5_;
	GKeyFile* _tmp6_;
	GList* _tmp7_;
	GKeyFile* _tmp8_;
	GList* _tmp9_;
	GKeyFile* _tmp10_;
	GList* _tmp11_;
	GKeyFile* _tmp12_;
	GList* _tmp13_;
	GKeyFile* _tmp14_;
	GList* _tmp15_;
	GKeyFile* _tmp16_;
	GList* _tmp17_;
	GKeyFile* _tmp18_;
	GList* _tmp19_;
	GKeyFile* _tmp20_;
	GList* _tmp21_;
	GKeyFile* _tmp22_;
	GList* _tmp23_;
	GKeyFile* _tmp24_;
	GList* _tmp25_;
	GKeyFile* _tmp26_;
	GList* _tmp27_;
	GKeyFile* _tmp28_;
	GList* _tmp29_;
	GKeyFile* _tmp30_;
	GList* _tmp31_;
	GKeyFile* _tmp32_;
	GList* _tmp33_;
	GKeyFile* _tmp34_;
	GList* _tmp35_;
	GKeyFile* _tmp36_;
	GList* _tmp37_;
	GKeyFile* _tmp38_;
	GList* _tmp39_;
	GKeyFile* _tmp40_;
	GList* _tmp41_;
	GKeyFile* _tmp42_;
	GList* _tmp43_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->kf;
	_tmp1_ = self->webbrowser_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp0_, "Mime", "webbrowser/available", _tmp1_);
	_tmp2_ = self->priv->kf;
	_tmp3_ = self->email_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp2_, "Mime", "email/available", _tmp3_);
	_tmp4_ = self->priv->kf;
	_tmp5_ = self->file_manager_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp4_, "Mime", "file_manager/available", _tmp5_);
	_tmp6_ = self->priv->kf;
	_tmp7_ = self->screensaver_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp6_, "Mime", "screensaver/available", _tmp7_);
	_tmp8_ = self->priv->kf;
	_tmp9_ = self->composite_manager_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp8_, "Mime", "composite_manager/available", _tmp9_);
	_tmp10_ = self->priv->kf;
	_tmp11_ = self->desktop_manager_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp10_, "Mime", "desktop_manager/available", _tmp11_);
	_tmp12_ = self->priv->kf;
	_tmp13_ = self->power_manager_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp12_, "Mime", "power_manager/available", _tmp13_);
	_tmp14_ = self->priv->kf;
	_tmp15_ = self->polkit_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp14_, "Mime", "polkit/available", _tmp15_);
	_tmp16_ = self->priv->kf;
	_tmp17_ = self->im_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp16_, "Mime", "im/available", _tmp17_);
	_tmp18_ = self->priv->kf;
	_tmp19_ = self->widget_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp18_, "Mime", "widget/available", _tmp19_);
	_tmp20_ = self->priv->kf;
	_tmp21_ = self->terminal_manager_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp20_, "Mime", "terminal_manager/available", _tmp21_);
	_tmp22_ = self->priv->kf;
	_tmp23_ = self->audio_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp22_, "Mime", "audio_player/available", _tmp23_);
	_tmp24_ = self->priv->kf;
	_tmp25_ = self->video_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp24_, "Mime", "video_player/available", _tmp25_);
	_tmp26_ = self->priv->kf;
	_tmp27_ = self->pdf_reader_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp26_, "Mime", "pdf_reader/available", _tmp27_);
	_tmp28_ = self->priv->kf;
	_tmp29_ = self->image_display_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp28_, "Mime", "image_display/available", _tmp29_);
	_tmp30_ = self->priv->kf;
	_tmp31_ = self->text_editor_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp30_, "Mime", "text_editor/available", _tmp31_);
	_tmp32_ = self->priv->kf;
	_tmp33_ = self->archive_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp32_, "Mime", "archive/available", _tmp33_);
	_tmp34_ = self->priv->kf;
	_tmp35_ = self->spreadsheet_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp34_, "Mime", "spreadsheet/available", _tmp35_);
	_tmp36_ = self->priv->kf;
	_tmp37_ = self->bittorent_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp36_, "Mime", "bittorent/available", _tmp37_);
	_tmp38_ = self->priv->kf;
	_tmp39_ = self->document_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp38_, "Mime", "document/available", _tmp39_);
	_tmp40_ = self->priv->kf;
	_tmp41_ = self->burn_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp40_, "Mime", "burn/available", _tmp41_);
	_tmp42_ = self->priv->kf;
	_tmp43_ = self->tasks_available;
	lxsession_db_default_apps_keyfile_set_list_string (self, _tmp42_, "Mime", "tasks/available", _tmp43_);
	lxsession_db_default_apps_save_keyfile (self);
}

void
lxsession_db_default_apps_save_keyfile (LxsessionDBDefaultApps* self)
{
	gchar* str = NULL;
	GKeyFile* _tmp0_;
	gchar* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->kf;
	_tmp1_ = g_key_file_to_data (_tmp0_, NULL, NULL);
	str = _tmp1_;
	{
		const gchar* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		_tmp2_ = self->priv->config_path;
		_tmp3_ = strlen (str);
		_tmp4_ = _tmp3_;
		g_file_set_contents (_tmp2_, str, (gssize) _tmp4_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch0_g_file_error;
			}
			_g_free0 (str);
			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;
		}
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		GError* err = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = err;
		_tmp6_ = _tmp5_->message;
		g_warning ("desktop-files-backend.vala:956: %s", _tmp6_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (str);
		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 (str);
}

static void
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

void
lxsession_db_default_apps_keyfile_set_list_string (LxsessionDBDefaultApps* self,
                                                   GKeyFile* kf,
                                                   const gchar* categorie,
                                                   const gchar* key1,
                                                   GList* list)
{
	gchar** tmp_array = NULL;
	gchar** _tmp0_;
	gint tmp_array_length1;
	gint _tmp_array_size_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (kf != NULL);
	g_return_if_fail (categorie != NULL);
	g_return_if_fail (key1 != NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	tmp_array = _tmp0_;
	tmp_array_length1 = 0;
	_tmp_array_size_ = tmp_array_length1;
	{
		GList* entry_collection = NULL;
		GList* entry_it = NULL;
		entry_collection = list;
		for (entry_it = entry_collection; entry_it != NULL; entry_it = entry_it->next) {
			gchar* _tmp1_;
			gchar* entry = NULL;
			_tmp1_ = g_strdup ((const gchar*) entry_it->data);
			entry = _tmp1_;
			{
				const gchar* _tmp2_;
				_tmp2_ = entry;
				if (_tmp2_ != NULL) {
					const gchar* _tmp3_;
					gchar* _tmp4_;
					_tmp3_ = entry;
					_tmp4_ = g_strdup (_tmp3_);
					_vala_array_add1 (&tmp_array, &tmp_array_length1, &_tmp_array_size_, _tmp4_);
				}
				_g_free0 (entry);
			}
		}
	}
	_tmp5_ = tmp_array;
	_tmp5__length1 = tmp_array_length1;
	g_key_file_set_string_list (kf, categorie, key1, (const gchar* const*) _tmp5_, (gint) _tmp5__length1);
	tmp_array = (_vala_array_free (tmp_array, tmp_array_length1, (GDestroyNotify) g_free), NULL);
}

static void
lxsession_db_default_apps_class_init (LxsessionDBDefaultAppsClass * klass,
                                      gpointer klass_data)
{
	lxsession_db_default_apps_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LxsessionDBDefaultApps_private_offset);
	G_OBJECT_CLASS (klass)->finalize = lxsession_db_default_apps_finalize;
	lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_INSTALLED_SIGNAL] = g_signal_new ("finish-scanning-installed", LXSESSION_TYPE_DB_DEFAULT_APPS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_FINISH_SCANNING_AVAILABLE_SIGNAL] = g_signal_new ("finish-scanning-available", LXSESSION_TYPE_DB_DEFAULT_APPS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	lxsession_db_default_apps_signals[LXSESSION_DB_DEFAULT_APPS_EXIT_NOW_SIGNAL] = g_signal_new ("exit-now", LXSESSION_TYPE_DB_DEFAULT_APPS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
lxsession_db_default_apps_instance_init (LxsessionDBDefaultApps * self,
                                         gpointer klass)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	self->priv = lxsession_db_default_apps_get_instance_private (self);
	self->webbrowser_installed = NULL;
	self->webbrowser_available = NULL;
	self->email_installed = NULL;
	self->email_available = NULL;
	self->file_manager_installed = NULL;
	self->file_manager_available = NULL;
	self->screensaver_installed = NULL;
	self->screensaver_available = NULL;
	self->composite_manager_installed = NULL;
	self->composite_manager_available = NULL;
	self->desktop_manager_installed = NULL;
	self->desktop_manager_available = NULL;
	self->power_manager_installed = NULL;
	self->power_manager_available = NULL;
	self->polkit_installed = NULL;
	self->polkit_available = NULL;
	self->im_installed = NULL;
	self->im_available = NULL;
	self->widget_installed = NULL;
	self->widget_available = NULL;
	self->terminal_manager_installed = NULL;
	self->terminal_manager_available = NULL;
	self->audio_installed = NULL;
	self->audio_available = NULL;
	self->video_installed = NULL;
	self->video_available = NULL;
	self->image_display_installed = NULL;
	self->pdf_reader_installed = NULL;
	self->image_display_available = NULL;
	self->pdf_reader_available = NULL;
	self->text_editor_installed = NULL;
	self->text_editor_available = NULL;
	self->archive_installed = NULL;
	self->archive_available = NULL;
	self->spreadsheet_installed = NULL;
	self->spreadsheet_available = NULL;
	self->bittorent_installed = NULL;
	self->bittorent_available = NULL;
	self->document_installed = NULL;
	self->document_available = NULL;
	self->burn_installed = NULL;
	self->burn_available = NULL;
	self->tasks_installed = NULL;
	self->tasks_available = NULL;
	self->state_installed = FALSE;
	self->state_available = FALSE;
	_tmp0_ = g_strdup ("/usr/share/applications");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	self->priv->MimeFoldersInstalledGet = _tmp1_;
	self->priv->MimeFoldersInstalledGet_length1 = 1;
	self->priv->_MimeFoldersInstalledGet_size_ = self->priv->MimeFoldersInstalledGet_length1;
	_tmp2_ = g_strdup ("/usr/share/app-install/desktop");
	_tmp3_ = g_new0 (gchar*, 1 + 1);
	_tmp3_[0] = _tmp2_;
	self->priv->MimeFoldersAvailableGet = _tmp3_;
	self->priv->MimeFoldersAvailableGet_length1 = 1;
	self->priv->_MimeFoldersAvailableGet_size_ = self->priv->MimeFoldersAvailableGet_length1;
}

static void
lxsession_db_default_apps_finalize (GObject * obj)
{
	LxsessionDBDefaultApps * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LXSESSION_TYPE_DB_DEFAULT_APPS, LxsessionDBDefaultApps);
	(self->webbrowser_installed == NULL) ? NULL : (self->webbrowser_installed = (_g_list_free__g_free0_ (self->webbrowser_installed), NULL));
	(self->webbrowser_available == NULL) ? NULL : (self->webbrowser_available = (_g_list_free__g_free0_ (self->webbrowser_available), NULL));
	_g_free0 (self->webbrowser_installed_blacklist);
	(self->email_installed == NULL) ? NULL : (self->email_installed = (_g_list_free__g_free0_ (self->email_installed), NULL));
	(self->email_available == NULL) ? NULL : (self->email_available = (_g_list_free__g_free0_ (self->email_available), NULL));
	_g_free0 (self->email_installed_blacklist);
	(self->file_manager_installed == NULL) ? NULL : (self->file_manager_installed = (_g_list_free__g_free0_ (self->file_manager_installed), NULL));
	(self->file_manager_available == NULL) ? NULL : (self->file_manager_available = (_g_list_free__g_free0_ (self->file_manager_available), NULL));
	_g_free0 (self->file_manager_blacklist);
	_g_free0 (self->screensaver_blacklist);
	(self->screensaver_installed == NULL) ? NULL : (self->screensaver_installed = (_g_list_free__g_free0_ (self->screensaver_installed), NULL));
	(self->screensaver_available == NULL) ? NULL : (self->screensaver_available = (_g_list_free__g_free0_ (self->screensaver_available), NULL));
	_g_free0 (self->composite_manager_blacklist);
	(self->composite_manager_installed == NULL) ? NULL : (self->composite_manager_installed = (_g_list_free__g_free0_ (self->composite_manager_installed), NULL));
	(self->composite_manager_available == NULL) ? NULL : (self->composite_manager_available = (_g_list_free__g_free0_ (self->composite_manager_available), NULL));
	_g_free0 (self->desktop_manager_blacklist);
	(self->desktop_manager_installed == NULL) ? NULL : (self->desktop_manager_installed = (_g_list_free__g_free0_ (self->desktop_manager_installed), NULL));
	(self->desktop_manager_available == NULL) ? NULL : (self->desktop_manager_available = (_g_list_free__g_free0_ (self->desktop_manager_available), NULL));
	_g_free0 (self->power_manager_blacklist);
	(self->power_manager_installed == NULL) ? NULL : (self->power_manager_installed = (_g_list_free__g_free0_ (self->power_manager_installed), NULL));
	(self->power_manager_available == NULL) ? NULL : (self->power_manager_available = (_g_list_free__g_free0_ (self->power_manager_available), NULL));
	_g_free0 (self->polkit_blacklist);
	(self->polkit_installed == NULL) ? NULL : (self->polkit_installed = (_g_list_free__g_free0_ (self->polkit_installed), NULL));
	(self->polkit_available == NULL) ? NULL : (self->polkit_available = (_g_list_free__g_free0_ (self->polkit_available), NULL));
	_g_free0 (self->im_blacklist);
	(self->im_installed == NULL) ? NULL : (self->im_installed = (_g_list_free__g_free0_ (self->im_installed), NULL));
	(self->im_available == NULL) ? NULL : (self->im_available = (_g_list_free__g_free0_ (self->im_available), NULL));
	_g_free0 (self->widget_blacklist);
	(self->widget_installed == NULL) ? NULL : (self->widget_installed = (_g_list_free__g_free0_ (self->widget_installed), NULL));
	(self->widget_available == NULL) ? NULL : (self->widget_available = (_g_list_free__g_free0_ (self->widget_available), NULL));
	_g_free0 (self->terminal_manager_blacklist);
	(self->terminal_manager_installed == NULL) ? NULL : (self->terminal_manager_installed = (_g_list_free__g_free0_ (self->terminal_manager_installed), NULL));
	(self->terminal_manager_available == NULL) ? NULL : (self->terminal_manager_available = (_g_list_free__g_free0_ (self->terminal_manager_available), NULL));
	_g_free0 (self->audio_blacklist);
	(self->audio_installed == NULL) ? NULL : (self->audio_installed = (_g_list_free__g_free0_ (self->audio_installed), NULL));
	(self->audio_available == NULL) ? NULL : (self->audio_available = (_g_list_free__g_free0_ (self->audio_available), NULL));
	_g_free0 (self->video_blacklist);
	(self->video_installed == NULL) ? NULL : (self->video_installed = (_g_list_free__g_free0_ (self->video_installed), NULL));
	(self->video_available == NULL) ? NULL : (self->video_available = (_g_list_free__g_free0_ (self->video_available), NULL));
	_g_free0 (self->audio_video_blacklist);
	_g_free0 (self->viewer_blacklist);
	(self->image_display_installed == NULL) ? NULL : (self->image_display_installed = (_g_list_free__g_free0_ (self->image_display_installed), NULL));
	(self->pdf_reader_installed == NULL) ? NULL : (self->pdf_reader_installed = (_g_list_free__g_free0_ (self->pdf_reader_installed), NULL));
	(self->image_display_available == NULL) ? NULL : (self->image_display_available = (_g_list_free__g_free0_ (self->image_display_available), NULL));
	(self->pdf_reader_available == NULL) ? NULL : (self->pdf_reader_available = (_g_list_free__g_free0_ (self->pdf_reader_available), NULL));
	_g_free0 (self->text_editor_blacklist);
	(self->text_editor_installed == NULL) ? NULL : (self->text_editor_installed = (_g_list_free__g_free0_ (self->text_editor_installed), NULL));
	(self->text_editor_available == NULL) ? NULL : (self->text_editor_available = (_g_list_free__g_free0_ (self->text_editor_available), NULL));
	_g_free0 (self->archive_blacklist);
	(self->archive_installed == NULL) ? NULL : (self->archive_installed = (_g_list_free__g_free0_ (self->archive_installed), NULL));
	(self->archive_available == NULL) ? NULL : (self->archive_available = (_g_list_free__g_free0_ (self->archive_available), NULL));
	_g_free0 (self->spreadsheet_blacklist);
	(self->spreadsheet_installed == NULL) ? NULL : (self->spreadsheet_installed = (_g_list_free__g_free0_ (self->spreadsheet_installed), NULL));
	(self->spreadsheet_available == NULL) ? NULL : (self->spreadsheet_available = (_g_list_free__g_free0_ (self->spreadsheet_available), NULL));
	_g_free0 (self->bittorent_blacklist);
	(self->bittorent_installed == NULL) ? NULL : (self->bittorent_installed = (_g_list_free__g_free0_ (self->bittorent_installed), NULL));
	(self->bittorent_available == NULL) ? NULL : (self->bittorent_available = (_g_list_free__g_free0_ (self->bittorent_available), NULL));
	_g_free0 (self->document_blacklist);
	(self->document_installed == NULL) ? NULL : (self->document_installed = (_g_list_free__g_free0_ (self->document_installed), NULL));
	(self->document_available == NULL) ? NULL : (self->document_available = (_g_list_free__g_free0_ (self->document_available), NULL));
	_g_free0 (self->burn_blacklist);
	(self->burn_installed == NULL) ? NULL : (self->burn_installed = (_g_list_free__g_free0_ (self->burn_installed), NULL));
	(self->burn_available == NULL) ? NULL : (self->burn_available = (_g_list_free__g_free0_ (self->burn_available), NULL));
	_g_free0 (self->tasks_blacklist);
	(self->tasks_installed == NULL) ? NULL : (self->tasks_installed = (_g_list_free__g_free0_ (self->tasks_installed), NULL));
	(self->tasks_available == NULL) ? NULL : (self->tasks_available = (_g_list_free__g_free0_ (self->tasks_available), NULL));
	self->priv->MimeFoldersInstalledGet = (_vala_array_free (self->priv->MimeFoldersInstalledGet, self->priv->MimeFoldersInstalledGet_length1, (GDestroyNotify) g_free), NULL);
	self->priv->MimeFoldersAvailableGet = (_vala_array_free (self->priv->MimeFoldersAvailableGet, self->priv->MimeFoldersAvailableGet_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (self->priv->mode);
	_g_key_file_unref0 (self->priv->kf);
	_g_free0 (self->priv->config_path);
	G_OBJECT_CLASS (lxsession_db_default_apps_parent_class)->finalize (obj);
}

static GType
lxsession_db_default_apps_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LxsessionDBDefaultAppsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lxsession_db_default_apps_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LxsessionDBDefaultApps), 0, (GInstanceInitFunc) lxsession_db_default_apps_instance_init, NULL };
	GType lxsession_db_default_apps_type_id;
	lxsession_db_default_apps_type_id = g_type_register_static (G_TYPE_OBJECT, "LxsessionDBDefaultApps", &g_define_type_info, 0);
	LxsessionDBDefaultApps_private_offset = g_type_add_instance_private (lxsession_db_default_apps_type_id, sizeof (LxsessionDBDefaultAppsPrivate));
	return lxsession_db_default_apps_type_id;
}

GType
lxsession_db_default_apps_get_type (void)
{
	static volatile gsize lxsession_db_default_apps_type_id__once = 0;
	if (g_once_init_enter (&lxsession_db_default_apps_type_id__once)) {
		GType lxsession_db_default_apps_type_id;
		lxsession_db_default_apps_type_id = lxsession_db_default_apps_get_type_once ();
		g_once_init_leave (&lxsession_db_default_apps_type_id__once, lxsession_db_default_apps_type_id);
	}
	return lxsession_db_default_apps_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;
}

