/* baobab-window.c generated by valac 0.38.1.8-0ab50-dirty, the Vala compiler
 * generated from baobab-window.vala, do not modify */

/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Baobab - disk usage analyzer
 *
 * Copyright (C) 2012  Ryan Lortie <desrt@desrt.ca>
 * Copyright (C) 2012  Paolo Borelli <pborelli@gnome.org>
 * Copyright (C) 2012  Stefano Facchini <stefano.facchini@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include "config.h"


#define BAOBAB_TYPE_WINDOW (baobab_window_get_type ())
#define BAOBAB_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_WINDOW, BaobabWindow))
#define BAOBAB_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_WINDOW, BaobabWindowClass))
#define BAOBAB_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_WINDOW))
#define BAOBAB_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_WINDOW))
#define BAOBAB_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_WINDOW, BaobabWindowClass))

typedef struct _BaobabWindow BaobabWindow;
typedef struct _BaobabWindowClass BaobabWindowClass;
typedef struct _BaobabWindowPrivate BaobabWindowPrivate;

#define BAOBAB_TYPE_LOCATION_LIST (baobab_location_list_get_type ())
#define BAOBAB_LOCATION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_LOCATION_LIST, BaobabLocationList))
#define BAOBAB_LOCATION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_LOCATION_LIST, BaobabLocationListClass))
#define BAOBAB_IS_LOCATION_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_LOCATION_LIST))
#define BAOBAB_IS_LOCATION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_LOCATION_LIST))
#define BAOBAB_LOCATION_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_LOCATION_LIST, BaobabLocationListClass))

typedef struct _BaobabLocationList BaobabLocationList;
typedef struct _BaobabLocationListClass BaobabLocationListClass;

#define BAOBAB_TYPE_CELL_RENDERER_SIZE (baobab_cell_renderer_size_get_type ())
#define BAOBAB_CELL_RENDERER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSize))
#define BAOBAB_CELL_RENDERER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSizeClass))
#define BAOBAB_IS_CELL_RENDERER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_CELL_RENDERER_SIZE))
#define BAOBAB_IS_CELL_RENDERER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_CELL_RENDERER_SIZE))
#define BAOBAB_CELL_RENDERER_SIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSizeClass))

typedef struct _BaobabCellRendererSize BaobabCellRendererSize;
typedef struct _BaobabCellRendererSizeClass BaobabCellRendererSizeClass;

#define BAOBAB_TYPE_CHART (baobab_chart_get_type ())
#define BAOBAB_CHART(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_CHART, BaobabChart))
#define BAOBAB_CHART_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_CHART, BaobabChartClass))
#define BAOBAB_IS_CHART(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_CHART))
#define BAOBAB_IS_CHART_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_CHART))
#define BAOBAB_CHART_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_CHART, BaobabChartClass))

typedef struct _BaobabChart BaobabChart;
typedef struct _BaobabChartClass BaobabChartClass;

#define BAOBAB_TYPE_LOCATION (baobab_location_get_type ())
#define BAOBAB_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_LOCATION, BaobabLocation))
#define BAOBAB_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_LOCATION, BaobabLocationClass))
#define BAOBAB_IS_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_LOCATION))
#define BAOBAB_IS_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_LOCATION))
#define BAOBAB_LOCATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_LOCATION, BaobabLocationClass))

typedef struct _BaobabLocation BaobabLocation;
typedef struct _BaobabLocationClass BaobabLocationClass;
enum  {
	BAOBAB_WINDOW_DUMMY_PROPERTY,
	BAOBAB_WINDOW_LAST_PROPERTY
};
static GParamSpec* baobab_window_properties[BAOBAB_WINDOW_LAST_PROPERTY];

#define BAOBAB_WINDOW_TYPE_DND_TARGETS (baobab_window_dnd_targets_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _baobab_location_unref0(var) ((var == NULL) ? NULL : (var = (baobab_location_unref (var), NULL)))

#define BAOBAB_WINDOW_TYPE_ACTION_STATE (baobab_window_action_state_get_type ())
typedef struct _BaobabWindowActionState BaobabWindowActionState;

#define BAOBAB_TYPE_APPLICATION (baobab_application_get_type ())
#define BAOBAB_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_APPLICATION, BaobabApplication))
#define BAOBAB_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_APPLICATION, BaobabApplicationClass))
#define BAOBAB_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_APPLICATION))
#define BAOBAB_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_APPLICATION))
#define BAOBAB_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_APPLICATION, BaobabApplicationClass))

typedef struct _BaobabApplication BaobabApplication;
typedef struct _BaobabApplicationClass BaobabApplicationClass;
typedef struct _Block1Data Block1Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define BAOBAB_TYPE_SCANNER (baobab_scanner_get_type ())
#define BAOBAB_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_SCANNER, BaobabScanner))
#define BAOBAB_SCANNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_SCANNER, BaobabScannerClass))
#define BAOBAB_IS_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_SCANNER))
#define BAOBAB_IS_SCANNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_SCANNER))
#define BAOBAB_SCANNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_SCANNER, BaobabScannerClass))

typedef struct _BaobabScanner BaobabScanner;
typedef struct _BaobabScannerClass BaobabScannerClass;
typedef struct _Block2Data Block2Data;

#define BAOBAB_TYPE_SCAN_FLAGS (baobab_scan_flags_get_type ())
typedef struct _Block3Data Block3Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))

#define BAOBAB_SCANNER_TYPE_COLUMNS (baobab_scanner_columns_get_type ())
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block4Data Block4Data;
typedef struct _Block5Data Block5Data;

#define BAOBAB_SCANNER_TYPE_STATE (baobab_scanner_state_get_type ())

struct _BaobabWindow {
	GtkApplicationWindow parent_instance;
	BaobabWindowPrivate * priv;
};

struct _BaobabWindowClass {
	GtkApplicationWindowClass parent_class;
};

struct _BaobabWindowPrivate {
	GtkHeaderBar* header_bar;
	GtkButton* back_button;
	GtkButton* reload_button;
	GtkMenuButton* menu_button;
	GtkStack* main_stack;
	GtkWidget* home_page;
	GtkWidget* result_page;
	GtkInfoBar* infobar;
	GtkLabel* infobar_primary_label;
	GtkLabel* infobar_secondary_label;
	GtkButton* infobar_close_button;
	BaobabLocationList* location_list;
	GtkTreeView* treeview;
	GtkTreeViewColumn* size_column;
	BaobabCellRendererSize* size_column_size_renderer;
	GtkMenu* treeview_popup_menu;
	GtkMenuItem* treeview_popup_open;
	GtkMenuItem* treeview_popup_copy;
	GtkMenuItem* treeview_popup_trash;
	GtkStack* chart_stack;
	GtkStack* spinner_stack;
	GtkStackSwitcher* chart_stack_switcher;
	BaobabChart* rings_chart;
	BaobabChart* treemap_chart;
	GtkSpinner* spinner;
	BaobabLocation* active_location;
	gulong scan_completed_handler;
};

typedef enum  {
	BAOBAB_WINDOW_DND_TARGETS_URI_LIST
} BaobabWindowDndTargets;

struct _BaobabWindowActionState {
	gchar* name;
	gboolean enable;
};

struct _Block1Data {
	int _ref_count_;
	BaobabWindow* self;
	GSettings* ui_settings;
	gint width;
	gint height;
};

typedef void (*BaobabLocationListLocationAction) (BaobabLocation* l, void* user_data);
struct _Block2Data {
	int _ref_count_;
	BaobabWindow* self;
	GtkFileChooserDialog* file_chooser;
	GtkCheckButton* check_button;
};

typedef enum  {
	BAOBAB_SCAN_FLAGS_NONE = 1 << 0,
	BAOBAB_SCAN_FLAGS_EXCLUDE_MOUNTS = 1 << 1
} BaobabScanFlags;

struct _Block3Data {
	int _ref_count_;
	BaobabWindow* self;
	BaobabLocation* location;
};

typedef enum  {
	BAOBAB_SCANNER_COLUMNS_DISPLAY_NAME,
	BAOBAB_SCANNER_COLUMNS_PARSE_NAME,
	BAOBAB_SCANNER_COLUMNS_PERCENT,
	BAOBAB_SCANNER_COLUMNS_SIZE,
	BAOBAB_SCANNER_COLUMNS_ALLOC_SIZE,
	BAOBAB_SCANNER_COLUMNS_TIME_MODIFIED,
	BAOBAB_SCANNER_COLUMNS_ELEMENTS,
	BAOBAB_SCANNER_COLUMNS_STATE,
	BAOBAB_SCANNER_COLUMNS_ERROR,
	BAOBAB_SCANNER_COLUMNS_COLUMNS
} BaobabScannerColumns;

struct _Block4Data {
	int _ref_count_;
	BaobabWindow* self;
	GtkTreeSelection* selection;
};

struct _Block5Data {
	int _ref_count_;
	BaobabWindow* self;
	BaobabScanner* scanner;
};

typedef enum  {
	BAOBAB_SCANNER_STATE_SCANNING,
	BAOBAB_SCANNER_STATE_CANCELLED,
	BAOBAB_SCANNER_STATE_NEED_PERCENT,
	BAOBAB_SCANNER_STATE_ERROR,
	BAOBAB_SCANNER_STATE_CHILD_ERROR,
	BAOBAB_SCANNER_STATE_DONE
} BaobabScannerState;


static gpointer baobab_window_parent_class = NULL;
static GdkCursor* baobab_window_busy_cursor;
static GdkCursor* baobab_window_busy_cursor = NULL;

GType baobab_window_get_type (void) G_GNUC_CONST;
GType baobab_location_list_get_type (void) G_GNUC_CONST;
GType baobab_cell_renderer_size_get_type (void) G_GNUC_CONST;
GType baobab_chart_get_type (void) G_GNUC_CONST;
gpointer baobab_location_ref (gpointer instance);
void baobab_location_unref (gpointer instance);
GParamSpec* baobab_param_spec_location (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void baobab_value_set_location (GValue* value, gpointer v_object);
void baobab_value_take_location (GValue* value, gpointer v_object);
gpointer baobab_value_get_location (const GValue* value);
GType baobab_location_get_type (void) G_GNUC_CONST;
#define BAOBAB_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BAOBAB_TYPE_WINDOW, BaobabWindowPrivate))
static GType baobab_window_dnd_targets_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static void baobab_window_on_show_gear_menu_activate (BaobabWindow* self, GSimpleAction* action);
static void _baobab_window_on_show_gear_menu_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_show_home_page_activate (BaobabWindow* self);
static void _baobab_window_on_show_home_page_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_scan_folder_activate (BaobabWindow* self);
static void _baobab_window_on_scan_folder_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_reload_activate (BaobabWindow* self);
static void _baobab_window_on_reload_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_show_allocated (BaobabWindow* self);
static void _baobab_window_on_show_allocated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_expand_all (BaobabWindow* self);
static void _baobab_window_on_expand_all_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_collapse_all (BaobabWindow* self);
static void _baobab_window_on_collapse_all_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_help_activate (BaobabWindow* self);
static void _baobab_window_on_help_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void baobab_window_on_about_activate (BaobabWindow* self);
static void _baobab_window_on_about_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
GType baobab_window_action_state_get_type (void) G_GNUC_CONST;
BaobabWindowActionState* baobab_window_action_state_dup (const BaobabWindowActionState* self);
void baobab_window_action_state_free (BaobabWindowActionState* self);
void baobab_window_action_state_copy (const BaobabWindowActionState* self, BaobabWindowActionState* dest);
void baobab_window_action_state_destroy (BaobabWindowActionState* self);
GType baobab_application_get_type (void) G_GNUC_CONST;
BaobabWindow* baobab_window_new (BaobabApplication* app);
BaobabWindow* baobab_window_construct (GType object_type, BaobabApplication* app);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
void baobab_location_list_set_action (BaobabLocationList* self, BaobabLocationListLocationAction action, void* action_target, GDestroyNotify action_target_destroy_notify);
static void baobab_window_on_scan_location_activate (BaobabWindow* self, BaobabLocation* location);
static void _baobab_window_on_scan_location_activate_baobab_location_list_location_action (BaobabLocation* l, gpointer self);
static void baobab_window_setup_treeview (BaobabWindow* self);
static void __lambda18_ (BaobabWindow* self);
static void baobab_window_clear_message (BaobabWindow* self);
static void ___lambda18__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda19_ (BaobabWindow* self);
static void ___lambda19__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void baobab_window_on_chart_item_activated (BaobabWindow* self, BaobabChart* chart, GtkTreeIter* iter);
static void _baobab_window_on_chart_item_activated_baobab_chart_item_activated (BaobabChart* _sender, GtkTreeIter* iter, gpointer self);
static void baobab_window_on_drag_data_received (BaobabWindow* self, GtkWidget* widget, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint target_type, guint time);
static void _baobab_window_on_drag_data_received_gtk_widget_drag_data_received (GtkWidget* _sender, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time_, gpointer self);
static void baobab_window_enable_drop (BaobabWindow* self);
static gboolean __lambda20_ (Block1Data* _data1_, GdkEventWindowState* event);
static gboolean ___lambda20__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self);
static gboolean __lambda21_ (Block1Data* _data1_, GdkEventConfigure* event);
static gboolean ___lambda21__gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self);
static void __lambda22_ (Block1Data* _data1_);
static void ___lambda22__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void baobab_window_set_ui_state (BaobabWindow* self, GtkWidget* child, gboolean busy);
GType baobab_scanner_get_type (void) G_GNUC_CONST;
BaobabScanner* baobab_location_get_scanner (BaobabLocation* self);
void baobab_scanner_cancel (BaobabScanner* self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda9_ (Block2Data* _data2_, gint response);
GType baobab_scan_flags_get_type (void) G_GNUC_CONST;
void baobab_window_scan_directory (BaobabWindow* self, GFile* directory, BaobabScanFlags flags);
static void ___lambda9__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void baobab_window_set_active_location (BaobabWindow* self, BaobabLocation* location);
void baobab_location_list_add_location (BaobabLocationList* self, BaobabLocation* location);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
gboolean baobab_location_get_is_volume (BaobabLocation* self);
void baobab_location_mount_volume (BaobabLocation* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void baobab_location_mount_volume_finish (BaobabLocation* self, GAsyncResult* _res_, GError** error);
static void ___lambda11_ (Block3Data* _data3_, GObject* location_, GAsyncResult* res);
static void baobab_window_scan_active_location (BaobabWindow* self, gboolean force);
static void baobab_window_message (BaobabWindow* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType type);
static void ____lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void baobab_window_disable_drop (BaobabWindow* self);
static gboolean baobab_window_show_treeview_popup (BaobabWindow* self, GtkMenu* popup, GdkEventButton* event);
void baobab_window_open_item (BaobabWindow* self, GtkTreeIter* iter);
GType baobab_scanner_columns_get_type (void) G_GNUC_CONST;
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
void baobab_window_copy_path (BaobabWindow* self, GtkTreeIter* iter);
void baobab_window_trash_file (BaobabWindow* self, GtkTreeIter* iter);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static gboolean __lambda12_ (BaobabWindow* self, GdkEventButton* event);
static gboolean ___lambda12__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static gboolean __lambda13_ (BaobabWindow* self);
static gboolean ___lambda13__gtk_widget_popup_menu (GtkWidget* _sender, gpointer self);
static void __lambda14_ (BaobabWindow* self);
static void ___lambda14__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda15_ (BaobabWindow* self);
static void ___lambda15__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda16_ (BaobabWindow* self);
static void ___lambda16__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
static void __lambda17_ (Block4Data* _data4_);
void baobab_chart_set_root (BaobabChart* self, GtkTreePath* value);
static void ___lambda17__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
static void baobab_window_set_busy (BaobabWindow* self, gboolean busy);
const gchar* baobab_location_get_name (BaobabLocation* self);
static void baobab_window_first_row_has_child (BaobabWindow* self, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter);
static void _baobab_window_first_row_has_child_gtk_tree_model_row_has_child_toggled (GtkTreeModel* _sender, GtkTreePath* path, GtkTreeIter* iter, gpointer self);
static void baobab_window_expand_first_row (BaobabWindow* self);
static void baobab_window_set_chart_model (BaobabWindow* self, GtkTreeModel* model, gboolean show_allocated_size);
void baobab_chart_set_model_with_columns (BaobabChart* self, GtkTreeModel* m, guint name_column_, guint size_column_, guint info_column_, guint percentage_column_, guint valid_column_, GtkTreePath* r);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void __lambda10_ (Block5Data* _data5_);
void baobab_scanner_finish (BaobabScanner* self, GError** error);
GType baobab_scanner_state_get_type (void) G_GNUC_CONST;
GFile* baobab_scanner_get_directory (BaobabScanner* self);
void baobab_cell_renderer_size_set_show_allocated_size (BaobabCellRendererSize* self, gboolean value);
static void ___lambda10__baobab_scanner_completed (BaobabScanner* _sender, gpointer self);
void baobab_scanner_scan (BaobabScanner* self, gboolean force);
BaobabLocation* baobab_location_new_for_file (GFile* file_, BaobabScanFlags flags);
BaobabLocation* baobab_location_construct_for_file (GType object_type, GFile* file_, BaobabScanFlags flags);
GFileInfo* baobab_location_get_info (BaobabLocation* self);
static void baobab_window_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 const GActionEntry BAOBAB_WINDOW_action_entries[9] = {{"gear-menu", _baobab_window_on_show_gear_menu_activate_gsimple_action_activate_callback, NULL, "false", NULL}, {"show-home-page", _baobab_window_on_show_home_page_activate_gsimple_action_activate_callback}, {"scan-folder", _baobab_window_on_scan_folder_activate_gsimple_action_activate_callback}, {"reload", _baobab_window_on_reload_activate_gsimple_action_activate_callback}, {"show-allocated", _baobab_window_on_show_allocated_gsimple_action_activate_callback}, {"expand-all", _baobab_window_on_expand_all_gsimple_action_activate_callback}, {"collapse-all", _baobab_window_on_collapse_all_gsimple_action_activate_callback}, {"help", _baobab_window_on_help_activate_gsimple_action_activate_callback}, {"about", _baobab_window_on_about_activate_gsimple_action_activate_callback}};
static const BaobabWindowActionState BAOBAB_WINDOW_actions_while_scanning[4] = {{"scan-folder", FALSE}, {"show-allocated", FALSE}, {"expand-all", FALSE}, {"collapse-all", FALSE}};
static const GtkTargetEntry BAOBAB_WINDOW_dnd_target_list[1] = {{"text/uri-list", (guint) 0, (guint) BAOBAB_WINDOW_DND_TARGETS_URI_LIST}};

static GType baobab_window_dnd_targets_get_type (void) {
	static volatile gsize baobab_window_dnd_targets_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_window_dnd_targets_type_id__volatile)) {
		static const GEnumValue values[] = {{BAOBAB_WINDOW_DND_TARGETS_URI_LIST, "BAOBAB_WINDOW_DND_TARGETS_URI_LIST", "uri-list"}, {0, NULL, NULL}};
		GType baobab_window_dnd_targets_type_id;
		baobab_window_dnd_targets_type_id = g_enum_register_static ("BaobabWindowDndTargets", values);
		g_once_init_leave (&baobab_window_dnd_targets_type_id__volatile, baobab_window_dnd_targets_type_id);
	}
	return baobab_window_dnd_targets_type_id__volatile;
}


static void _baobab_window_on_show_gear_menu_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_show_gear_menu_activate ((BaobabWindow*) self, action);
}


static void _baobab_window_on_show_home_page_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_show_home_page_activate ((BaobabWindow*) self);
}


static void _baobab_window_on_scan_folder_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_scan_folder_activate ((BaobabWindow*) self);
}


static void _baobab_window_on_reload_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_reload_activate ((BaobabWindow*) self);
}


static void _baobab_window_on_show_allocated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_show_allocated ((BaobabWindow*) self);
}


static void _baobab_window_on_expand_all_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_expand_all ((BaobabWindow*) self);
}


static void _baobab_window_on_collapse_all_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_collapse_all ((BaobabWindow*) self);
}


static void _baobab_window_on_help_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_help_activate ((BaobabWindow*) self);
}


static void _baobab_window_on_about_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	baobab_window_on_about_activate ((BaobabWindow*) self);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		BaobabWindow* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->ui_settings);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static void _baobab_window_on_scan_location_activate_baobab_location_list_location_action (BaobabLocation* l, gpointer self) {
	baobab_window_on_scan_location_activate ((BaobabWindow*) self, l);
}


static void __lambda18_ (BaobabWindow* self) {
	baobab_window_clear_message (self);
}


static void ___lambda18__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda18_ ((BaobabWindow*) self);
}


static void __lambda19_ (BaobabWindow* self) {
	GtkStack* _tmp0_;
	_tmp0_ = self->priv->chart_stack;
	g_settings_unbind ((GObject*) _tmp0_, "visible-child-name");
}


static void ___lambda19__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda19_ ((BaobabWindow*) self);
}


static void _baobab_window_on_chart_item_activated_baobab_chart_item_activated (BaobabChart* _sender, GtkTreeIter* iter, gpointer self) {
	baobab_window_on_chart_item_activated ((BaobabWindow*) self, _sender, iter);
}


static void _baobab_window_on_drag_data_received_gtk_widget_drag_data_received (GtkWidget* _sender, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint info, guint time_, gpointer self) {
	baobab_window_on_drag_data_received ((BaobabWindow*) self, _sender, context, x, y, selection_data, info, time_);
}


static gboolean __lambda20_ (Block1Data* _data1_, GdkEventWindowState* event) {
	BaobabWindow* self;
	gboolean result = FALSE;
	GSettings* _tmp0_;
	GdkEventWindowState* _tmp1_;
	GdkWindowState _tmp2_;
	self = _data1_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = _data1_->ui_settings;
	_tmp1_ = event;
	_tmp2_ = _tmp1_->new_window_state;
	g_settings_set_int (_tmp0_, "window-state", (gint) _tmp2_);
	result = FALSE;
	return result;
}


static gboolean ___lambda20__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self) {
	gboolean result;
	result = __lambda20_ (self, event);
	return result;
}


static gboolean __lambda21_ (Block1Data* _data1_, GdkEventConfigure* event) {
	BaobabWindow* self;
	gboolean result = FALSE;
	GdkWindow* _tmp0_;
	GdkWindowState _tmp1_;
	self = _data1_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gtk_widget_get_window ((GtkWidget*) self);
	_tmp1_ = gdk_window_get_state (_tmp0_);
	if (!((_tmp1_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED)) {
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
		GSettings* _tmp4_;
		gtk_window_get_size ((GtkWindow*) self, &_tmp2_, &_tmp3_);
		_data1_->width = _tmp2_;
		_data1_->height = _tmp3_;
		_tmp4_ = _data1_->ui_settings;
		g_settings_set (_tmp4_, "window-size", "(ii)", _data1_->width, _data1_->height);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda21__gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self) {
	gboolean result;
	result = __lambda21_ (self, event);
	return result;
}


static void __lambda22_ (Block1Data* _data1_) {
	BaobabWindow* self;
	GSettings* _tmp0_;
	self = _data1_->self;
	_tmp0_ = _data1_->ui_settings;
	g_settings_apply (_tmp0_);
}


static void ___lambda22__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda22_ (self);
}


BaobabWindow* baobab_window_construct (GType object_type, BaobabApplication* app) {
	BaobabWindow * self = NULL;
	Block1Data* _data1_;
	BaobabApplication* _tmp0_;
	GdkCursor* _tmp1_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GAction* action = NULL;
	GSettings* _tmp6_;
	GAction* _tmp7_;
	GAction* _tmp8_;
	BaobabLocationList* _tmp9_;
	GtkButton* _tmp10_;
	GSettings* _tmp11_;
	GtkStack* _tmp12_;
	GtkStack* _tmp13_;
	BaobabChart* _tmp14_;
	BaobabChart* _tmp15_;
	GdkWindowState window_state = 0;
	GSettings* _tmp16_;
	gint _tmp17_;
	GdkWindowState _tmp18_;
	GSettings* _tmp19_;
	GtkWidget* _tmp20_;
	g_return_val_if_fail (app != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = app;
	self = (BaobabWindow*) g_object_new (object_type, "application", _tmp0_, NULL);
	_data1_->self = g_object_ref (self);
	_tmp1_ = baobab_window_busy_cursor;
	if (_tmp1_ == NULL) {
		GdkDisplay* _tmp2_;
		GdkCursor* _tmp3_;
		_tmp2_ = gtk_widget_get_display ((GtkWidget*) self);
		_tmp3_ = gdk_cursor_new_for_display (_tmp2_, GDK_WATCH);
		_g_object_unref0 (baobab_window_busy_cursor);
		baobab_window_busy_cursor = _tmp3_;
	}
	_tmp4_ = g_settings_new ("org.gnome.baobab.ui");
	_data1_->ui_settings = _tmp4_;
	_tmp5_ = _data1_->ui_settings;
	g_settings_delay (_tmp5_);
	g_action_map_add_action_entries ((GActionMap*) self, BAOBAB_WINDOW_action_entries, G_N_ELEMENTS (BAOBAB_WINDOW_action_entries), self);
	_tmp6_ = _data1_->ui_settings;
	_tmp7_ = g_settings_create_action (_tmp6_, "active-chart");
	action = _tmp7_;
	_tmp8_ = action;
	g_action_map_add_action ((GActionMap*) self, _tmp8_);
	_tmp9_ = self->priv->location_list;
	baobab_location_list_set_action (_tmp9_, _baobab_window_on_scan_location_activate_baobab_location_list_location_action, g_object_ref (self), g_object_unref);
	baobab_window_setup_treeview (self);
	_tmp10_ = self->priv->infobar_close_button;
	g_signal_connect_object (_tmp10_, "clicked", (GCallback) ___lambda18__gtk_button_clicked, self, 0);
	_tmp11_ = _data1_->ui_settings;
	_tmp12_ = self->priv->chart_stack;
	g_settings_bind (_tmp11_, "active-chart", (GObject*) _tmp12_, "visible-child-name", G_SETTINGS_BIND_DEFAULT);
	_tmp13_ = self->priv->chart_stack;
	g_signal_connect_object ((GtkWidget*) _tmp13_, "destroy", (GCallback) ___lambda19__gtk_widget_destroy, self, 0);
	_tmp14_ = self->priv->rings_chart;
	g_signal_connect_object (_tmp14_, "item-activated", (GCallback) _baobab_window_on_chart_item_activated_baobab_chart_item_activated, self, 0);
	_tmp15_ = self->priv->treemap_chart;
	g_signal_connect_object (_tmp15_, "item-activated", (GCallback) _baobab_window_on_chart_item_activated_baobab_chart_item_activated, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "drag-data-received", (GCallback) _baobab_window_on_drag_data_received_gtk_widget_drag_data_received, self, 0);
	baobab_window_enable_drop (self);
	_tmp16_ = _data1_->ui_settings;
	_tmp17_ = g_settings_get_int (_tmp16_, "window-state");
	window_state = (GdkWindowState) _tmp17_;
	_tmp18_ = window_state;
	if ((_tmp18_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED) {
		gtk_window_maximize ((GtkWindow*) self);
	}
	_tmp19_ = _data1_->ui_settings;
	g_settings_get (_tmp19_, "window-size", "(ii)", &_data1_->width, &_data1_->height);
	gtk_window_resize ((GtkWindow*) self, _data1_->width, _data1_->height);
	g_signal_connect_data ((GtkWidget*) self, "window-state-event", (GCallback) ___lambda20__gtk_widget_window_state_event, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) self, "configure-event", (GCallback) ___lambda21__gtk_widget_configure_event, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) self, "destroy", (GCallback) ___lambda22__gtk_widget_destroy, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_baobab_location_unref0 (self->priv->active_location);
	self->priv->active_location = NULL;
	self->priv->scan_completed_handler = (gulong) 0;
	_tmp20_ = self->priv->home_page;
	baobab_window_set_ui_state (self, _tmp20_, FALSE);
	gtk_widget_show ((GtkWidget*) self);
	_g_object_unref0 (action);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}


BaobabWindow* baobab_window_new (BaobabApplication* app) {
	return baobab_window_construct (BAOBAB_TYPE_WINDOW, app);
}


static void baobab_window_on_show_gear_menu_activate (BaobabWindow* self, GSimpleAction* action) {
	gboolean state = FALSE;
	GSimpleAction* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GSimpleAction* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = action;
	_tmp1_ = g_action_get_state ((GAction*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_get_boolean (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_variant_unref0 (_tmp2_);
	state = _tmp4_;
	_tmp5_ = action;
	_tmp6_ = g_variant_new_boolean (!state);
	g_variant_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	g_simple_action_set_state (_tmp5_, _tmp7_);
	_g_variant_unref0 (_tmp7_);
}


static void baobab_window_on_show_home_page_activate (BaobabWindow* self) {
	gboolean _tmp0_ = FALSE;
	BaobabLocation* _tmp1_;
	GtkWidget* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->active_location;
	if (_tmp1_ != NULL) {
		BaobabLocation* _tmp2_;
		BaobabScanner* _tmp3_;
		BaobabScanner* _tmp4_;
		_tmp2_ = self->priv->active_location;
		_tmp3_ = baobab_location_get_scanner (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		BaobabLocation* _tmp5_;
		BaobabScanner* _tmp6_;
		BaobabScanner* _tmp7_;
		_tmp5_ = self->priv->active_location;
		_tmp6_ = baobab_location_get_scanner (_tmp5_);
		_tmp7_ = _tmp6_;
		baobab_scanner_cancel (_tmp7_);
	}
	baobab_window_clear_message (self);
	_tmp8_ = self->priv->home_page;
	baobab_window_set_ui_state (self, _tmp8_, FALSE);
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		BaobabWindow* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->check_button);
		_g_object_unref0 (_data2_->file_chooser);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}


static void __lambda9_ (Block2Data* _data2_, gint response) {
	BaobabWindow* self;
	gint _tmp0_;
	self = _data2_->self;
	_tmp0_ = response;
	if (_tmp0_ == ((gint) GTK_RESPONSE_ACCEPT)) {
		BaobabScanFlags _tmp1_ = 0;
		gboolean _tmp2_;
		gboolean _tmp3_;
		BaobabScanFlags flags = 0;
		GFile* _tmp4_;
		GFile* _tmp5_;
		BaobabScanFlags _tmp6_;
		_tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _data2_->check_button);
		_tmp3_ = _tmp2_;
		if (_tmp3_) {
			_tmp1_ = BAOBAB_SCAN_FLAGS_NONE;
		} else {
			_tmp1_ = BAOBAB_SCAN_FLAGS_EXCLUDE_MOUNTS;
		}
		flags = _tmp1_;
		_tmp4_ = gtk_file_chooser_get_file ((GtkFileChooser*) _data2_->file_chooser);
		_tmp5_ = _tmp4_;
		_tmp6_ = flags;
		baobab_window_scan_directory (self, _tmp5_, _tmp6_);
		_g_object_unref0 (_tmp5_);
	}
	gtk_widget_destroy ((GtkWidget*) _data2_->file_chooser);
}


static void ___lambda9__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda9_ (self, response_id);
}


static void baobab_window_on_scan_folder_activate (BaobabWindow* self) {
	Block2Data* _data2_;
	GtkFileChooserDialog* _tmp0_;
	GtkCheckButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_ ("Select Folder"), (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _ ("_Cancel"), GTK_RESPONSE_CANCEL, _ ("_Open"), GTK_RESPONSE_ACCEPT, NULL);
	g_object_ref_sink (_tmp0_);
	_data2_->file_chooser = _tmp0_;
	gtk_file_chooser_set_local_only ((GtkFileChooser*) _data2_->file_chooser, FALSE);
	gtk_file_chooser_set_create_folders ((GtkFileChooser*) _data2_->file_chooser, FALSE);
	gtk_window_set_modal ((GtkWindow*) _data2_->file_chooser, TRUE);
	_tmp1_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Recursively analyze mount points"));
	g_object_ref_sink (_tmp1_);
	_data2_->check_button = _tmp1_;
	gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _data2_->file_chooser, (GtkWidget*) _data2_->check_button);
	g_signal_connect_data ((GtkDialog*) _data2_->file_chooser, "response", (GCallback) ___lambda9__gtk_dialog_response, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data2_->file_chooser);
	block2_data_unref (_data2_);
	_data2_ = NULL;
}


static gpointer _baobab_location_ref0 (gpointer self) {
	return self ? baobab_location_ref (self) : NULL;
}


static void baobab_window_set_active_location (BaobabWindow* self, BaobabLocation* location) {
	gulong _tmp0_;
	BaobabLocation* _tmp5_;
	BaobabLocation* _tmp6_;
	BaobabLocationList* _tmp7_;
	BaobabLocation* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (location != NULL);
	_tmp0_ = self->priv->scan_completed_handler;
	if (_tmp0_ > ((gulong) 0)) {
		BaobabLocation* _tmp1_;
		BaobabScanner* _tmp2_;
		BaobabScanner* _tmp3_;
		gulong _tmp4_;
		_tmp1_ = self->priv->active_location;
		_tmp2_ = baobab_location_get_scanner (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = self->priv->scan_completed_handler;
		g_signal_handler_disconnect ((GObject*) _tmp3_, _tmp4_);
		self->priv->scan_completed_handler = (gulong) 0;
	}
	_tmp5_ = location;
	_tmp6_ = _baobab_location_ref0 (_tmp5_);
	_baobab_location_unref0 (self->priv->active_location);
	self->priv->active_location = _tmp6_;
	_tmp7_ = self->priv->location_list;
	_tmp8_ = location;
	baobab_location_list_add_location (_tmp7_, _tmp8_);
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		BaobabWindow* self;
		self = _data3_->self;
		_baobab_location_unref0 (_data3_->location);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}


static void ___lambda11_ (Block3Data* _data3_, GObject* location_, GAsyncResult* res) {
	BaobabWindow* self;
	GError * _inner_error_ = NULL;
	self = _data3_->self;
	g_return_if_fail (res != NULL);
	{
		BaobabLocation* _tmp0_;
		GAsyncResult* _tmp1_;
		_tmp0_ = _data3_->location;
		_tmp1_ = res;
		baobab_location_mount_volume_finish (_tmp0_, _tmp1_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch6_g_error;
		}
		baobab_window_scan_active_location (self, FALSE);
	}
	goto __finally6;
	__catch6_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		baobab_window_message (self, _ ("Could not analyze volume."), _tmp3_, GTK_MESSAGE_ERROR);
		_g_error_free0 (e);
	}
	__finally6:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		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;
	}
}


static void ____lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	___lambda11_ (self, source_object, res);
	block3_data_unref (self);
}


static void baobab_window_on_scan_location_activate (BaobabWindow* self, BaobabLocation* location) {
	Block3Data* _data3_;
	BaobabLocation* _tmp0_;
	BaobabLocation* _tmp1_;
	BaobabLocation* _tmp2_;
	BaobabLocation* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (location != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = location;
	_tmp1_ = _baobab_location_ref0 (_tmp0_);
	_baobab_location_unref0 (_data3_->location);
	_data3_->location = _tmp1_;
	_tmp2_ = _data3_->location;
	baobab_window_set_active_location (self, _tmp2_);
	_tmp3_ = _data3_->location;
	_tmp4_ = baobab_location_get_is_volume (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		BaobabLocation* _tmp6_;
		_tmp6_ = _data3_->location;
		baobab_location_mount_volume (_tmp6_, ____lambda11__gasync_ready_callback, block3_data_ref (_data3_));
	} else {
		baobab_window_scan_active_location (self, FALSE);
	}
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


static void baobab_window_on_reload_activate (BaobabWindow* self) {
	BaobabLocation* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->active_location;
	if (_tmp0_ != NULL) {
		BaobabLocation* _tmp1_;
		BaobabScanner* _tmp2_;
		BaobabScanner* _tmp3_;
		_tmp1_ = self->priv->active_location;
		_tmp2_ = baobab_location_get_scanner (_tmp1_);
		_tmp3_ = _tmp2_;
		if (_tmp3_ != NULL) {
			BaobabLocation* _tmp4_;
			BaobabScanner* _tmp5_;
			BaobabScanner* _tmp6_;
			_tmp4_ = self->priv->active_location;
			_tmp5_ = baobab_location_get_scanner (_tmp4_);
			_tmp6_ = _tmp5_;
			baobab_scanner_cancel (_tmp6_);
		}
		baobab_window_scan_active_location (self, TRUE);
	}
}


static void baobab_window_on_show_allocated (BaobabWindow* self) {
	g_return_if_fail (self != NULL);
}


static void baobab_window_on_expand_all (BaobabWindow* self) {
	GtkTreeView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->treeview;
	gtk_tree_view_expand_all (_tmp0_);
}


static void baobab_window_on_collapse_all (BaobabWindow* self) {
	GtkTreeView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->treeview;
	gtk_tree_view_collapse_all (_tmp0_);
}


static void baobab_window_on_help_activate (BaobabWindow* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GdkScreen* _tmp0_;
		guint32 _tmp1_;
		_tmp0_ = gtk_window_get_screen ((GtkWindow*) self);
		_tmp1_ = gtk_get_current_event_time ();
		gtk_show_uri (_tmp0_, "help:baobab", _tmp1_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		baobab_window_message (self, _ ("Failed to show help"), _tmp3_, GTK_MESSAGE_WARNING);
		_g_error_free0 (e);
	}
	__finally7:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		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;
	}
}


static void baobab_window_on_about_activate (BaobabWindow* self) {
	static const gchar* authors[] = {"Ryan Lortie <desrt@desrt.ca>", "Fabio Marzocca <thesaltydog@gmail.com>", "Paolo Borelli <pborelli@gnome.com>", "Stefano Facchini <stefano.facchini@gmail.com>", "Benoît Dejean <benoit@placenet.org>", "Igalia (rings-chart and treemap widget) <www.igalia.com>", NULL};
	static const char copyright[] = "Copyright \xc2\xa9 2005-2011 Fabio Marzocca, Paolo Borelli, Benoît Dej" \
"ean, Igalia\n" "Copyright \xc2\xa9 2011-2012 Ryan Lortie, Paolo Borelli, Stefano Facch" \
"ini\n";
	g_return_if_fail (self != NULL);
	gtk_show_about_dialog ((GtkWindow*) self, "program-name", _ ("Baobab"), "logo-icon-name", "baobab", "version", VERSION, "comments", _ ("A graphical tool to analyze disk usage."), "copyright", copyright, "license-type", GTK_LICENSE_GPL_2_0, "wrap-license", FALSE, "authors", authors, "translator-credits", _ ("translator-credits"), NULL, NULL);
}


static void baobab_window_on_chart_item_activated (BaobabWindow* self, BaobabChart* chart, GtkTreeIter* iter) {
	GtkTreePath* path = NULL;
	BaobabLocation* _tmp0_;
	BaobabScanner* _tmp1_;
	BaobabScanner* _tmp2_;
	GtkTreeIter _tmp3_;
	GtkTreePath* _tmp4_;
	GtkTreeView* _tmp5_;
	GtkTreePath* _tmp6_;
	gboolean _tmp7_;
	GtkTreeView* _tmp10_;
	GtkTreePath* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (chart != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->active_location;
	_tmp1_ = baobab_location_get_scanner (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = *iter;
	_tmp4_ = gtk_tree_model_get_path ((GtkTreeModel*) _tmp2_, &_tmp3_);
	path = _tmp4_;
	_tmp5_ = self->priv->treeview;
	_tmp6_ = path;
	_tmp7_ = gtk_tree_view_row_expanded (_tmp5_, _tmp6_);
	if (!_tmp7_) {
		GtkTreeView* _tmp8_;
		GtkTreePath* _tmp9_;
		_tmp8_ = self->priv->treeview;
		_tmp9_ = path;
		gtk_tree_view_expand_to_path (_tmp8_, _tmp9_);
	}
	_tmp10_ = self->priv->treeview;
	_tmp11_ = path;
	gtk_tree_view_set_cursor (_tmp10_, _tmp11_, NULL, FALSE);
	_gtk_tree_path_free0 (path);
}


static void baobab_window_on_drag_data_received (BaobabWindow* self, GtkWidget* widget, GdkDragContext* context, gint x, gint y, GtkSelectionData* selection_data, guint target_type, guint time) {
	GFile* dir = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkSelectionData* _tmp2_;
	GFile* _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (context != NULL);
	g_return_if_fail (selection_data != NULL);
	dir = NULL;
	_tmp2_ = selection_data;
	if (_tmp2_ != NULL) {
		GtkSelectionData* _tmp3_;
		gint _tmp4_;
		_tmp3_ = selection_data;
		_tmp4_ = gtk_selection_data_get_length (_tmp3_);
		_tmp1_ = _tmp4_ >= 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		guint _tmp5_;
		_tmp5_ = target_type;
		_tmp0_ = _tmp5_ == ((guint) BAOBAB_WINDOW_DND_TARGETS_URI_LIST);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar** uris = NULL;
		GtkSelectionData* _tmp6_;
		guchar* _tmp7_;
		gchar** _tmp8_;
		gchar** _tmp9_;
		gint uris_length1;
		gint _uris_size_;
		gboolean _tmp10_ = FALSE;
		gchar** _tmp11_;
		gint _tmp11__length1;
		_tmp6_ = selection_data;
		_tmp7_ = gtk_selection_data_get_data (_tmp6_);
		_tmp9_ = _tmp8_ = g_uri_list_extract_uris ((const gchar*) _tmp7_);
		uris = _tmp9_;
		uris_length1 = _vala_array_length (_tmp8_);
		_uris_size_ = uris_length1;
		_tmp11_ = uris;
		_tmp11__length1 = uris_length1;
		if (_tmp11_ != NULL) {
			gchar** _tmp12_;
			gint _tmp12__length1;
			_tmp12_ = uris;
			_tmp12__length1 = uris_length1;
			_tmp10_ = _tmp12__length1 == 1;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			gchar** _tmp13_;
			gint _tmp13__length1;
			const gchar* _tmp14_;
			GFile* _tmp15_;
			_tmp13_ = uris;
			_tmp13__length1 = uris_length1;
			_tmp14_ = _tmp13_[0];
			_tmp15_ = g_file_new_for_uri (_tmp14_);
			_g_object_unref0 (dir);
			dir = _tmp15_;
		}
		uris = (_vala_array_free (uris, uris_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp16_ = dir;
	if (_tmp16_ != NULL) {
		GdkDragContext* _tmp17_;
		guint _tmp18_;
		GFile* _tmp19_;
		_tmp17_ = context;
		_tmp18_ = time;
		gtk_drag_finish (_tmp17_, TRUE, FALSE, (guint32) _tmp18_);
		_tmp19_ = dir;
		baobab_window_scan_directory (self, _tmp19_, BAOBAB_SCAN_FLAGS_NONE);
	} else {
		GdkDragContext* _tmp20_;
		guint _tmp21_;
		_tmp20_ = context;
		_tmp21_ = time;
		gtk_drag_finish (_tmp20_, FALSE, FALSE, (guint32) _tmp21_);
	}
	_g_object_unref0 (dir);
}


static void baobab_window_enable_drop (BaobabWindow* self) {
	g_return_if_fail (self != NULL);
	gtk_drag_dest_set ((GtkWidget*) self, (GTK_DEST_DEFAULT_DROP | GTK_DEST_DEFAULT_MOTION) | GTK_DEST_DEFAULT_HIGHLIGHT, BAOBAB_WINDOW_dnd_target_list, G_N_ELEMENTS (BAOBAB_WINDOW_dnd_target_list), GDK_ACTION_COPY);
}


static void baobab_window_disable_drop (BaobabWindow* self) {
	g_return_if_fail (self != NULL);
	gtk_drag_dest_unset ((GtkWidget*) self);
}


static gboolean baobab_window_show_treeview_popup (BaobabWindow* self, GtkMenu* popup, GdkEventButton* event) {
	gboolean result = FALSE;
	GdkEventButton* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (popup != NULL, FALSE);
	_tmp0_ = event;
	if (_tmp0_ != NULL) {
		GtkMenu* _tmp1_;
		GdkEventButton* _tmp2_;
		guint _tmp3_;
		GdkEventButton* _tmp4_;
		guint32 _tmp5_;
		_tmp1_ = popup;
		_tmp2_ = event;
		_tmp3_ = _tmp2_->button;
		_tmp4_ = event;
		_tmp5_ = _tmp4_->time;
		gtk_menu_popup (_tmp1_, NULL, NULL, NULL, NULL, _tmp3_, _tmp5_);
	} else {
		GtkMenu* _tmp6_;
		guint32 _tmp7_;
		GtkMenu* _tmp8_;
		_tmp6_ = popup;
		_tmp7_ = gtk_get_current_event_time ();
		gtk_menu_popup (_tmp6_, NULL, NULL, NULL, NULL, (guint) 0, _tmp7_);
		_tmp8_ = popup;
		gtk_menu_shell_select_first ((GtkMenuShell*) _tmp8_, FALSE);
	}
	result = TRUE;
	return result;
}


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


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


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


void baobab_window_open_item (BaobabWindow* self, GtkTreeIter* iter) {
	gchar* parse_name = NULL;
	BaobabLocation* _tmp0_;
	BaobabScanner* _tmp1_;
	BaobabScanner* _tmp2_;
	GtkTreeIter _tmp3_;
	GFile* file = NULL;
	const gchar* _tmp4_;
	GFile* _tmp5_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->active_location;
	_tmp1_ = baobab_location_get_scanner (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp2_, &_tmp3_, BAOBAB_SCANNER_COLUMNS_PARSE_NAME, &parse_name, -1);
	_tmp4_ = parse_name;
	_tmp5_ = g_file_parse_name (_tmp4_);
	file = _tmp5_;
	{
		GFileInfo* info = NULL;
		GFile* _tmp6_;
		GFileInfo* _tmp7_;
		gchar* content = NULL;
		GFileInfo* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		GAppInfo* appinfo = NULL;
		const gchar* _tmp11_;
		GAppInfo* _tmp12_;
		GdkAppLaunchContext* context = NULL;
		GdkDisplay* _tmp13_;
		GdkAppLaunchContext* _tmp14_;
		GdkAppLaunchContext* _tmp15_;
		guint32 _tmp16_;
		GList* files = NULL;
		GFile* _tmp17_;
		GFile* _tmp18_;
		GAppInfo* _tmp19_;
		GList* _tmp20_;
		GdkAppLaunchContext* _tmp21_;
		_tmp6_ = file;
		_tmp7_ = g_file_query_info (_tmp6_, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, NULL, &_inner_error_);
		info = _tmp7_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch8_g_error;
		}
		_tmp8_ = info;
		_tmp9_ = g_file_info_get_content_type (_tmp8_);
		_tmp10_ = g_strdup (_tmp9_);
		content = _tmp10_;
		_tmp11_ = content;
		_tmp12_ = g_app_info_get_default_for_type (_tmp11_, TRUE);
		appinfo = _tmp12_;
		_tmp13_ = gtk_widget_get_display ((GtkWidget*) self);
		_tmp14_ = gdk_display_get_app_launch_context (_tmp13_);
		context = _tmp14_;
		_tmp15_ = context;
		_tmp16_ = gtk_get_current_event_time ();
		gdk_app_launch_context_set_timestamp (_tmp15_, _tmp16_);
		files = NULL;
		_tmp17_ = file;
		_tmp18_ = _g_object_ref0 (_tmp17_);
		files = g_list_append (files, _tmp18_);
		_tmp19_ = appinfo;
		_tmp20_ = files;
		_tmp21_ = context;
		g_app_info_launch (_tmp19_, _tmp20_, (GAppLaunchContext*) _tmp21_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			__g_list_free__g_object_unref0_0 (files);
			_g_object_unref0 (context);
			_g_object_unref0 (appinfo);
			_g_free0 (content);
			_g_object_unref0 (info);
			goto __catch8_g_error;
		}
		__g_list_free__g_object_unref0_0 (files);
		_g_object_unref0 (context);
		_g_object_unref0 (appinfo);
		_g_free0 (content);
		_g_object_unref0 (info);
	}
	goto __finally8;
	__catch8_g_error:
	{
		GError* e = NULL;
		GError* _tmp22_;
		const gchar* _tmp23_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp22_ = e;
		_tmp23_ = _tmp22_->message;
		baobab_window_message (self, _ ("Failed to open file"), _tmp23_, GTK_MESSAGE_ERROR);
		_g_error_free0 (e);
	}
	__finally8:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (file);
		_g_free0 (parse_name);
		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;
	}
	_g_object_unref0 (file);
	_g_free0 (parse_name);
}


void baobab_window_copy_path (BaobabWindow* self, GtkTreeIter* iter) {
	gchar* parse_name = NULL;
	BaobabLocation* _tmp0_;
	BaobabScanner* _tmp1_;
	BaobabScanner* _tmp2_;
	GtkTreeIter _tmp3_;
	GtkClipboard* clipboard = NULL;
	GtkClipboard* _tmp4_;
	GtkClipboard* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->active_location;
	_tmp1_ = baobab_location_get_scanner (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp2_, &_tmp3_, BAOBAB_SCANNER_COLUMNS_PARSE_NAME, &parse_name, -1);
	_tmp4_ = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	clipboard = _tmp5_;
	gtk_clipboard_set_text (clipboard, parse_name, -1);
	gtk_clipboard_store (clipboard);
	_g_object_unref0 (clipboard);
	_g_free0 (parse_name);
}


void baobab_window_trash_file (BaobabWindow* self, GtkTreeIter* iter) {
	gchar* parse_name = NULL;
	BaobabLocation* _tmp0_;
	BaobabScanner* _tmp1_;
	BaobabScanner* _tmp2_;
	GtkTreeIter _tmp3_;
	GFile* file = NULL;
	GFile* _tmp4_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->active_location;
	_tmp1_ = baobab_location_get_scanner (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp2_, &_tmp3_, BAOBAB_SCANNER_COLUMNS_PARSE_NAME, &parse_name, -1);
	_tmp4_ = g_file_parse_name (parse_name);
	file = _tmp4_;
	{
		BaobabLocation* _tmp5_;
		BaobabScanner* _tmp6_;
		BaobabScanner* _tmp7_;
		g_file_trash (file, NULL, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch9_g_error;
		}
		_tmp5_ = self->priv->active_location;
		_tmp6_ = baobab_location_get_scanner (_tmp5_);
		_tmp7_ = _tmp6_;
		gtk_tree_store_remove ((GtkTreeStore*) _tmp7_, iter);
	}
	goto __finally9;
	__catch9_g_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		baobab_window_message (self, _ ("Failed to move file to the trash"), _tmp9_, GTK_MESSAGE_ERROR);
		_g_error_free0 (e);
	}
	__finally9:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (file);
		_g_free0 (parse_name);
		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;
	}
	_g_object_unref0 (file);
	_g_free0 (parse_name);
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}


static void block4_data_unref (void * _userdata_) {
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		BaobabWindow* self;
		self = _data4_->self;
		_g_object_unref0 (_data4_->selection);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}


static gboolean __lambda12_ (BaobabWindow* self, GdkEventButton* event) {
	gboolean result = FALSE;
	GdkEventButton* _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = event;
	_tmp1_ = gdk_event_triggers_context_menu ((GdkEvent*) _tmp0_);
	if (_tmp1_) {
		GtkTreePath* path = NULL;
		GtkTreeView* _tmp2_;
		GdkEventButton* _tmp3_;
		gdouble _tmp4_;
		GdkEventButton* _tmp5_;
		gdouble _tmp6_;
		GtkTreePath* _tmp7_ = NULL;
		gboolean _tmp8_;
		_tmp2_ = self->priv->treeview;
		_tmp3_ = event;
		_tmp4_ = _tmp3_->x;
		_tmp5_ = event;
		_tmp6_ = _tmp5_->y;
		_tmp8_ = gtk_tree_view_get_path_at_pos (_tmp2_, (gint) _tmp4_, (gint) _tmp6_, &_tmp7_, NULL, NULL, NULL);
		_gtk_tree_path_free0 (path);
		path = _tmp7_;
		if (_tmp8_) {
			GtkTreeView* _tmp9_;
			GtkTreeSelection* _tmp10_;
			GtkTreePath* _tmp11_;
			GtkMenu* _tmp12_;
			GdkEventButton* _tmp13_;
			gboolean _tmp14_;
			_tmp9_ = self->priv->treeview;
			_tmp10_ = gtk_tree_view_get_selection (_tmp9_);
			_tmp11_ = path;
			gtk_tree_selection_select_path (_tmp10_, _tmp11_);
			_tmp12_ = self->priv->treeview_popup_menu;
			_tmp13_ = event;
			_tmp14_ = baobab_window_show_treeview_popup (self, _tmp12_, _tmp13_);
			result = _tmp14_;
			_gtk_tree_path_free0 (path);
			return result;
		}
		_gtk_tree_path_free0 (path);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda12__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = __lambda12_ ((BaobabWindow*) self, event);
	return result;
}


static gboolean __lambda13_ (BaobabWindow* self) {
	gboolean result = FALSE;
	GtkMenu* _tmp0_;
	gboolean _tmp1_;
	_tmp0_ = self->priv->treeview_popup_menu;
	_tmp1_ = baobab_window_show_treeview_popup (self, _tmp0_, NULL);
	result = _tmp1_;
	return result;
}


static gboolean ___lambda13__gtk_widget_popup_menu (GtkWidget* _sender, gpointer self) {
	gboolean result;
	result = __lambda13_ ((BaobabWindow*) self);
	return result;
}


static void __lambda14_ (BaobabWindow* self) {
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	_tmp0_ = self->priv->treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	_tmp3_ = selection;
	_tmp5_ = gtk_tree_selection_get_selected (_tmp3_, NULL, &_tmp4_);
	iter = _tmp4_;
	if (_tmp5_) {
		GtkTreeIter _tmp6_;
		_tmp6_ = iter;
		baobab_window_open_item (self, &_tmp6_);
	}
	_g_object_unref0 (selection);
}


static void ___lambda14__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda14_ ((BaobabWindow*) self);
}


static void __lambda15_ (BaobabWindow* self) {
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	_tmp0_ = self->priv->treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	_tmp3_ = selection;
	_tmp5_ = gtk_tree_selection_get_selected (_tmp3_, NULL, &_tmp4_);
	iter = _tmp4_;
	if (_tmp5_) {
		GtkTreeIter _tmp6_;
		_tmp6_ = iter;
		baobab_window_copy_path (self, &_tmp6_);
	}
	_g_object_unref0 (selection);
}


static void ___lambda15__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda15_ ((BaobabWindow*) self);
}


static void __lambda16_ (BaobabWindow* self) {
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	_tmp0_ = self->priv->treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	_tmp3_ = selection;
	_tmp5_ = gtk_tree_selection_get_selected (_tmp3_, NULL, &_tmp4_);
	iter = _tmp4_;
	if (_tmp5_) {
		GtkTreeIter _tmp6_;
		_tmp6_ = iter;
		baobab_window_trash_file (self, &_tmp6_);
	}
	_g_object_unref0 (selection);
}


static void ___lambda16__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
	__lambda16_ ((BaobabWindow*) self);
}


static void __lambda17_ (Block4Data* _data4_) {
	BaobabWindow* self;
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp0_ = {0};
	gboolean _tmp1_;
	self = _data4_->self;
	_tmp1_ = gtk_tree_selection_get_selected (_data4_->selection, NULL, &_tmp0_);
	iter = _tmp0_;
	if (_tmp1_) {
		GtkTreePath* path = NULL;
		BaobabLocation* _tmp2_;
		BaobabScanner* _tmp3_;
		BaobabScanner* _tmp4_;
		GtkTreeIter _tmp5_;
		GtkTreePath* _tmp6_;
		BaobabChart* _tmp7_;
		GtkTreePath* _tmp8_;
		BaobabChart* _tmp9_;
		GtkTreePath* _tmp10_;
		_tmp2_ = self->priv->active_location;
		_tmp3_ = baobab_location_get_scanner (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = iter;
		_tmp6_ = gtk_tree_model_get_path ((GtkTreeModel*) _tmp4_, &_tmp5_);
		path = _tmp6_;
		_tmp7_ = self->priv->rings_chart;
		_tmp8_ = path;
		baobab_chart_set_root (_tmp7_, _tmp8_);
		_tmp9_ = self->priv->treemap_chart;
		_tmp10_ = path;
		baobab_chart_set_root (_tmp9_, _tmp10_);
		_gtk_tree_path_free0 (path);
	}
}


static void ___lambda17__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
	__lambda17_ (self);
}


static void baobab_window_setup_treeview (BaobabWindow* self) {
	Block4Data* _data4_;
	GtkTreeView* _tmp0_;
	GtkTreeView* _tmp1_;
	GtkMenuItem* _tmp2_;
	GtkMenuItem* _tmp3_;
	GtkMenuItem* _tmp4_;
	GtkTreeView* _tmp5_;
	GtkTreeSelection* _tmp6_;
	GtkTreeSelection* _tmp7_;
	g_return_if_fail (self != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = self->priv->treeview;
	g_signal_connect_object ((GtkWidget*) _tmp0_, "button-press-event", (GCallback) ___lambda12__gtk_widget_button_press_event, self, 0);
	_tmp1_ = self->priv->treeview;
	g_signal_connect_object ((GtkWidget*) _tmp1_, "popup-menu", (GCallback) ___lambda13__gtk_widget_popup_menu, self, 0);
	_tmp2_ = self->priv->treeview_popup_open;
	g_signal_connect_object (_tmp2_, "activate", (GCallback) ___lambda14__gtk_menu_item_activate, self, 0);
	_tmp3_ = self->priv->treeview_popup_copy;
	g_signal_connect_object (_tmp3_, "activate", (GCallback) ___lambda15__gtk_menu_item_activate, self, 0);
	_tmp4_ = self->priv->treeview_popup_trash;
	g_signal_connect_object (_tmp4_, "activate", (GCallback) ___lambda16__gtk_menu_item_activate, self, 0);
	_tmp5_ = self->priv->treeview;
	_tmp6_ = gtk_tree_view_get_selection (_tmp5_);
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_data4_->selection = _tmp7_;
	g_signal_connect_data (_data4_->selection, "changed", (GCallback) ___lambda17__gtk_tree_selection_changed, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}


static void baobab_window_message (BaobabWindow* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType type) {
	GtkInfoBar* _tmp0_;
	GtkMessageType _tmp1_;
	GtkLabel* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GtkLabel* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkInfoBar* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (primary_msg != NULL);
	g_return_if_fail (secondary_msg != NULL);
	_tmp0_ = self->priv->infobar;
	_tmp1_ = type;
	gtk_info_bar_set_message_type (_tmp0_, _tmp1_);
	_tmp2_ = self->priv->infobar_primary_label;
	_tmp3_ = primary_msg;
	_tmp4_ = g_strdup_printf ("<b>%s</b>", _tmp3_);
	_tmp5_ = _tmp4_;
	gtk_label_set_label (_tmp2_, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = self->priv->infobar_secondary_label;
	_tmp7_ = secondary_msg;
	_tmp8_ = g_strdup_printf ("<small>%s</small>", _tmp7_);
	_tmp9_ = _tmp8_;
	gtk_label_set_label (_tmp6_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = self->priv->infobar;
	gtk_widget_show ((GtkWidget*) _tmp10_);
}


static void baobab_window_clear_message (BaobabWindow* self) {
	GtkInfoBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->infobar;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}


static void baobab_window_set_busy (BaobabWindow* self, gboolean busy) {
	GdkCursor* cursor = NULL;
	gboolean _tmp0_;
	GdkWindow* window = NULL;
	GdkWindow* _tmp11_;
	GdkWindow* _tmp12_;
	GdkWindow* _tmp13_;
	g_return_if_fail (self != NULL);
	cursor = NULL;
	_tmp0_ = busy;
	if (_tmp0_) {
		GdkCursor* _tmp1_;
		GdkCursor* _tmp2_;
		GtkStackSwitcher* _tmp3_;
		GtkStack* _tmp4_;
		GtkSpinner* _tmp5_;
		GtkSpinner* _tmp6_;
		_tmp1_ = baobab_window_busy_cursor;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		_g_object_unref0 (cursor);
		cursor = _tmp2_;
		baobab_window_disable_drop (self);
		_tmp3_ = self->priv->chart_stack_switcher;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
		_tmp4_ = self->priv->spinner_stack;
		_tmp5_ = self->priv->spinner;
		gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->spinner;
		gtk_spinner_start (_tmp6_);
	} else {
		GtkSpinner* _tmp7_;
		GtkStack* _tmp8_;
		GtkStack* _tmp9_;
		GtkStackSwitcher* _tmp10_;
		baobab_window_enable_drop (self);
		_tmp7_ = self->priv->spinner;
		gtk_spinner_stop (_tmp7_);
		_tmp8_ = self->priv->spinner_stack;
		_tmp9_ = self->priv->chart_stack;
		gtk_stack_set_visible_child (_tmp8_, (GtkWidget*) _tmp9_);
		_tmp10_ = self->priv->chart_stack_switcher;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp10_, TRUE);
	}
	_tmp11_ = gtk_widget_get_window ((GtkWidget*) self);
	_tmp12_ = _g_object_ref0 (_tmp11_);
	window = _tmp12_;
	_tmp13_ = window;
	if (_tmp13_ != NULL) {
		GdkWindow* _tmp14_;
		GdkCursor* _tmp15_;
		_tmp14_ = window;
		_tmp15_ = cursor;
		gdk_window_set_cursor (_tmp14_, _tmp15_);
	}
	{
		BaobabWindowActionState* action_state_collection = NULL;
		gint action_state_collection_length1 = 0;
		gint _action_state_collection_size_ = 0;
		gint action_state_it = 0;
		action_state_collection = BAOBAB_WINDOW_actions_while_scanning;
		action_state_collection_length1 = G_N_ELEMENTS (BAOBAB_WINDOW_actions_while_scanning);
		for (action_state_it = 0; action_state_it < G_N_ELEMENTS (BAOBAB_WINDOW_actions_while_scanning); action_state_it = action_state_it + 1) {
			BaobabWindowActionState _tmp16_ = {0};
			BaobabWindowActionState action_state = {0};
			baobab_window_action_state_copy (&action_state_collection[action_state_it], &_tmp16_);
			action_state = _tmp16_;
			{
				GSimpleAction* action = NULL;
				BaobabWindowActionState _tmp17_;
				const gchar* _tmp18_;
				GAction* _tmp19_;
				GSimpleAction* _tmp20_;
				GSimpleAction* _tmp21_;
				gboolean _tmp22_;
				BaobabWindowActionState _tmp23_;
				gboolean _tmp24_;
				_tmp17_ = action_state;
				_tmp18_ = _tmp17_.name;
				_tmp19_ = g_action_map_lookup_action ((GActionMap*) self, _tmp18_);
				_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp19_) : NULL);
				action = _tmp20_;
				_tmp21_ = action;
				_tmp22_ = busy;
				_tmp23_ = action_state;
				_tmp24_ = _tmp23_.enable;
				g_simple_action_set_enabled (_tmp21_, _tmp22_ == _tmp24_);
				_g_object_unref0 (action);
				baobab_window_action_state_destroy (&action_state);
			}
		}
	}
	_g_object_unref0 (window);
	_g_object_unref0 (cursor);
}


static void baobab_window_set_ui_state (BaobabWindow* self, GtkWidget* child, gboolean busy) {
	GtkMenuButton* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkButton* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GtkButton* _tmp6_;
	GtkWidget* _tmp7_;
	GtkWidget* _tmp8_;
	gboolean _tmp9_;
	GtkWidget* _tmp10_;
	GtkWidget* _tmp11_;
	GtkStack* _tmp23_;
	GtkWidget* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (child != NULL);
	_tmp0_ = self->priv->menu_button;
	_tmp1_ = child;
	_tmp2_ = self->priv->home_page;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, _tmp1_ == _tmp2_);
	_tmp3_ = self->priv->reload_button;
	_tmp4_ = child;
	_tmp5_ = self->priv->result_page;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, _tmp4_ == _tmp5_);
	_tmp6_ = self->priv->back_button;
	_tmp7_ = child;
	_tmp8_ = self->priv->result_page;
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, _tmp7_ == _tmp8_);
	_tmp9_ = busy;
	baobab_window_set_busy (self, _tmp9_);
	_tmp10_ = child;
	_tmp11_ = self->priv->home_page;
	if (_tmp10_ == _tmp11_) {
		GSimpleAction* action = NULL;
		GAction* _tmp12_;
		GSimpleAction* _tmp13_;
		GSimpleAction* _tmp14_;
		GtkHeaderBar* _tmp15_;
		_tmp12_ = g_action_map_lookup_action ((GActionMap*) self, "reload");
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp12_) : NULL);
		action = _tmp13_;
		_tmp14_ = action;
		g_simple_action_set_enabled (_tmp14_, FALSE);
		_tmp15_ = self->priv->header_bar;
		gtk_header_bar_set_title (_tmp15_, _ ("Devices & Locations"));
		_g_object_unref0 (action);
	} else {
		GSimpleAction* action = NULL;
		GAction* _tmp16_;
		GSimpleAction* _tmp17_;
		GSimpleAction* _tmp18_;
		GtkHeaderBar* _tmp19_;
		BaobabLocation* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		_tmp16_ = g_action_map_lookup_action ((GActionMap*) self, "reload");
		_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp16_) : NULL);
		action = _tmp17_;
		_tmp18_ = action;
		g_simple_action_set_enabled (_tmp18_, TRUE);
		_tmp19_ = self->priv->header_bar;
		_tmp20_ = self->priv->active_location;
		_tmp21_ = baobab_location_get_name (_tmp20_);
		_tmp22_ = _tmp21_;
		gtk_header_bar_set_title (_tmp19_, _tmp22_);
		_g_object_unref0 (action);
	}
	_tmp23_ = self->priv->main_stack;
	_tmp24_ = child;
	gtk_stack_set_visible_child (_tmp23_, _tmp24_);
}


static void _baobab_window_first_row_has_child_gtk_tree_model_row_has_child_toggled (GtkTreeModel* _sender, GtkTreePath* path, GtkTreeIter* iter, gpointer self) {
	baobab_window_first_row_has_child ((BaobabWindow*) self, _sender, path, iter);
}


static void baobab_window_first_row_has_child (BaobabWindow* self, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter) {
	GtkTreeModel* _tmp0_;
	guint _tmp1_;
	GtkTreeView* _tmp2_;
	GtkTreePath* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = model;
	g_signal_parse_name ("row-has-child-toggled", GTK_TYPE_TREE_MODEL, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _baobab_window_first_row_has_child_gtk_tree_model_row_has_child_toggled, self);
	_tmp2_ = self->priv->treeview;
	_tmp3_ = path;
	gtk_tree_view_expand_row (_tmp2_, _tmp3_, FALSE);
}


static void baobab_window_expand_first_row (BaobabWindow* self) {
	GtkTreeIter first = {0};
	gboolean _tmp0_ = FALSE;
	GtkTreeView* _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkTreeModel* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->treeview;
	_tmp2_ = gtk_tree_view_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp5_ = gtk_tree_model_get_iter_first (_tmp3_, &_tmp4_);
	first = _tmp4_;
	if (_tmp5_) {
		GtkTreeView* _tmp6_;
		GtkTreeModel* _tmp7_;
		GtkTreeModel* _tmp8_;
		GtkTreeIter _tmp9_;
		gboolean _tmp10_;
		_tmp6_ = self->priv->treeview;
		_tmp7_ = gtk_tree_view_get_model (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = first;
		_tmp10_ = gtk_tree_model_iter_has_child (_tmp8_, &_tmp9_);
		_tmp0_ = _tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkTreeView* _tmp11_;
		GtkTreeView* _tmp12_;
		GtkTreeModel* _tmp13_;
		GtkTreeModel* _tmp14_;
		GtkTreeIter _tmp15_;
		GtkTreePath* _tmp16_;
		GtkTreePath* _tmp17_;
		_tmp11_ = self->priv->treeview;
		_tmp12_ = self->priv->treeview;
		_tmp13_ = gtk_tree_view_get_model (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = first;
		_tmp16_ = gtk_tree_model_get_path (_tmp14_, &_tmp15_);
		_tmp17_ = _tmp16_;
		gtk_tree_view_expand_row (_tmp11_, _tmp17_, FALSE);
		_gtk_tree_path_free0 (_tmp17_);
	} else {
		GtkTreeView* _tmp18_;
		GtkTreeModel* _tmp19_;
		GtkTreeModel* _tmp20_;
		_tmp18_ = self->priv->treeview;
		_tmp19_ = gtk_tree_view_get_model (_tmp18_);
		_tmp20_ = _tmp19_;
		g_signal_connect_object (_tmp20_, "row-has-child-toggled", (GCallback) _baobab_window_first_row_has_child_gtk_tree_model_row_has_child_toggled, self, 0);
	}
}


static void baobab_window_set_chart_model (BaobabWindow* self, GtkTreeModel* model, gboolean show_allocated_size) {
	GtkTreeModel* _tmp0_;
	BaobabChart* _tmp1_;
	GtkTreeModel* _tmp2_;
	BaobabChart* _tmp3_;
	BaobabScannerColumns _tmp4_ = 0;
	gboolean _tmp5_;
	BaobabChart* _tmp6_;
	GtkTreeModel* _tmp7_;
	BaobabScannerColumns _tmp8_ = 0;
	gboolean _tmp9_;
	BaobabChart* _tmp10_;
	GtkTreeModel* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	_tmp0_ = model;
	_tmp1_ = self->priv->rings_chart;
	g_object_bind_property_with_closures ((GObject*) _tmp0_, "max-depth", (GObject*) _tmp1_, "max-depth", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp2_ = model;
	_tmp3_ = self->priv->treemap_chart;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "max-depth", (GObject*) _tmp3_, "max-depth", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp5_ = show_allocated_size;
	if (_tmp5_) {
		_tmp4_ = BAOBAB_SCANNER_COLUMNS_ALLOC_SIZE;
	} else {
		_tmp4_ = BAOBAB_SCANNER_COLUMNS_SIZE;
	}
	_tmp6_ = self->priv->treemap_chart;
	_tmp7_ = model;
	baobab_chart_set_model_with_columns (_tmp6_, _tmp7_, (guint) BAOBAB_SCANNER_COLUMNS_DISPLAY_NAME, (guint) _tmp4_, (guint) BAOBAB_SCANNER_COLUMNS_PARSE_NAME, (guint) BAOBAB_SCANNER_COLUMNS_PERCENT, (guint) BAOBAB_SCANNER_COLUMNS_ELEMENTS, NULL);
	_tmp9_ = show_allocated_size;
	if (_tmp9_) {
		_tmp8_ = BAOBAB_SCANNER_COLUMNS_ALLOC_SIZE;
	} else {
		_tmp8_ = BAOBAB_SCANNER_COLUMNS_SIZE;
	}
	_tmp10_ = self->priv->rings_chart;
	_tmp11_ = model;
	baobab_chart_set_model_with_columns (_tmp10_, _tmp11_, (guint) BAOBAB_SCANNER_COLUMNS_DISPLAY_NAME, (guint) _tmp8_, (guint) BAOBAB_SCANNER_COLUMNS_PARSE_NAME, (guint) BAOBAB_SCANNER_COLUMNS_PERCENT, (guint) BAOBAB_SCANNER_COLUMNS_ELEMENTS, NULL);
}


static Block5Data* block5_data_ref (Block5Data* _data5_) {
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}


static void block5_data_unref (void * _userdata_) {
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		BaobabWindow* self;
		self = _data5_->self;
		_g_object_unref0 (_data5_->scanner);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}


static void __lambda10_ (Block5Data* _data5_) {
	BaobabWindow* self;
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp23_ = {0};
	guint64 alloc_size = 0ULL;
	GtkTreeIter _tmp24_;
	gboolean show_allocated_size = FALSE;
	guint64 _tmp25_;
	BaobabCellRendererSize* _tmp26_;
	gboolean _tmp27_;
	BaobabScannerColumns _tmp28_ = 0;
	gboolean _tmp29_;
	GtkTreeViewColumn* _tmp30_;
	BaobabLocation* _tmp31_;
	BaobabScanner* _tmp32_;
	BaobabScanner* _tmp33_;
	gboolean _tmp34_;
	GtkWidget* _tmp35_;
	gboolean _tmp36_;
	GError * _inner_error_ = NULL;
	self = _data5_->self;
	{
		baobab_scanner_finish (_data5_->scanner, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (g_error_matches (_inner_error_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch10_g_io_error_cancelled;
			}
			goto __catch10_g_error;
		}
	}
	goto __finally10;
	__catch10_g_io_error_cancelled:
	{
		GError* e = NULL;
		gulong _tmp0_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp0_ = self->priv->scan_completed_handler;
		if (_tmp0_ > ((gulong) 0)) {
			gulong _tmp1_;
			_tmp1_ = self->priv->scan_completed_handler;
			g_signal_handler_disconnect ((GObject*) _data5_->scanner, _tmp1_);
			self->priv->scan_completed_handler = (gulong) 0;
		}
		_g_error_free0 (e);
		return;
	}
	goto __finally10;
	__catch10_g_error:
	{
		GError* e = NULL;
		GtkTreeIter iter = {0};
		BaobabScannerState state = 0;
		GtkTreeIter _tmp2_ = {0};
		GtkTreeIter _tmp3_;
		BaobabScannerState _tmp4_;
		e = _inner_error_;
		_inner_error_ = NULL;
		gtk_tree_model_get_iter_first ((GtkTreeModel*) _data5_->scanner, &_tmp2_);
		iter = _tmp2_;
		_tmp3_ = iter;
		gtk_tree_model_get ((GtkTreeModel*) _data5_->scanner, &_tmp3_, BAOBAB_SCANNER_COLUMNS_STATE, &state, -1);
		_tmp4_ = state;
		if (_tmp4_ == BAOBAB_SCANNER_STATE_ERROR) {
			gchar* primary = NULL;
			GFile* _tmp5_;
			GFile* _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			const gchar* _tmp11_;
			GError* _tmp12_;
			const gchar* _tmp13_;
			_tmp5_ = baobab_scanner_get_directory (_data5_->scanner);
			_tmp6_ = _tmp5_;
			_tmp7_ = g_file_get_parse_name (_tmp6_);
			_tmp8_ = _tmp7_;
			_tmp9_ = g_strdup_printf (_ ("Could not scan folder “%s”"), _tmp8_);
			_tmp10_ = _tmp9_;
			_g_free0 (_tmp8_);
			primary = _tmp10_;
			_tmp11_ = primary;
			_tmp12_ = e;
			_tmp13_ = _tmp12_->message;
			baobab_window_message (self, _tmp11_, _tmp13_, GTK_MESSAGE_ERROR);
			_g_free0 (primary);
		} else {
			gchar* primary = NULL;
			GFile* _tmp14_;
			GFile* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			const gchar* _tmp20_;
			GError* _tmp21_;
			const gchar* _tmp22_;
			_tmp14_ = baobab_scanner_get_directory (_data5_->scanner);
			_tmp15_ = _tmp14_;
			_tmp16_ = g_file_get_parse_name (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_strdup_printf (_ ("Could not scan some of the folders contained in “%s”"), _tmp17_);
			_tmp19_ = _tmp18_;
			_g_free0 (_tmp17_);
			primary = _tmp19_;
			_tmp20_ = primary;
			_tmp21_ = e;
			_tmp22_ = _tmp21_->message;
			baobab_window_message (self, _tmp20_, _tmp22_, GTK_MESSAGE_WARNING);
			_g_free0 (primary);
		}
		_g_error_free0 (e);
	}
	__finally10:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		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;
	}
	gtk_tree_model_get_iter_first ((GtkTreeModel*) _data5_->scanner, &_tmp23_);
	iter = _tmp23_;
	_tmp24_ = iter;
	gtk_tree_model_get ((GtkTreeModel*) _data5_->scanner, &_tmp24_, BAOBAB_SCANNER_COLUMNS_ALLOC_SIZE, &alloc_size, -1, -1);
	_tmp25_ = alloc_size;
	show_allocated_size = _tmp25_ > ((guint64) 0);
	_tmp26_ = self->priv->size_column_size_renderer;
	_tmp27_ = show_allocated_size;
	baobab_cell_renderer_size_set_show_allocated_size (_tmp26_, _tmp27_);
	_tmp29_ = show_allocated_size;
	if (_tmp29_) {
		_tmp28_ = BAOBAB_SCANNER_COLUMNS_ALLOC_SIZE;
	} else {
		_tmp28_ = BAOBAB_SCANNER_COLUMNS_SIZE;
	}
	_tmp30_ = self->priv->size_column;
	gtk_tree_view_column_set_sort_column_id (_tmp30_, (gint) _tmp28_);
	_tmp31_ = self->priv->active_location;
	_tmp32_ = baobab_location_get_scanner (_tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = show_allocated_size;
	baobab_window_set_chart_model (self, (GtkTreeModel*) _tmp33_, _tmp34_);
	_tmp35_ = self->priv->result_page;
	baobab_window_set_ui_state (self, _tmp35_, FALSE);
	_tmp36_ = show_allocated_size;
	if (!_tmp36_) {
		baobab_window_message (self, _ ("Could not detect occupied disk sizes."), _ ("Apparent sizes are shown instead."), GTK_MESSAGE_INFO);
	}
}


static void ___lambda10__baobab_scanner_completed (BaobabScanner* _sender, gpointer self) {
	__lambda10_ (self);
}


static void baobab_window_scan_active_location (BaobabWindow* self, gboolean force) {
	Block5Data* _data5_;
	BaobabLocation* _tmp0_;
	BaobabScanner* _tmp1_;
	BaobabScanner* _tmp2_;
	BaobabScanner* _tmp3_;
	gulong _tmp4_;
	GtkWidget* _tmp5_;
	gboolean _tmp6_;
	GtkTreeView* _tmp7_;
	g_return_if_fail (self != NULL);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp0_ = self->priv->active_location;
	_tmp1_ = baobab_location_get_scanner (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data5_->scanner = _tmp3_;
	_tmp4_ = g_signal_connect_data (_data5_->scanner, "completed", (GCallback) ___lambda10__baobab_scanner_completed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	self->priv->scan_completed_handler = _tmp4_;
	baobab_window_clear_message (self);
	_tmp5_ = self->priv->result_page;
	baobab_window_set_ui_state (self, _tmp5_, TRUE);
	_tmp6_ = force;
	baobab_scanner_scan (_data5_->scanner, _tmp6_);
	_tmp7_ = self->priv->treeview;
	gtk_tree_view_set_model (_tmp7_, (GtkTreeModel*) _data5_->scanner);
	baobab_window_expand_first_row (self);
	block5_data_unref (_data5_);
	_data5_ = NULL;
}


void baobab_window_scan_directory (BaobabWindow* self, GFile* directory, BaobabScanFlags flags) {
	BaobabLocation* location = NULL;
	GFile* _tmp0_;
	BaobabScanFlags _tmp1_;
	BaobabLocation* _tmp2_;
	BaobabLocation* _tmp3_;
	GFileInfo* _tmp4_;
	GFileInfo* _tmp5_;
	BaobabLocation* _tmp12_;
	GFileInfo* _tmp13_;
	GFileInfo* _tmp14_;
	GFileType _tmp15_;
	BaobabLocation* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (directory != NULL);
	_tmp0_ = directory;
	_tmp1_ = flags;
	_tmp2_ = baobab_location_new_for_file (_tmp0_, _tmp1_);
	location = _tmp2_;
	_tmp3_ = location;
	_tmp4_ = baobab_location_get_info (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == NULL) {
		gchar* primary = NULL;
		GFile* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		_tmp6_ = directory;
		_tmp7_ = g_file_get_parse_name (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup_printf (_ ("“%s” is not a valid folder"), _tmp8_);
		_tmp10_ = _tmp9_;
		_g_free0 (_tmp8_);
		primary = _tmp10_;
		_tmp11_ = primary;
		baobab_window_message (self, _tmp11_, _ ("Could not analyze disk usage."), GTK_MESSAGE_ERROR);
		_g_free0 (primary);
		_baobab_location_unref0 (location);
		return;
	}
	_tmp12_ = location;
	_tmp13_ = baobab_location_get_info (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_file_info_get_file_type (_tmp14_);
	if (_tmp15_ != G_FILE_TYPE_DIRECTORY) {
		gchar* primary = NULL;
		GFile* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		const gchar* _tmp21_;
		_tmp16_ = directory;
		_tmp17_ = g_file_get_parse_name (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = g_strdup_printf (_ ("“%s” is not a valid folder"), _tmp18_);
		_tmp20_ = _tmp19_;
		_g_free0 (_tmp18_);
		primary = _tmp20_;
		_tmp21_ = primary;
		baobab_window_message (self, _tmp21_, _ ("Could not analyze disk usage."), GTK_MESSAGE_ERROR);
		_g_free0 (primary);
		_baobab_location_unref0 (location);
		return;
	}
	_tmp22_ = location;
	baobab_window_set_active_location (self, _tmp22_);
	baobab_window_scan_active_location (self, FALSE);
	_baobab_location_unref0 (location);
}


void baobab_window_action_state_copy (const BaobabWindowActionState* self, BaobabWindowActionState* dest) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	_tmp2_ = (*self).enable;
	(*dest).enable = _tmp2_;
}


void baobab_window_action_state_destroy (BaobabWindowActionState* self) {
	_g_free0 ((*self).name);
}


BaobabWindowActionState* baobab_window_action_state_dup (const BaobabWindowActionState* self) {
	BaobabWindowActionState* dup;
	dup = g_new0 (BaobabWindowActionState, 1);
	baobab_window_action_state_copy (self, dup);
	return dup;
}


void baobab_window_action_state_free (BaobabWindowActionState* self) {
	baobab_window_action_state_destroy (self);
	g_free (self);
}


GType baobab_window_action_state_get_type (void) {
	static volatile gsize baobab_window_action_state_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_window_action_state_type_id__volatile)) {
		GType baobab_window_action_state_type_id;
		baobab_window_action_state_type_id = g_boxed_type_register_static ("BaobabWindowActionState", (GBoxedCopyFunc) baobab_window_action_state_dup, (GBoxedFreeFunc) baobab_window_action_state_free);
		g_once_init_leave (&baobab_window_action_state_type_id__volatile, baobab_window_action_state_type_id);
	}
	return baobab_window_action_state_type_id__volatile;
}


static void baobab_window_class_init (BaobabWindowClass * klass) {
	gint BaobabWindow_private_offset;
	baobab_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BaobabWindowPrivate));
	G_OBJECT_CLASS (klass)->finalize = baobab_window_finalize;
	BaobabWindow_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/baobab/ui/baobab-main-window.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_bar", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "back_button", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, back_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reload_button", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, reload_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "menu_button", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, menu_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "main_stack", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, main_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "home_page", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, home_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "result_page", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, result_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "infobar", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, infobar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "infobar_primary_label", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, infobar_primary_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "infobar_secondary_label", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, infobar_secondary_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "infobar_close_button", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, infobar_close_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "location_list", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, location_list));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "treeview", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, treeview));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "size_column", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, size_column));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "size_column_size_renderer", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, size_column_size_renderer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "treeview_popup_menu", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, treeview_popup_menu));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "treeview_popup_open", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, treeview_popup_open));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "treeview_popup_copy", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, treeview_popup_copy));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "treeview_popup_trash", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, treeview_popup_trash));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "chart_stack", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, chart_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spinner_stack", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, spinner_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "chart_stack_switcher", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, chart_stack_switcher));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "rings_chart", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, rings_chart));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "treemap_chart", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, treemap_chart));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spinner", FALSE, BaobabWindow_private_offset + G_STRUCT_OFFSET (BaobabWindowPrivate, spinner));
}


static void baobab_window_instance_init (BaobabWindow * self) {
	self->priv = BAOBAB_WINDOW_GET_PRIVATE (self);
	g_type_ensure (BAOBAB_TYPE_LOCATION_LIST);
	g_type_ensure (BAOBAB_TYPE_CELL_RENDERER_SIZE);
	g_type_ensure (BAOBAB_TYPE_CHART);
	g_type_ensure (BAOBAB_TYPE_CHART);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void baobab_window_finalize (GObject * obj) {
	BaobabWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BAOBAB_TYPE_WINDOW, BaobabWindow);
	_g_object_unref0 (self->priv->header_bar);
	_g_object_unref0 (self->priv->back_button);
	_g_object_unref0 (self->priv->reload_button);
	_g_object_unref0 (self->priv->menu_button);
	_g_object_unref0 (self->priv->main_stack);
	_g_object_unref0 (self->priv->home_page);
	_g_object_unref0 (self->priv->result_page);
	_g_object_unref0 (self->priv->infobar);
	_g_object_unref0 (self->priv->infobar_primary_label);
	_g_object_unref0 (self->priv->infobar_secondary_label);
	_g_object_unref0 (self->priv->infobar_close_button);
	_g_object_unref0 (self->priv->location_list);
	_g_object_unref0 (self->priv->treeview);
	_g_object_unref0 (self->priv->size_column);
	_g_object_unref0 (self->priv->size_column_size_renderer);
	_g_object_unref0 (self->priv->treeview_popup_menu);
	_g_object_unref0 (self->priv->treeview_popup_open);
	_g_object_unref0 (self->priv->treeview_popup_copy);
	_g_object_unref0 (self->priv->treeview_popup_trash);
	_g_object_unref0 (self->priv->chart_stack);
	_g_object_unref0 (self->priv->spinner_stack);
	_g_object_unref0 (self->priv->chart_stack_switcher);
	_g_object_unref0 (self->priv->rings_chart);
	_g_object_unref0 (self->priv->treemap_chart);
	_g_object_unref0 (self->priv->spinner);
	_baobab_location_unref0 (self->priv->active_location);
	G_OBJECT_CLASS (baobab_window_parent_class)->finalize (obj);
}


GType baobab_window_get_type (void) {
	static volatile gsize baobab_window_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_window_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BaobabWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabWindow), 0, (GInstanceInitFunc) baobab_window_instance_init, NULL };
		GType baobab_window_type_id;
		baobab_window_type_id = g_type_register_static (gtk_application_window_get_type (), "BaobabWindow", &g_define_type_info, 0);
		g_once_init_leave (&baobab_window_type_id__volatile, baobab_window_type_id);
	}
	return baobab_window_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;
}



