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

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2010-2011 Sébastien Wilmet
 *
 * LaTeXila 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.
 *
 * LaTeXila 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 LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtksourceview/gtksourceview.h>
#include <pango/pango.h>
#include <gee.h>


#define TYPE_FILE_BROWSER (file_browser_get_type ())
#define FILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILE_BROWSER, FileBrowser))
#define FILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILE_BROWSER, FileBrowserClass))
#define IS_FILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILE_BROWSER))
#define IS_FILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILE_BROWSER))
#define FILE_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILE_BROWSER, FileBrowserClass))

typedef struct _FileBrowser FileBrowser;
typedef struct _FileBrowserClass FileBrowserClass;
typedef struct _FileBrowserPrivate FileBrowserPrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define TYPE_BUILD_VIEW (build_view_get_type ())
#define BUILD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BUILD_VIEW, BuildView))
#define BUILD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BUILD_VIEW, BuildViewClass))
#define IS_BUILD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BUILD_VIEW))
#define IS_BUILD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BUILD_VIEW))
#define BUILD_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BUILD_VIEW, BuildViewClass))

typedef struct _BuildView BuildView;
typedef struct _BuildViewClass BuildViewClass;

#define FILE_BROWSER_TYPE_PARENT_DIR_COLUMN (file_browser_parent_dir_column_get_type ())

#define FILE_BROWSER_TYPE_FILE_COLUMN (file_browser_file_column_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block19Data Block19Data;

#define TYPE_DOCUMENT_TAB (document_tab_get_type ())
#define DOCUMENT_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_TAB, DocumentTab))
#define DOCUMENT_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT_TAB, DocumentTabClass))
#define IS_DOCUMENT_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT_TAB))
#define IS_DOCUMENT_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT_TAB))
#define DOCUMENT_TAB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT_TAB, DocumentTabClass))

typedef struct _DocumentTab DocumentTab;
typedef struct _DocumentTabClass DocumentTabClass;

#define TYPE_DOCUMENT (document_get_type ())
#define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
#define DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT, DocumentClass))
#define IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT))
#define IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT))
#define DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT, DocumentClass))

typedef struct _Document Document;
typedef struct _DocumentClass DocumentClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_BUILD_TOOLS (build_tools_get_type ())
#define BUILD_TOOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BUILD_TOOLS, BuildTools))
#define BUILD_TOOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BUILD_TOOLS, BuildToolsClass))
#define IS_BUILD_TOOLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BUILD_TOOLS))
#define IS_BUILD_TOOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BUILD_TOOLS))
#define BUILD_TOOLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BUILD_TOOLS, BuildToolsClass))

typedef struct _BuildTools BuildTools;
typedef struct _BuildToolsClass BuildToolsClass;

#define TYPE_DOC_TYPE (doc_type_get_type ())
#define _build_tools_unref0(var) ((var == NULL) ? NULL : (var = (build_tools_unref (var), NULL)))

#define TYPE_BUILD_TOOL (build_tool_get_type ())

#define TYPE_BUILD_JOB (build_job_get_type ())

#define TYPE_POST_PROCESSOR_TYPE (post_processor_type_get_type ())
typedef struct _BuildJob BuildJob;
typedef struct _BuildTool BuildTool;
#define _build_tool_free0(var) ((var == NULL) ? NULL : (var = (build_tool_free (var), NULL)))

#define TYPE_BUILD_TOOL_RUNNER (build_tool_runner_get_type ())
#define BUILD_TOOL_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BUILD_TOOL_RUNNER, BuildToolRunner))
#define BUILD_TOOL_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BUILD_TOOL_RUNNER, BuildToolRunnerClass))
#define IS_BUILD_TOOL_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BUILD_TOOL_RUNNER))
#define IS_BUILD_TOOL_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BUILD_TOOL_RUNNER))
#define BUILD_TOOL_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BUILD_TOOL_RUNNER, BuildToolRunnerClass))

typedef struct _BuildToolRunner BuildToolRunner;
typedef struct _BuildToolRunnerClass BuildToolRunnerClass;

#define TYPE_PROJECT (project_get_type ())
typedef struct _Project Project;
#define _project_free0(var) ((var == NULL) ? NULL : (var = (project_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

struct _FileBrowser {
	GtkVBox parent_instance;
	FileBrowserPrivate * priv;
};

struct _FileBrowserClass {
	GtkVBoxClass parent_class;
};

struct _FileBrowserPrivate {
	MainWindow* main_window;
	BuildView* build_view;
	GtkListStore* parent_dir_store;
	GtkListStore* list_store;
	GtkTreeView* _list_view;
	GtkComboBox* combo_box;
	GFile* current_directory;
	GtkButton* parent_button;
	GSettings* settings;
	GSettings* latex_settings;
	guint timeout_id;
};

typedef enum  {
	FILE_BROWSER_PARENT_DIR_COLUMN_INDENT,
	FILE_BROWSER_PARENT_DIR_COLUMN_PIXBUF,
	FILE_BROWSER_PARENT_DIR_COLUMN_NAME,
	FILE_BROWSER_PARENT_DIR_COLUMN_FILE,
	FILE_BROWSER_PARENT_DIR_COLUMN_N_COLUMNS
} FileBrowserParentDirColumn;

typedef enum  {
	FILE_BROWSER_FILE_COLUMN_PIXBUF,
	FILE_BROWSER_FILE_COLUMN_NAME,
	FILE_BROWSER_FILE_COLUMN_IS_DIR,
	FILE_BROWSER_FILE_COLUMN_N_COLUMNS
} FileBrowserFileColumn;

struct _Block19Data {
	int _ref_count_;
	FileBrowser * self;
	GtkButton* jump_button;
};

typedef enum  {
	DOC_TYPE_DVI,
	DOC_TYPE_PDF,
	DOC_TYPE_PS,
	DOC_TYPE_LAST
} DocType;

typedef enum  {
	POST_PROCESSOR_TYPE_ALL_OUTPUT = 0,
	POST_PROCESSOR_TYPE_LATEX,
	POST_PROCESSOR_TYPE_LATEXMK,
	POST_PROCESSOR_TYPE_NO_OUTPUT,
	POST_PROCESSOR_TYPE_RUBBER,
	POST_PROCESSOR_TYPE_N_POST_PROCESSORS
} PostProcessorType;

struct _BuildJob {
	gboolean must_succeed;
	PostProcessorType post_processor;
	gchar* command;
};

struct _BuildTool {
	gchar* description;
	gchar* extensions;
	gchar* label;
	gchar* icon;
	gboolean show;
	gboolean compilation;
	GeeArrayList* jobs;
};

struct _Project {
	GFile* directory;
	GFile* main_file;
};


static gpointer file_browser_parent_class = NULL;

GType file_browser_get_type (void) G_GNUC_CONST;
GType main_window_get_type (void) G_GNUC_CONST;
GType build_view_get_type (void) G_GNUC_CONST;
#define FILE_BROWSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_FILE_BROWSER, FileBrowserPrivate))
enum  {
	FILE_BROWSER_DUMMY_PROPERTY
};
static GType file_browser_parent_dir_column_get_type (void) G_GNUC_UNUSED;
static GType file_browser_file_column_get_type (void) G_GNUC_UNUSED;
FileBrowser* file_browser_new (MainWindow* main_window);
FileBrowser* file_browser_construct (GType object_type, MainWindow* main_window);
BuildView* main_window_get_build_view (MainWindow* self);
static void file_browser_init_toolbar (FileBrowser* self);
static void file_browser_init_combo_box (FileBrowser* self);
static void file_browser_init_list (FileBrowser* self);
static void file_browser_init_settings (FileBrowser* self);
static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir);
void file_browser_refresh (FileBrowser* self);
static void _file_browser_refresh_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static void file_browser_on_refresh (FileBrowser* self);
static void _file_browser_on_refresh_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static gboolean __lambda48_ (FileBrowser* self);
static gboolean ___lambda48__gsource_func (gpointer self);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
GtkButton* utils_get_toolbar_button (const gchar* stock_id);
static void __lambda41_ (FileBrowser* self);
static void ___lambda41__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda42_ (FileBrowser* self);
static void ___lambda42__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda43_ (FileBrowser* self);
GType document_tab_get_type (void) G_GNUC_CONST;
DocumentTab* main_window_get_active_tab (MainWindow* self);
GType document_get_type (void) G_GNUC_CONST;
Document* main_window_get_active_document (MainWindow* self);
GFile* document_get_location (Document* self);
static void ___lambda43__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda44_ (Block19Data* _data19_);
static void file_browser_update_jump_button_sensitivity (FileBrowser* self, GtkButton* jump_button);
static void ___lambda45_ (Block19Data* _data19_);
static void ____lambda45__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void ___lambda44__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _file_browser_refresh_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda46_ (FileBrowser* self);
static void ___lambda46__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static gint file_browser_on_sort (FileBrowser* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b);
static gint _file_browser_on_sort_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self);
GtkWidget* utils_add_scrollbar (GtkWidget* child);
static void __lambda47_ (FileBrowser* self, GtkTreePath* path);
gpointer build_tools_ref (gpointer instance);
void build_tools_unref (gpointer instance);
GParamSpec* param_spec_build_tools (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_build_tools (GValue* value, gpointer v_object);
void value_take_build_tools (GValue* value, gpointer v_object);
gpointer value_get_build_tools (const GValue* value);
GType build_tools_get_type (void) G_GNUC_CONST;
BuildTools* build_tools_get_default (void);
gchar* utils_get_extension (const gchar* path);
GType doc_type_get_type (void) G_GNUC_CONST;
DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to);
GType build_tool_get_type (void) G_GNUC_CONST;
GType build_job_get_type (void) G_GNUC_CONST;
GType post_processor_type_get_type (void) G_GNUC_CONST;
BuildJob* build_job_dup (const BuildJob* self);
void build_job_free (BuildJob* self);
void build_job_copy (const BuildJob* self, BuildJob* dest);
void build_job_destroy (BuildJob* self);
BuildTool* build_tool_dup (const BuildTool* self);
void build_tool_free (BuildTool* self);
void build_tool_copy (const BuildTool* self, BuildTool* dest);
void build_tool_destroy (BuildTool* self);
BuildTool* build_tools_get_view_doc (BuildTools* self, DocType type);
GtkAction* main_window_get_action_stop_exec (MainWindow* self);
BuildToolRunner* build_tool_runner_new (GFile* file, BuildTool* tool, BuildView* view, GtkAction* action_stop_exec);
BuildToolRunner* build_tool_runner_construct (GType object_type, GFile* file, BuildTool* tool, BuildView* view, GtkAction* action_stop_exec);
GType build_tool_runner_get_type (void) G_GNUC_CONST;
static void ___lambda47__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
void file_browser_refresh_for_document (FileBrowser* self, Document* doc);
GType project_get_type (void) G_GNUC_CONST;
Project* project_dup (const Project* self);
void project_free (Project* self);
void project_copy (const Project* self, Project* dest);
void project_destroy (Project* self);
Project* document_get_project (Document* self);
static void file_browser_insert_file (FileBrowser* self, gboolean is_dir, const gchar* pixbuf, const gchar* basename);
static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
static void file_browser_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static GType file_browser_parent_dir_column_get_type (void) {
	static volatile gsize file_browser_parent_dir_column_type_id__volatile = 0;
	if (g_once_init_enter (&file_browser_parent_dir_column_type_id__volatile)) {
		static const GEnumValue values[] = {{FILE_BROWSER_PARENT_DIR_COLUMN_INDENT, "FILE_BROWSER_PARENT_DIR_COLUMN_INDENT", "indent"}, {FILE_BROWSER_PARENT_DIR_COLUMN_PIXBUF, "FILE_BROWSER_PARENT_DIR_COLUMN_PIXBUF", "pixbuf"}, {FILE_BROWSER_PARENT_DIR_COLUMN_NAME, "FILE_BROWSER_PARENT_DIR_COLUMN_NAME", "name"}, {FILE_BROWSER_PARENT_DIR_COLUMN_FILE, "FILE_BROWSER_PARENT_DIR_COLUMN_FILE", "file"}, {FILE_BROWSER_PARENT_DIR_COLUMN_N_COLUMNS, "FILE_BROWSER_PARENT_DIR_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType file_browser_parent_dir_column_type_id;
		file_browser_parent_dir_column_type_id = g_enum_register_static ("FileBrowserParentDirColumn", values);
		g_once_init_leave (&file_browser_parent_dir_column_type_id__volatile, file_browser_parent_dir_column_type_id);
	}
	return file_browser_parent_dir_column_type_id__volatile;
}


static GType file_browser_file_column_get_type (void) {
	static volatile gsize file_browser_file_column_type_id__volatile = 0;
	if (g_once_init_enter (&file_browser_file_column_type_id__volatile)) {
		static const GEnumValue values[] = {{FILE_BROWSER_FILE_COLUMN_PIXBUF, "FILE_BROWSER_FILE_COLUMN_PIXBUF", "pixbuf"}, {FILE_BROWSER_FILE_COLUMN_NAME, "FILE_BROWSER_FILE_COLUMN_NAME", "name"}, {FILE_BROWSER_FILE_COLUMN_IS_DIR, "FILE_BROWSER_FILE_COLUMN_IS_DIR", "is-dir"}, {FILE_BROWSER_FILE_COLUMN_N_COLUMNS, "FILE_BROWSER_FILE_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType file_browser_file_column_type_id;
		file_browser_file_column_type_id = g_enum_register_static ("FileBrowserFileColumn", values);
		g_once_init_leave (&file_browser_file_column_type_id__volatile, file_browser_file_column_type_id);
	}
	return file_browser_file_column_type_id__volatile;
}


FileBrowser* file_browser_construct (GType object_type, MainWindow* main_window) {
	FileBrowser * self = NULL;
	MainWindow* _tmp0_;
	MainWindow* _tmp1_;
	BuildView* _tmp2_ = NULL;
	g_return_val_if_fail (main_window != NULL, NULL);
	self = (FileBrowser*) g_object_new (object_type, "spacing", 3, NULL);
	_tmp0_ = main_window;
	self->priv->main_window = _tmp0_;
	_tmp1_ = main_window;
	_tmp2_ = main_window_get_build_view (_tmp1_);
	_g_object_unref0 (self->priv->build_view);
	self->priv->build_view = _tmp2_;
	file_browser_init_toolbar (self);
	file_browser_init_combo_box (self);
	file_browser_init_list (self);
	file_browser_init_settings (self);
	gtk_widget_show_all ((GtkWidget*) self);
	file_browser_fill_stores_with_dir (self, NULL);
	return self;
}


FileBrowser* file_browser_new (MainWindow* main_window) {
	return file_browser_construct (TYPE_FILE_BROWSER, main_window);
}


static void _file_browser_refresh_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	file_browser_refresh (self);
}


static void _file_browser_on_refresh_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	file_browser_on_refresh (self);
}


static void file_browser_init_settings (FileBrowser* self) {
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.file-browser");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	_tmp1_ = self->priv->settings;
	g_signal_connect_object (_tmp1_, "changed::show-all-files", (GCallback) _file_browser_refresh_g_settings_changed, self, 0);
	_tmp2_ = self->priv->settings;
	g_signal_connect_object (_tmp2_, "changed::show-all-files-except", (GCallback) _file_browser_refresh_g_settings_changed, self, 0);
	_tmp3_ = self->priv->settings;
	g_signal_connect_object (_tmp3_, "changed::show-hidden-files", (GCallback) _file_browser_refresh_g_settings_changed, self, 0);
	_tmp4_ = self->priv->settings;
	g_signal_connect_object (_tmp4_, "changed::file-extensions", (GCallback) _file_browser_on_refresh_g_settings_changed, self, 0);
	_tmp5_ = g_settings_new ("org.gnome.latexila.preferences.latex");
	_g_object_unref0 (self->priv->latex_settings);
	self->priv->latex_settings = _tmp5_;
	_tmp6_ = self->priv->latex_settings;
	g_signal_connect_object (_tmp6_, "changed::clean-extensions", (GCallback) _file_browser_on_refresh_g_settings_changed, self, 0);
}


static gboolean __lambda48_ (FileBrowser* self) {
	gboolean result = FALSE;
	self->priv->timeout_id = (guint) 0;
	file_browser_refresh (self);
	result = FALSE;
	return result;
}


static gboolean ___lambda48__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda48_ (self);
	return result;
}


static void file_browser_on_refresh (FileBrowser* self) {
	guint _tmp0_;
	guint _tmp2_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->timeout_id;
	if (_tmp0_ != ((guint) 0)) {
		guint _tmp1_;
		_tmp1_ = self->priv->timeout_id;
		g_source_remove (_tmp1_);
	}
	_tmp2_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 2, ___lambda48__gsource_func, g_object_ref (self), g_object_unref);
	self->priv->timeout_id = _tmp2_;
}


static Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		FileBrowser * self;
		self = _data19_->self;
		_g_object_unref0 (_data19_->jump_button);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}


static void __lambda41_ (FileBrowser* self) {
	const gchar* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* home_dir;
	_tmp0_ = g_get_home_dir ();
	_tmp1_ = g_file_new_for_path (_tmp0_);
	home_dir = _tmp1_;
	file_browser_fill_stores_with_dir (self, home_dir);
	_g_object_unref0 (home_dir);
}


static void ___lambda41__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda41_ (self);
}


static void __lambda42_ (FileBrowser* self) {
	GFile* _tmp0_;
	GFile* _tmp1_ = NULL;
	GFile* parent;
	_tmp0_ = self->priv->current_directory;
	_tmp1_ = g_file_get_parent (_tmp0_);
	parent = _tmp1_;
	g_return_if_fail (parent != NULL);
	file_browser_fill_stores_with_dir (self, parent);
	_g_object_unref0 (parent);
}


static void ___lambda42__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda42_ (self);
}


static void __lambda43_ (FileBrowser* self) {
	gboolean _tmp0_ = FALSE;
	MainWindow* _tmp1_;
	DocumentTab* _tmp2_;
	DocumentTab* _tmp3_;
	gboolean _tmp9_;
	MainWindow* _tmp10_;
	Document* _tmp11_;
	Document* _tmp12_;
	GFile* _tmp13_;
	GFile* _tmp14_;
	GFile* _tmp15_ = NULL;
	GFile* _tmp16_;
	_tmp1_ = self->priv->main_window;
	_tmp2_ = main_window_get_active_tab (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		MainWindow* _tmp4_;
		Document* _tmp5_;
		Document* _tmp6_;
		GFile* _tmp7_;
		GFile* _tmp8_;
		_tmp4_ = self->priv->main_window;
		_tmp5_ = main_window_get_active_document (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = document_get_location (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ == NULL;
	}
	_tmp9_ = _tmp0_;
	if (_tmp9_) {
		return;
	}
	_tmp10_ = self->priv->main_window;
	_tmp11_ = main_window_get_active_document (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = document_get_location (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_file_get_parent (_tmp14_);
	_tmp16_ = _tmp15_;
	file_browser_fill_stores_with_dir (self, _tmp16_);
	_g_object_unref0 (_tmp16_);
}


static void ___lambda43__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda43_ (self);
}


static void ___lambda45_ (Block19Data* _data19_) {
	FileBrowser * self;
	self = _data19_->self;
	file_browser_update_jump_button_sensitivity (self, _data19_->jump_button);
}


static void ____lambda45__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	___lambda45_ (self);
}


static void __lambda44_ (Block19Data* _data19_) {
	FileBrowser * self;
	MainWindow* _tmp0_;
	Document* _tmp1_;
	Document* _tmp2_;
	self = _data19_->self;
	file_browser_update_jump_button_sensitivity (self, _data19_->jump_button);
	_tmp0_ = self->priv->main_window;
	_tmp1_ = main_window_get_active_document (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		MainWindow* _tmp3_;
		Document* _tmp4_;
		Document* _tmp5_;
		_tmp3_ = self->priv->main_window;
		_tmp4_ = main_window_get_active_document (_tmp3_);
		_tmp5_ = _tmp4_;
		g_signal_connect_data ((GObject*) _tmp5_, "notify::location", (GCallback) ____lambda45__g_object_notify, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
	}
}


static void ___lambda44__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda44_ (self);
}


static void _file_browser_refresh_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	file_browser_refresh (self);
}


static void file_browser_init_toolbar (FileBrowser* self) {
	Block19Data* _data19_;
	GtkHBox* _tmp0_;
	GtkHBox* _tmp1_;
	GtkHBox* hbox;
	GtkButton* _tmp2_ = NULL;
	GtkButton* home_button;
	GtkButton* _tmp3_ = NULL;
	GtkButton* _tmp4_ = NULL;
	GtkButton* _tmp5_ = NULL;
	GtkButton* refresh_button;
	const gchar* _tmp6_ = NULL;
	GtkButton* _tmp7_;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	MainWindow* _tmp13_;
	g_return_if_fail (self != NULL);
	_data19_ = g_slice_new0 (Block19Data);
	_data19_->_ref_count_ = 1;
	_data19_->self = g_object_ref (self);
	_tmp0_ = (GtkHBox*) gtk_hbox_new (TRUE, 0);
	_tmp1_ = g_object_ref_sink (_tmp0_);
	hbox = _tmp1_;
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) hbox, FALSE, FALSE, (guint) 0);
	_tmp2_ = utils_get_toolbar_button (GTK_STOCK_HOME);
	home_button = _tmp2_;
	_tmp3_ = utils_get_toolbar_button (GTK_STOCK_GO_UP);
	_g_object_unref0 (self->priv->parent_button);
	self->priv->parent_button = _tmp3_;
	_tmp4_ = utils_get_toolbar_button (GTK_STOCK_JUMP_TO);
	_data19_->jump_button = _tmp4_;
	_tmp5_ = utils_get_toolbar_button (GTK_STOCK_REFRESH);
	refresh_button = _tmp5_;
	_tmp6_ = _ ("Go to the home directory");
	gtk_widget_set_tooltip_text ((GtkWidget*) home_button, _tmp6_);
	_tmp7_ = self->priv->parent_button;
	_tmp8_ = _ ("Go to the parent directory");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _tmp8_);
	_tmp9_ = _ ("Go to the active document directory");
	gtk_widget_set_tooltip_text ((GtkWidget*) _data19_->jump_button, _tmp9_);
	_tmp10_ = _ ("Refresh");
	gtk_widget_set_tooltip_text ((GtkWidget*) refresh_button, _tmp10_);
	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) home_button, TRUE, TRUE, (guint) 0);
	_tmp11_ = self->priv->parent_button;
	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) _tmp11_, TRUE, TRUE, (guint) 0);
	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) _data19_->jump_button, TRUE, TRUE, (guint) 0);
	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) refresh_button, TRUE, TRUE, (guint) 0);
	g_signal_connect_object (home_button, "clicked", (GCallback) ___lambda41__gtk_button_clicked, self, 0);
	_tmp12_ = self->priv->parent_button;
	g_signal_connect_object (_tmp12_, "clicked", (GCallback) ___lambda42__gtk_button_clicked, self, 0);
	g_signal_connect_object (_data19_->jump_button, "clicked", (GCallback) ___lambda43__gtk_button_clicked, self, 0);
	_tmp13_ = self->priv->main_window;
	g_signal_connect_data ((GObject*) _tmp13_, "notify::active-document", (GCallback) ___lambda44__g_object_notify, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
	g_signal_connect_object (refresh_button, "clicked", (GCallback) _file_browser_refresh_gtk_button_clicked, self, 0);
	_g_object_unref0 (refresh_button);
	_g_object_unref0 (home_button);
	_g_object_unref0 (hbox);
	block19_data_unref (_data19_);
	_data19_ = NULL;
}


static void file_browser_update_jump_button_sensitivity (FileBrowser* self, GtkButton* jump_button) {
	gboolean _tmp0_ = FALSE;
	MainWindow* _tmp1_;
	DocumentTab* _tmp2_;
	DocumentTab* _tmp3_;
	GtkButton* _tmp9_;
	gboolean _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jump_button != NULL);
	_tmp1_ = self->priv->main_window;
	_tmp2_ = main_window_get_active_tab (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		MainWindow* _tmp4_;
		Document* _tmp5_;
		Document* _tmp6_;
		GFile* _tmp7_;
		GFile* _tmp8_;
		_tmp4_ = self->priv->main_window;
		_tmp5_ = main_window_get_active_document (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = document_get_location (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp9_ = jump_button;
	_tmp10_ = _tmp0_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, _tmp10_);
}


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


static void __lambda46_ (FileBrowser* self) {
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	_tmp0_ = self->priv->combo_box;
	_tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	if (_tmp2_) {
		GtkComboBox* _tmp3_;
		GtkTreeModel* _tmp4_ = NULL;
		GtkTreeModel* _tmp5_;
		GtkTreeModel* model;
		GFile* file = NULL;
		GtkTreeModel* _tmp6_;
		GtkTreeIter _tmp7_;
		GFile* _tmp8_;
		GFile* _tmp9_;
		gboolean _tmp10_ = FALSE;
		_tmp3_ = self->priv->combo_box;
		_tmp4_ = gtk_combo_box_get_model (_tmp3_);
		_tmp5_ = _g_object_ref0 (_tmp4_);
		model = _tmp5_;
		_tmp6_ = model;
		_tmp7_ = iter;
		gtk_tree_model_get (_tmp6_, &_tmp7_, FILE_BROWSER_PARENT_DIR_COLUMN_FILE, &file, -1, -1);
		_tmp8_ = file;
		_tmp9_ = self->priv->current_directory;
		_tmp10_ = g_file_equal (_tmp8_, _tmp9_);
		if (!_tmp10_) {
			GFile* _tmp11_;
			_tmp11_ = file;
			file_browser_fill_stores_with_dir (self, _tmp11_);
		}
		_g_object_unref0 (file);
		_g_object_unref0 (model);
	}
}


static void ___lambda46__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	__lambda46_ (self);
}


static void file_browser_init_combo_box (FileBrowser* self) {
	GtkListStore* _tmp0_;
	GtkListStore* _tmp1_;
	GtkComboBox* _tmp2_;
	GtkComboBox* _tmp3_;
	GtkComboBox* _tmp4_;
	GtkCellRendererText* _tmp5_;
	GtkCellRendererText* _tmp6_;
	GtkCellRendererText* text_renderer;
	GtkComboBox* _tmp7_;
	GtkCellRendererText* _tmp8_;
	GtkComboBox* _tmp9_;
	GtkCellRendererText* _tmp10_;
	GtkCellRendererPixbuf* _tmp11_;
	GtkCellRendererPixbuf* _tmp12_;
	GtkCellRendererPixbuf* pixbuf_renderer;
	GtkComboBox* _tmp13_;
	GtkComboBox* _tmp14_;
	GtkCellRendererText* _tmp15_;
	GtkCellRendererText* _tmp16_;
	GtkComboBox* _tmp17_;
	GtkCellRendererText* _tmp18_;
	GtkComboBox* _tmp19_;
	GtkCellRendererText* _tmp20_;
	GtkCellRendererText* _tmp21_;
	GtkCellRendererText* _tmp22_;
	GtkComboBox* _tmp23_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_list_store_new ((gint) FILE_BROWSER_PARENT_DIR_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_FILE);
	_g_object_unref0 (self->priv->parent_dir_store);
	self->priv->parent_dir_store = _tmp0_;
	_tmp1_ = self->priv->parent_dir_store;
	_tmp2_ = (GtkComboBox*) gtk_combo_box_new_with_model ((GtkTreeModel*) _tmp1_);
	_tmp3_ = g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->combo_box);
	self->priv->combo_box = _tmp3_;
	_tmp4_ = self->priv->combo_box;
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp4_, FALSE, FALSE, (guint) 0);
	_tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_tmp6_ = g_object_ref_sink (_tmp5_);
	text_renderer = _tmp6_;
	_tmp7_ = self->priv->combo_box;
	_tmp8_ = text_renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp7_, (GtkCellRenderer*) _tmp8_, FALSE);
	_tmp9_ = self->priv->combo_box;
	_tmp10_ = text_renderer;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp9_, (GtkCellRenderer*) _tmp10_, "text", FILE_BROWSER_PARENT_DIR_COLUMN_INDENT, NULL, NULL);
	_tmp11_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	_tmp12_ = g_object_ref_sink (_tmp11_);
	pixbuf_renderer = _tmp12_;
	_tmp13_ = self->priv->combo_box;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp13_, (GtkCellRenderer*) pixbuf_renderer, FALSE);
	_tmp14_ = self->priv->combo_box;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp14_, (GtkCellRenderer*) pixbuf_renderer, "stock-id", FILE_BROWSER_PARENT_DIR_COLUMN_PIXBUF, NULL, NULL);
	_tmp15_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_tmp16_ = g_object_ref_sink (_tmp15_);
	_g_object_unref0 (text_renderer);
	text_renderer = _tmp16_;
	_tmp17_ = self->priv->combo_box;
	_tmp18_ = text_renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp17_, (GtkCellRenderer*) _tmp18_, TRUE);
	_tmp19_ = self->priv->combo_box;
	_tmp20_ = text_renderer;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp19_, (GtkCellRenderer*) _tmp20_, "text", FILE_BROWSER_PARENT_DIR_COLUMN_NAME, NULL, NULL);
	_tmp21_ = text_renderer;
	g_object_set (_tmp21_, "ellipsize-set", TRUE, NULL);
	_tmp22_ = text_renderer;
	g_object_set (_tmp22_, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
	_tmp23_ = self->priv->combo_box;
	g_signal_connect_object (_tmp23_, "changed", (GCallback) ___lambda46__gtk_combo_box_changed, self, 0);
	_g_object_unref0 (pixbuf_renderer);
	_g_object_unref0 (text_renderer);
}


static gint _file_browser_on_sort_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self) {
	gint result;
	result = file_browser_on_sort (self, model, a, b);
	return result;
}


static void __lambda47_ (FileBrowser* self, GtkTreePath* path) {
	GtkListStore* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeModel* model;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp2_;
	GtkTreePath* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_ = FALSE;
	gchar* basename = NULL;
	gboolean is_dir = FALSE;
	GtkTreeModel* _tmp6_;
	GtkTreeIter _tmp7_;
	GFile* _tmp8_;
	const gchar* _tmp9_;
	GFile* _tmp10_ = NULL;
	GFile* file;
	gboolean _tmp11_;
	BuildTools* _tmp13_ = NULL;
	BuildTools* build_tools;
	const gchar* _tmp14_;
	gchar* _tmp15_ = NULL;
	gchar* extension;
	DocType doc_type = 0;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	GQuark _tmp19_ = 0U;
	static GQuark _tmp18_label0 = 0;
	static GQuark _tmp18_label1 = 0;
	static GQuark _tmp18_label2 = 0;
	BuildTools* _tmp24_;
	DocType _tmp25_;
	BuildTool* _tmp26_ = NULL;
	BuildTool* tool;
	BuildTool* _tmp27_;
	GFile* _tmp29_;
	BuildTool* _tmp30_;
	BuildView* _tmp31_;
	MainWindow* _tmp32_;
	GtkAction* _tmp33_ = NULL;
	GtkAction* _tmp34_;
	BuildTool _tmp35_;
	BuildToolRunner* _tmp36_;
	BuildToolRunner* _tmp37_;
	g_return_if_fail (path != NULL);
	_tmp0_ = self->priv->list_store;
	_tmp1_ = _g_object_ref0 (GTK_TREE_MODEL (_tmp0_));
	model = _tmp1_;
	_tmp2_ = model;
	_tmp3_ = path;
	_tmp5_ = gtk_tree_model_get_iter (_tmp2_, &_tmp4_, _tmp3_);
	iter = _tmp4_;
	if (!_tmp5_) {
		_g_object_unref0 (model);
		return;
	}
	_tmp6_ = model;
	_tmp7_ = iter;
	gtk_tree_model_get (_tmp6_, &_tmp7_, FILE_BROWSER_FILE_COLUMN_NAME, &basename, FILE_BROWSER_FILE_COLUMN_IS_DIR, &is_dir, -1, -1);
	_tmp8_ = self->priv->current_directory;
	_tmp9_ = basename;
	_tmp10_ = g_file_get_child (_tmp8_, _tmp9_);
	file = _tmp10_;
	_tmp11_ = is_dir;
	if (_tmp11_) {
		GFile* _tmp12_;
		_tmp12_ = file;
		file_browser_fill_stores_with_dir (self, _tmp12_);
		_g_object_unref0 (file);
		_g_free0 (basename);
		_g_object_unref0 (model);
		return;
	}
	_tmp13_ = build_tools_get_default ();
	build_tools = _tmp13_;
	_tmp14_ = basename;
	_tmp15_ = utils_get_extension (_tmp14_);
	extension = _tmp15_;
	_tmp16_ = extension;
	_tmp17_ = _tmp16_;
	_tmp19_ = (NULL == _tmp17_) ? 0 : g_quark_from_string (_tmp17_);
	if (_tmp19_ == ((0 != _tmp18_label0) ? _tmp18_label0 : (_tmp18_label0 = g_quark_from_static_string (".dvi")))) {
		switch (0) {
			default:
			{
				doc_type = DOC_TYPE_DVI;
				break;
			}
		}
	} else if (_tmp19_ == ((0 != _tmp18_label1) ? _tmp18_label1 : (_tmp18_label1 = g_quark_from_static_string (".pdf")))) {
		switch (0) {
			default:
			{
				doc_type = DOC_TYPE_PDF;
				break;
			}
		}
	} else if (_tmp19_ == ((0 != _tmp18_label2) ? _tmp18_label2 : (_tmp18_label2 = g_quark_from_static_string (".ps")))) {
		switch (0) {
			default:
			{
				doc_type = DOC_TYPE_PS;
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				MainWindow* _tmp20_;
				GFile* _tmp21_;
				DocumentTab* _tmp22_ = NULL;
				DocumentTab* _tmp23_;
				_tmp20_ = self->priv->main_window;
				_tmp21_ = file;
				_tmp22_ = main_window_open_document (_tmp20_, _tmp21_, TRUE);
				_tmp23_ = _tmp22_;
				_g_object_unref0 (_tmp23_);
				_g_free0 (extension);
				_build_tools_unref0 (build_tools);
				_g_object_unref0 (file);
				_g_free0 (basename);
				_g_object_unref0 (model);
				return;
			}
		}
	}
	_tmp24_ = build_tools;
	_tmp25_ = doc_type;
	_tmp26_ = build_tools_get_view_doc (_tmp24_, _tmp25_);
	tool = _tmp26_;
	_tmp27_ = tool;
	if (_tmp27_ == NULL) {
		const gchar* _tmp28_;
		_tmp28_ = basename;
		g_warning ("file_browser.vala:290: There is no build tool to view the file '%s'", _tmp28_);
		_build_tool_free0 (tool);
		_g_free0 (extension);
		_build_tools_unref0 (build_tools);
		_g_object_unref0 (file);
		_g_free0 (basename);
		_g_object_unref0 (model);
		return;
	}
	_tmp29_ = file;
	_tmp30_ = tool;
	_tmp31_ = self->priv->build_view;
	_tmp32_ = self->priv->main_window;
	_tmp33_ = main_window_get_action_stop_exec (_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = *_tmp30_;
	_tmp36_ = build_tool_runner_new (_tmp29_, &_tmp35_, _tmp31_, _tmp34_);
	_tmp37_ = _tmp36_;
	_g_object_unref0 (_tmp37_);
	_g_object_unref0 (_tmp34_);
	_build_tool_free0 (tool);
	_g_free0 (extension);
	_build_tools_unref0 (build_tools);
	_g_object_unref0 (file);
	_g_free0 (basename);
	_g_object_unref0 (model);
}


static void ___lambda47__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
	__lambda47_ (self, path);
}


static void file_browser_init_list (FileBrowser* self) {
	GtkListStore* _tmp0_;
	GtkListStore* _tmp1_;
	GtkListStore* _tmp2_;
	GtkListStore* _tmp3_;
	GtkTreeView* _tmp4_;
	GtkTreeView* _tmp5_;
	GtkTreeView* _tmp6_;
	GtkTreeViewColumn* _tmp7_;
	GtkTreeViewColumn* _tmp8_;
	GtkTreeViewColumn* column;
	GtkTreeView* _tmp9_;
	GtkCellRendererPixbuf* _tmp10_;
	GtkCellRendererPixbuf* _tmp11_;
	GtkCellRendererPixbuf* pixbuf_renderer;
	GtkCellRendererText* _tmp12_;
	GtkCellRendererText* _tmp13_;
	GtkCellRendererText* text_renderer;
	GtkTreeView* _tmp14_;
	GtkWidget* _tmp15_ = NULL;
	GtkWidget* sw;
	GtkTreeView* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_list_store_new ((gint) FILE_BROWSER_FILE_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
	_g_object_unref0 (self->priv->list_store);
	self->priv->list_store = _tmp0_;
	_tmp1_ = self->priv->list_store;
	gtk_tree_sortable_set_sort_func ((GtkTreeSortable*) _tmp1_, 0, _file_browser_on_sort_gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
	_tmp2_ = self->priv->list_store;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp2_, 0, GTK_SORT_ASCENDING);
	_tmp3_ = self->priv->list_store;
	_tmp4_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp3_);
	_tmp5_ = g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->_list_view);
	self->priv->_list_view = _tmp5_;
	_tmp6_ = self->priv->_list_view;
	gtk_tree_view_set_headers_visible (_tmp6_, FALSE);
	_tmp7_ = gtk_tree_view_column_new ();
	_tmp8_ = g_object_ref_sink (_tmp7_);
	column = _tmp8_;
	_tmp9_ = self->priv->_list_view;
	gtk_tree_view_append_column (_tmp9_, column);
	_tmp10_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	_tmp11_ = g_object_ref_sink (_tmp10_);
	pixbuf_renderer = _tmp11_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) pixbuf_renderer, "stock-id", FILE_BROWSER_FILE_COLUMN_PIXBUF, NULL, NULL);
	_tmp12_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	_tmp13_ = g_object_ref_sink (_tmp12_);
	text_renderer = _tmp13_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text_renderer, TRUE);
	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) text_renderer, "text", FILE_BROWSER_FILE_COLUMN_NAME, NULL, NULL);
	_tmp14_ = self->priv->_list_view;
	_tmp15_ = utils_add_scrollbar ((GtkWidget*) _tmp14_);
	sw = _tmp15_;
	gtk_box_pack_start ((GtkBox*) self, sw, TRUE, TRUE, (guint) 0);
	_tmp16_ = self->priv->_list_view;
	g_signal_connect_object (_tmp16_, "row-activated", (GCallback) ___lambda47__gtk_tree_view_row_activated, self, 0);
	_g_object_unref0 (sw);
	_g_object_unref0 (text_renderer);
	_g_object_unref0 (pixbuf_renderer);
	_g_object_unref0 (column);
}


void file_browser_refresh (FileBrowser* self) {
	GFile* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_directory;
	file_browser_fill_stores_with_dir (self, _tmp0_);
}


void file_browser_refresh_for_document (FileBrowser* self, Document* doc) {
	Document* _tmp0_;
	Project* _tmp1_ = NULL;
	Project* project;
	Project* _tmp2_;
	Project* _tmp15_;
	GFile* _tmp16_;
	GFile* _tmp17_;
	GFile* project_dir;
	gboolean _tmp18_ = FALSE;
	GFile* _tmp19_;
	GFile* _tmp20_;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (doc != NULL);
	_tmp0_ = doc;
	_tmp1_ = document_get_project (_tmp0_);
	project = _tmp1_;
	_tmp2_ = project;
	if (_tmp2_ == NULL) {
		gboolean _tmp3_ = FALSE;
		Document* _tmp4_;
		GFile* _tmp5_;
		GFile* _tmp6_;
		gboolean _tmp14_;
		_tmp4_ = doc;
		_tmp5_ = document_get_location (_tmp4_);
		_tmp6_ = _tmp5_;
		if (_tmp6_ != NULL) {
			GFile* _tmp7_;
			Document* _tmp8_;
			GFile* _tmp9_;
			GFile* _tmp10_;
			GFile* _tmp11_ = NULL;
			GFile* _tmp12_;
			gboolean _tmp13_ = FALSE;
			_tmp7_ = self->priv->current_directory;
			_tmp8_ = doc;
			_tmp9_ = document_get_location (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = g_file_get_parent (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = g_file_equal (_tmp7_, _tmp12_);
			_tmp3_ = _tmp13_;
			_g_object_unref0 (_tmp12_);
		} else {
			_tmp3_ = FALSE;
		}
		_tmp14_ = _tmp3_;
		if (_tmp14_) {
			file_browser_refresh (self);
		}
		_project_free0 (project);
		return;
	}
	_tmp15_ = project;
	_tmp16_ = (*_tmp15_).directory;
	_tmp17_ = _g_object_ref0 (_tmp16_);
	project_dir = _tmp17_;
	_tmp19_ = self->priv->current_directory;
	_tmp20_ = project_dir;
	_tmp21_ = g_file_equal (_tmp19_, _tmp20_);
	if (_tmp21_) {
		_tmp18_ = TRUE;
	} else {
		GFile* _tmp22_;
		GFile* _tmp23_;
		gboolean _tmp24_ = FALSE;
		_tmp22_ = self->priv->current_directory;
		_tmp23_ = project_dir;
		_tmp24_ = g_file_has_prefix (_tmp22_, _tmp23_);
		_tmp18_ = _tmp24_;
	}
	_tmp25_ = _tmp18_;
	if (_tmp25_) {
		file_browser_refresh (self);
	}
	_g_object_unref0 (project_dir);
	_project_free0 (project);
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_;
	gchar _tmp1_;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = index;
	_tmp1_ = ((gchar*) self)[_tmp0_];
	result = _tmp1_;
	return result;
}


static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
	int i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}


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


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
	GtkListStore* _tmp0_;
	GtkListStore* _tmp1_;
	GtkTreeView* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GFile* directory;
	GFile* _tmp5_;
	GList* parent_dirs;
	GFile* _tmp110_;
	GFile* _tmp111_;
	GFile* _tmp112_;
	GFile* _tmp113_;
	GFile* current_dir;
	GtkTreeIter _tmp121_ = {0};
	GtkTreeIter iter;
	gint i;
	GList* _tmp122_;
	GFile* _tmp149_;
	GFile* _tmp150_;
	GSettings* _tmp151_;
	GFile* _tmp152_;
	gchar* _tmp153_ = NULL;
	gchar* _tmp154_;
	GtkComboBox* _tmp155_;
	GtkTreeIter _tmp156_;
	GtkButton* _tmp157_;
	GFile* _tmp158_;
	GFile* _tmp159_ = NULL;
	GFile* _tmp160_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list_store;
	gtk_list_store_clear (_tmp0_);
	_tmp1_ = self->priv->parent_dir_store;
	gtk_list_store_clear (_tmp1_);
	_tmp2_ = self->priv->_list_view;
	gtk_tree_view_columns_autosize (_tmp2_);
	_tmp3_ = dir;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	directory = _tmp4_;
	_tmp5_ = directory;
	if (_tmp5_ == NULL) {
		GSettings* _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* uri;
		gboolean _tmp8_ = FALSE;
		const gchar* _tmp9_;
		gboolean _tmp13_;
		gboolean _tmp16_ = FALSE;
		gboolean _tmp17_ = FALSE;
		const gchar* _tmp18_;
		gboolean _tmp22_;
		gboolean _tmp25_;
		_tmp6_ = self->priv->settings;
		_tmp7_ = g_settings_get_string (_tmp6_, "current-directory");
		uri = _tmp7_;
		_tmp9_ = uri;
		if (_tmp9_ != NULL) {
			const gchar* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			_tmp10_ = uri;
			_tmp11_ = strlen (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp8_ = _tmp12_ > 0;
		} else {
			_tmp8_ = FALSE;
		}
		_tmp13_ = _tmp8_;
		if (_tmp13_) {
			const gchar* _tmp14_;
			GFile* _tmp15_ = NULL;
			_tmp14_ = uri;
			_tmp15_ = g_file_new_for_uri (_tmp14_);
			_g_object_unref0 (directory);
			directory = _tmp15_;
		}
		_tmp18_ = uri;
		if (_tmp18_ == NULL) {
			_tmp17_ = TRUE;
		} else {
			const gchar* _tmp19_;
			gint _tmp20_;
			gint _tmp21_;
			_tmp19_ = uri;
			_tmp20_ = strlen (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp17_ = _tmp21_ == 0;
		}
		_tmp22_ = _tmp17_;
		if (_tmp22_) {
			_tmp16_ = TRUE;
		} else {
			GFile* _tmp23_;
			gboolean _tmp24_ = FALSE;
			_tmp23_ = directory;
			_tmp24_ = g_file_query_exists (_tmp23_, NULL);
			_tmp16_ = !_tmp24_;
		}
		_tmp25_ = _tmp16_;
		if (_tmp25_) {
			const gchar* _tmp26_ = NULL;
			GFile* _tmp27_ = NULL;
			_tmp26_ = g_get_home_dir ();
			_tmp27_ = g_file_new_for_path (_tmp26_);
			_g_object_unref0 (directory);
			directory = _tmp27_;
		}
		_g_free0 (uri);
	}
	{
		GFile* _tmp28_;
		GFileEnumerator* _tmp29_ = NULL;
		GFileEnumerator* enumerator;
		GSettings* _tmp30_;
		gboolean _tmp31_ = FALSE;
		gboolean show_all;
		GSettings* _tmp32_;
		gboolean _tmp33_ = FALSE;
		gboolean show_all_except;
		gboolean _tmp34_ = FALSE;
		gboolean _tmp35_;
		gboolean _tmp38_;
		gboolean show_hidden;
		GSettings* _tmp39_;
		gchar* _tmp40_ = NULL;
		gchar* exts;
		const gchar* _tmp41_;
		gchar** _tmp42_;
		gchar** _tmp43_ = NULL;
		gchar** extensions;
		gint extensions_length1;
		gint _extensions_size_;
		GSettings* _tmp44_;
		gchar* _tmp45_ = NULL;
		const gchar* _tmp46_;
		gchar** _tmp47_;
		gchar** _tmp48_ = NULL;
		gchar** clean_extensions;
		gint clean_extensions_length1;
		gint _clean_extensions_size_;
		GtkListStore* _tmp98_;
		_tmp28_ = directory;
		_tmp29_ = g_file_enumerate_children (_tmp28_, "standard::type,standard::display-name", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
		enumerator = _tmp29_;
		if (_inner_error_ != NULL) {
			goto __catch56_g_error;
		}
		_tmp30_ = self->priv->settings;
		_tmp31_ = g_settings_get_boolean (_tmp30_, "show-all-files");
		show_all = _tmp31_;
		_tmp32_ = self->priv->settings;
		_tmp33_ = g_settings_get_boolean (_tmp32_, "show-all-files-except");
		show_all_except = _tmp33_;
		_tmp35_ = show_all;
		if (_tmp35_) {
			GSettings* _tmp36_;
			gboolean _tmp37_ = FALSE;
			_tmp36_ = self->priv->settings;
			_tmp37_ = g_settings_get_boolean (_tmp36_, "show-hidden-files");
			_tmp34_ = _tmp37_;
		} else {
			_tmp34_ = FALSE;
		}
		_tmp38_ = _tmp34_;
		show_hidden = _tmp38_;
		_tmp39_ = self->priv->settings;
		_tmp40_ = g_settings_get_string (_tmp39_, "file-extensions");
		exts = _tmp40_;
		_tmp41_ = exts;
		_tmp43_ = _tmp42_ = g_strsplit (_tmp41_, " ", 0);
		extensions = _tmp43_;
		extensions_length1 = _vala_array_length (_tmp42_);
		_extensions_size_ = extensions_length1;
		_tmp44_ = self->priv->latex_settings;
		_tmp45_ = g_settings_get_string (_tmp44_, "clean-extensions");
		_g_free0 (exts);
		exts = _tmp45_;
		_tmp46_ = exts;
		_tmp48_ = _tmp47_ = g_strsplit (_tmp46_, " ", 0);
		clean_extensions = _tmp48_;
		clean_extensions_length1 = _vala_array_length (_tmp47_);
		_clean_extensions_size_ = clean_extensions_length1;
		{
			GFileEnumerator* _tmp49_;
			GFileInfo* _tmp50_ = NULL;
			GFileInfo* info;
			_tmp49_ = enumerator;
			_tmp50_ = g_file_enumerator_next_file (_tmp49_, NULL, &_inner_error_);
			info = _tmp50_;
			if (_inner_error_ != NULL) {
				clean_extensions = (_vala_array_free (clean_extensions, clean_extensions_length1, (GDestroyNotify) g_free), NULL);
				extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (exts);
				_g_object_unref0 (enumerator);
				goto __catch56_g_error;
			}
			{
				gboolean _tmp51_;
				_tmp51_ = TRUE;
				while (TRUE) {
					gboolean _tmp52_;
					GFileInfo* _tmp56_;
					GFileInfo* _tmp57_;
					const gchar* _tmp58_ = NULL;
					gchar* _tmp59_;
					gchar* basename;
					gboolean _tmp60_ = FALSE;
					const gchar* _tmp61_;
					gchar _tmp62_ = '\0';
					gboolean _tmp64_;
					GFileInfo* _tmp65_;
					GFileType _tmp66_ = 0;
					GFileType type;
					GFileType _tmp67_;
					const gchar* _tmp69_;
					gchar* _tmp70_ = NULL;
					gchar* extension;
					gboolean _tmp71_ = FALSE;
					gboolean _tmp72_ = FALSE;
					gboolean _tmp73_ = FALSE;
					gboolean _tmp74_;
					gboolean _tmp76_;
					gboolean _tmp82_;
					gboolean _tmp85_;
					_tmp52_ = _tmp51_;
					if (!_tmp52_) {
						GFileEnumerator* _tmp53_;
						GFileInfo* _tmp54_ = NULL;
						GFileInfo* _tmp55_;
						_tmp53_ = enumerator;
						_tmp54_ = g_file_enumerator_next_file (_tmp53_, NULL, &_inner_error_);
						_tmp55_ = _tmp54_;
						if (_inner_error_ != NULL) {
							_g_object_unref0 (info);
							clean_extensions = (_vala_array_free (clean_extensions, clean_extensions_length1, (GDestroyNotify) g_free), NULL);
							extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
							_g_free0 (exts);
							_g_object_unref0 (enumerator);
							goto __catch56_g_error;
						}
						_g_object_unref0 (info);
						info = _tmp55_;
					}
					_tmp51_ = FALSE;
					_tmp56_ = info;
					if (!(_tmp56_ != NULL)) {
						break;
					}
					_tmp57_ = info;
					_tmp58_ = g_file_info_get_display_name (_tmp57_);
					_tmp59_ = g_strdup (_tmp58_);
					basename = _tmp59_;
					_tmp61_ = basename;
					_tmp62_ = string_get (_tmp61_, (glong) 0);
					if (_tmp62_ == '.') {
						gboolean _tmp63_;
						_tmp63_ = show_hidden;
						_tmp60_ = !_tmp63_;
					} else {
						_tmp60_ = FALSE;
					}
					_tmp64_ = _tmp60_;
					if (_tmp64_) {
						_g_free0 (basename);
						continue;
					}
					_tmp65_ = info;
					_tmp66_ = g_file_info_get_file_type (_tmp65_);
					type = _tmp66_;
					_tmp67_ = type;
					if (_tmp67_ == G_FILE_TYPE_DIRECTORY) {
						const gchar* _tmp68_;
						_tmp68_ = basename;
						file_browser_insert_file (self, TRUE, GTK_STOCK_DIRECTORY, _tmp68_);
						_g_free0 (basename);
						continue;
					}
					_tmp69_ = basename;
					_tmp70_ = utils_get_extension (_tmp69_);
					extension = _tmp70_;
					_tmp74_ = show_all;
					if (_tmp74_) {
						gboolean _tmp75_;
						_tmp75_ = show_all_except;
						_tmp73_ = !_tmp75_;
					} else {
						_tmp73_ = FALSE;
					}
					_tmp76_ = _tmp73_;
					if (_tmp76_) {
						_tmp72_ = TRUE;
					} else {
						gboolean _tmp77_ = FALSE;
						gboolean _tmp78_;
						gboolean _tmp81_;
						_tmp78_ = show_all;
						if (_tmp78_) {
							const gchar* _tmp79_;
							gchar** _tmp80_;
							gint _tmp80__length1;
							_tmp79_ = extension;
							_tmp80_ = clean_extensions;
							_tmp80__length1 = clean_extensions_length1;
							_tmp77_ = !_vala_string_array_contains (_tmp80_, _tmp80__length1, _tmp79_);
						} else {
							_tmp77_ = FALSE;
						}
						_tmp81_ = _tmp77_;
						_tmp72_ = _tmp81_;
					}
					_tmp82_ = _tmp72_;
					if (_tmp82_) {
						_tmp71_ = TRUE;
					} else {
						const gchar* _tmp83_;
						gchar** _tmp84_;
						gint _tmp84__length1;
						_tmp83_ = extension;
						_tmp84_ = extensions;
						_tmp84__length1 = extensions_length1;
						_tmp71_ = _vala_string_array_contains (_tmp84_, _tmp84__length1, _tmp83_);
					}
					_tmp85_ = _tmp71_;
					if (_tmp85_) {
						gchar* pixbuf = NULL;
						const gchar* _tmp86_;
						const gchar* _tmp87_;
						GQuark _tmp89_ = 0U;
						static GQuark _tmp88_label0 = 0;
						static GQuark _tmp88_label1 = 0;
						static GQuark _tmp88_label2 = 0;
						static GQuark _tmp88_label3 = 0;
						static GQuark _tmp88_label4 = 0;
						static GQuark _tmp88_label5 = 0;
						static GQuark _tmp88_label6 = 0;
						static GQuark _tmp88_label7 = 0;
						static GQuark _tmp88_label8 = 0;
						static GQuark _tmp88_label9 = 0;
						static GQuark _tmp88_label10 = 0;
						static GQuark _tmp88_label11 = 0;
						const gchar* _tmp96_;
						const gchar* _tmp97_;
						_tmp86_ = extension;
						_tmp87_ = _tmp86_;
						_tmp89_ = (NULL == _tmp87_) ? 0 : g_quark_from_string (_tmp87_);
						if (_tmp89_ == ((0 != _tmp88_label0) ? _tmp88_label0 : (_tmp88_label0 = g_quark_from_static_string (".tex")))) {
							switch (0) {
								default:
								{
									gchar* _tmp90_;
									_tmp90_ = g_strdup (GTK_STOCK_EDIT);
									_g_free0 (pixbuf);
									pixbuf = _tmp90_;
									break;
								}
							}
						} else if (_tmp89_ == ((0 != _tmp88_label1) ? _tmp88_label1 : (_tmp88_label1 = g_quark_from_static_string (".pdf")))) {
							switch (0) {
								default:
								{
									gchar* _tmp91_;
									_tmp91_ = g_strdup ("view_pdf");
									_g_free0 (pixbuf);
									pixbuf = _tmp91_;
									break;
								}
							}
						} else if (_tmp89_ == ((0 != _tmp88_label2) ? _tmp88_label2 : (_tmp88_label2 = g_quark_from_static_string (".dvi")))) {
							switch (0) {
								default:
								{
									gchar* _tmp92_;
									_tmp92_ = g_strdup ("view_dvi");
									_g_free0 (pixbuf);
									pixbuf = _tmp92_;
									break;
								}
							}
						} else if ((_tmp89_ == ((0 != _tmp88_label3) ? _tmp88_label3 : (_tmp88_label3 = g_quark_from_static_string (".ps")))) || (_tmp89_ == ((0 != _tmp88_label4) ? _tmp88_label4 : (_tmp88_label4 = g_quark_from_static_string (".eps"))))) {
							switch (0) {
								default:
								{
									gchar* _tmp93_;
									_tmp93_ = g_strdup ("view_ps");
									_g_free0 (pixbuf);
									pixbuf = _tmp93_;
									break;
								}
							}
						} else if (((((((_tmp89_ == ((0 != _tmp88_label5) ? _tmp88_label5 : (_tmp88_label5 = g_quark_from_static_string (".png")))) || (_tmp89_ == ((0 != _tmp88_label6) ? _tmp88_label6 : (_tmp88_label6 = g_quark_from_static_string (".jpg"))))) || (_tmp89_ == ((0 != _tmp88_label7) ? _tmp88_label7 : (_tmp88_label7 = g_quark_from_static_string (".jpeg"))))) || (_tmp89_ == ((0 != _tmp88_label8) ? _tmp88_label8 : (_tmp88_label8 = g_quark_from_static_string (".gif"))))) || (_tmp89_ == ((0 != _tmp88_label9) ? _tmp88_label9 : (_tmp88_label9 = g_quark_from_static_string (".bmp"))))) || (_tmp89_ == ((0 != _tmp88_label10) ? _tmp88_label10 : (_tmp88_label10 = g_quark_from_static_string (".tif"))))) || (_tmp89_ == ((0 != _tmp88_label11) ? _tmp88_label11 : (_tmp88_label11 = g_quark_from_static_string (".tiff"))))) {
							switch (0) {
								default:
								{
									gchar* _tmp94_;
									_tmp94_ = g_strdup ("image");
									_g_free0 (pixbuf);
									pixbuf = _tmp94_;
									break;
								}
							}
						} else {
							switch (0) {
								default:
								{
									gchar* _tmp95_;
									_tmp95_ = g_strdup (GTK_STOCK_FILE);
									_g_free0 (pixbuf);
									pixbuf = _tmp95_;
									break;
								}
							}
						}
						_tmp96_ = pixbuf;
						_tmp97_ = basename;
						file_browser_insert_file (self, FALSE, _tmp96_, _tmp97_);
						_g_free0 (pixbuf);
					}
					_g_free0 (extension);
					_g_free0 (basename);
				}
			}
			_g_object_unref0 (info);
		}
		_tmp98_ = self->priv->list_store;
		gtk_tree_sortable_sort_column_changed ((GtkTreeSortable*) _tmp98_);
		clean_extensions = (_vala_array_free (clean_extensions, clean_extensions_length1, (GDestroyNotify) g_free), NULL);
		extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (exts);
		_g_object_unref0 (enumerator);
	}
	goto __finally56;
	__catch56_g_error:
	{
		GError* e = NULL;
		GError* _tmp99_;
		const gchar* _tmp100_;
		MainWindow* _tmp101_;
		const gchar* _tmp102_ = NULL;
		GtkMessageDialog* _tmp103_;
		GtkMessageDialog* _tmp104_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp105_;
		GError* _tmp106_;
		const gchar* _tmp107_;
		GtkMessageDialog* _tmp108_;
		GtkMessageDialog* _tmp109_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp99_ = e;
		_tmp100_ = _tmp99_->message;
		g_warning ("file_browser.vala:431: %s", _tmp100_);
		_tmp101_ = self->priv->main_window;
		_tmp102_ = _ ("File Browser");
		_tmp103_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _tmp101_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, "%s", _tmp102_);
		_tmp104_ = g_object_ref_sink (_tmp103_);
		dialog = _tmp104_;
		_tmp105_ = dialog;
		_tmp106_ = e;
		_tmp107_ = _tmp106_->message;
		gtk_message_dialog_format_secondary_text (_tmp105_, "%s", _tmp107_);
		_tmp108_ = dialog;
		gtk_dialog_run ((GtkDialog*) _tmp108_);
		_tmp109_ = dialog;
		gtk_object_destroy ((GtkObject*) _tmp109_);
		_g_object_unref0 (dialog);
		_g_error_free0 (e);
		_g_object_unref0 (directory);
		return;
	}
	__finally56:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (directory);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	parent_dirs = NULL;
	_tmp110_ = directory;
	_tmp111_ = _g_object_ref0 (_tmp110_);
	parent_dirs = g_list_prepend (parent_dirs, _tmp111_);
	_tmp112_ = directory;
	_tmp113_ = _g_object_ref0 (_tmp112_);
	current_dir = _tmp113_;
	while (TRUE) {
		GFile* _tmp114_;
		GFile* _tmp115_ = NULL;
		GFile* parent;
		GFile* _tmp116_;
		GFile* _tmp117_;
		GFile* _tmp118_;
		GFile* _tmp119_;
		GFile* _tmp120_;
		_tmp114_ = current_dir;
		_tmp115_ = g_file_get_parent (_tmp114_);
		parent = _tmp115_;
		_tmp116_ = parent;
		if (_tmp116_ == NULL) {
			_g_object_unref0 (parent);
			break;
		}
		_tmp117_ = parent;
		_tmp118_ = _g_object_ref0 (_tmp117_);
		parent_dirs = g_list_prepend (parent_dirs, _tmp118_);
		_tmp119_ = parent;
		_tmp120_ = _g_object_ref0 (_tmp119_);
		_g_object_unref0 (current_dir);
		current_dir = _tmp120_;
		_g_object_unref0 (parent);
	}
	iter = _tmp121_;
	i = 0;
	_tmp122_ = parent_dirs;
	{
		GList* current_collection = NULL;
		GList* current_it = NULL;
		current_collection = _tmp122_;
		for (current_it = current_collection; current_it != NULL; current_it = current_it->next) {
			GFile* _tmp123_;
			GFile* current = NULL;
			_tmp123_ = _g_object_ref0 ((GFile*) current_it->data);
			current = _tmp123_;
			{
				gchar* basename = NULL;
				gint _tmp124_;
				gint _tmp129_;
				gchar* _tmp130_ = NULL;
				gchar* indent;
				gchar* pixbuf = NULL;
				gint _tmp131_;
				GtkListStore* _tmp140_;
				GtkTreeIter _tmp141_ = {0};
				GtkListStore* _tmp142_;
				GtkTreeIter _tmp143_;
				GFile* _tmp144_;
				const gchar* _tmp145_;
				const gchar* _tmp146_;
				const gchar* _tmp147_;
				gint _tmp148_;
				_tmp124_ = i;
				if (_tmp124_ == 0) {
					const gchar* _tmp125_ = NULL;
					gchar* _tmp126_;
					_tmp125_ = _ ("File System");
					_tmp126_ = g_strdup (_tmp125_);
					_g_free0 (basename);
					basename = _tmp126_;
				} else {
					GFile* _tmp127_;
					gchar* _tmp128_ = NULL;
					_tmp127_ = current;
					_tmp128_ = g_file_get_basename (_tmp127_);
					_g_free0 (basename);
					basename = _tmp128_;
				}
				_tmp129_ = i;
				_tmp130_ = g_strnfill ((gsize) (_tmp129_ * 2), ' ');
				indent = _tmp130_;
				_tmp131_ = i;
				if (_tmp131_ == 0) {
					gchar* _tmp132_;
					_tmp132_ = g_strdup (GTK_STOCK_HARDDISK);
					_g_free0 (pixbuf);
					pixbuf = _tmp132_;
				} else {
					const gchar* _tmp133_ = NULL;
					GFile* _tmp134_;
					gchar* _tmp135_ = NULL;
					gchar* _tmp136_;
					gboolean _tmp137_;
					_tmp133_ = g_get_home_dir ();
					_tmp134_ = current;
					_tmp135_ = g_file_get_path (_tmp134_);
					_tmp136_ = _tmp135_;
					_tmp137_ = g_strcmp0 (_tmp133_, _tmp136_) == 0;
					_g_free0 (_tmp136_);
					if (_tmp137_) {
						gchar* _tmp138_;
						_tmp138_ = g_strdup (GTK_STOCK_HOME);
						_g_free0 (pixbuf);
						pixbuf = _tmp138_;
					} else {
						gchar* _tmp139_;
						_tmp139_ = g_strdup (GTK_STOCK_DIRECTORY);
						_g_free0 (pixbuf);
						pixbuf = _tmp139_;
					}
				}
				_tmp140_ = self->priv->parent_dir_store;
				gtk_list_store_append (_tmp140_, &_tmp141_);
				iter = _tmp141_;
				_tmp142_ = self->priv->parent_dir_store;
				_tmp143_ = iter;
				_tmp144_ = current;
				_tmp145_ = indent;
				_tmp146_ = basename;
				_tmp147_ = pixbuf;
				gtk_list_store_set (_tmp142_, &_tmp143_, FILE_BROWSER_PARENT_DIR_COLUMN_FILE, _tmp144_, FILE_BROWSER_PARENT_DIR_COLUMN_INDENT, _tmp145_, FILE_BROWSER_PARENT_DIR_COLUMN_NAME, _tmp146_, FILE_BROWSER_PARENT_DIR_COLUMN_PIXBUF, _tmp147_, -1, -1);
				_tmp148_ = i;
				i = _tmp148_ + 1;
				_g_free0 (pixbuf);
				_g_free0 (indent);
				_g_free0 (basename);
				_g_object_unref0 (current);
			}
		}
	}
	_tmp149_ = directory;
	_tmp150_ = _g_object_ref0 (_tmp149_);
	_g_object_unref0 (self->priv->current_directory);
	self->priv->current_directory = _tmp150_;
	_tmp151_ = self->priv->settings;
	_tmp152_ = directory;
	_tmp153_ = g_file_get_uri (_tmp152_);
	_tmp154_ = _tmp153_;
	g_settings_set_string (_tmp151_, "current-directory", _tmp154_);
	_g_free0 (_tmp154_);
	_tmp155_ = self->priv->combo_box;
	_tmp156_ = iter;
	gtk_combo_box_set_active_iter (_tmp155_, &_tmp156_);
	_tmp157_ = self->priv->parent_button;
	_tmp158_ = directory;
	_tmp159_ = g_file_get_parent (_tmp158_);
	_tmp160_ = _tmp159_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp157_, _tmp160_ != NULL);
	_g_object_unref0 (_tmp160_);
	_g_object_unref0 (current_dir);
	__g_list_free__g_object_unref0_0 (parent_dirs);
	_g_object_unref0 (directory);
}


static void file_browser_insert_file (FileBrowser* self, gboolean is_dir, const gchar* pixbuf, const gchar* basename) {
	GtkTreeIter iter = {0};
	GtkListStore* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	GtkListStore* _tmp2_;
	GtkTreeIter _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pixbuf != NULL);
	g_return_if_fail (basename != NULL);
	_tmp0_ = self->priv->list_store;
	gtk_list_store_append (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	_tmp2_ = self->priv->list_store;
	_tmp3_ = iter;
	_tmp4_ = is_dir;
	_tmp5_ = pixbuf;
	_tmp6_ = basename;
	gtk_list_store_set (_tmp2_, &_tmp3_, FILE_BROWSER_FILE_COLUMN_IS_DIR, _tmp4_, FILE_BROWSER_FILE_COLUMN_PIXBUF, _tmp5_, FILE_BROWSER_FILE_COLUMN_NAME, _tmp6_, -1, -1);
}


static gint file_browser_on_sort (FileBrowser* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b) {
	gint result = 0;
	gboolean a_is_dir = FALSE;
	gboolean b_is_dir = FALSE;
	GtkTreeModel* _tmp0_;
	GtkTreeIter _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkTreeIter _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gint _tmp13_ = 0;
	gboolean _tmp14_;
	gint _tmp15_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (model != NULL, 0);
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = model;
	_tmp1_ = *a;
	gtk_tree_model_get (_tmp0_, &_tmp1_, FILE_BROWSER_FILE_COLUMN_IS_DIR, &a_is_dir, -1, -1);
	_tmp2_ = model;
	_tmp3_ = *b;
	gtk_tree_model_get (_tmp2_, &_tmp3_, FILE_BROWSER_FILE_COLUMN_IS_DIR, &b_is_dir, -1, -1);
	_tmp4_ = a_is_dir;
	_tmp5_ = b_is_dir;
	if (_tmp4_ == _tmp5_) {
		gchar* a_name = NULL;
		gchar* b_name = NULL;
		GtkTreeModel* _tmp6_;
		GtkTreeIter _tmp7_;
		GtkTreeModel* _tmp8_;
		GtkTreeIter _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gint _tmp12_ = 0;
		_tmp6_ = model;
		_tmp7_ = *a;
		gtk_tree_model_get (_tmp6_, &_tmp7_, FILE_BROWSER_FILE_COLUMN_NAME, &a_name, -1, -1);
		_tmp8_ = model;
		_tmp9_ = *b;
		gtk_tree_model_get (_tmp8_, &_tmp9_, FILE_BROWSER_FILE_COLUMN_NAME, &b_name, -1, -1);
		_tmp10_ = a_name;
		_tmp11_ = b_name;
		_tmp12_ = g_utf8_collate (_tmp10_, _tmp11_);
		result = _tmp12_;
		_g_free0 (b_name);
		_g_free0 (a_name);
		return result;
	}
	_tmp14_ = a_is_dir;
	if (_tmp14_) {
		_tmp13_ = -1;
	} else {
		_tmp13_ = +1;
	}
	_tmp15_ = _tmp13_;
	result = _tmp15_;
	return result;
}


static void file_browser_class_init (FileBrowserClass * klass) {
	file_browser_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (FileBrowserPrivate));
	G_OBJECT_CLASS (klass)->finalize = file_browser_finalize;
}


static void file_browser_instance_init (FileBrowser * self) {
	self->priv = FILE_BROWSER_GET_PRIVATE (self);
	self->priv->timeout_id = (guint) 0;
}


static void file_browser_finalize (GObject* obj) {
	FileBrowser * self;
	self = FILE_BROWSER (obj);
	_g_object_unref0 (self->priv->build_view);
	_g_object_unref0 (self->priv->parent_dir_store);
	_g_object_unref0 (self->priv->list_store);
	_g_object_unref0 (self->priv->_list_view);
	_g_object_unref0 (self->priv->combo_box);
	_g_object_unref0 (self->priv->current_directory);
	_g_object_unref0 (self->priv->parent_button);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->latex_settings);
	G_OBJECT_CLASS (file_browser_parent_class)->finalize (obj);
}


GType file_browser_get_type (void) {
	static volatile gsize file_browser_type_id__volatile = 0;
	if (g_once_init_enter (&file_browser_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FileBrowserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) file_browser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FileBrowser), 0, (GInstanceInitFunc) file_browser_instance_init, NULL };
		GType file_browser_type_id;
		file_browser_type_id = g_type_register_static (GTK_TYPE_VBOX, "FileBrowser", &g_define_type_info, 0);
		g_once_init_leave (&file_browser_type_id__volatile, file_browser_type_id);
	}
	return file_browser_type_id__volatile;
}


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


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


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



