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

/* SPDX-License-Identifier: GPL-3.0-or-later*/

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GRAPHS_IMPORT_DIALOG_0_PROPERTY,
	GRAPHS_IMPORT_DIALOG_NUM_PROPERTIES
};
static GParamSpec* graphs_import_dialog_properties[GRAPHS_IMPORT_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block5Data Block5Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	GRAPHS_IMPORT_FILE_ROW_0_PROPERTY,
	GRAPHS_IMPORT_FILE_ROW_NUM_PROPERTIES
};
static GParamSpec* graphs_import_file_row_properties[GRAPHS_IMPORT_FILE_ROW_NUM_PROPERTIES];
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GraphsImportDialogPrivate {
	AdwNavigationSplitView* _navigation_view;
	AdwNavigationPage* _file_settings_page;
	AdwComboRow* _mode;
	AdwToastOverlay* _toast_overlay;
	GtkListBox* _file_list;
	GtkBox* _file_settings_box;
	AdwPreferencesGroup* _default_group;
	AdwPreferencesGroup* _remove_group;
	GtkButton* _confirm_button;
	GraphsWindow* window;
	GListStore* settings_list;
	GraphsImportSettings* current_settings;
};

struct _Block5Data {
	int _ref_count_;
	GraphsImportDialog* self;
	GtkFileDialog* dialog;
};

struct _GraphsImportFileRowPrivate {
	GtkLabel* _filename;
	GtkLabel* _mode;
};

static gint GraphsImportDialog_private_offset;
static gpointer graphs_import_dialog_parent_class = NULL;
static gint GraphsImportFileRow_private_offset;
static gpointer graphs_import_file_row_parent_class = NULL;

static AdwComboRow* graphs_import_dialog_get_mode (GraphsImportDialog* self);
static GtkListBox* graphs_import_dialog_get_file_list (GraphsImportDialog* self);
static GtkWidget* __lambda38_ (GraphsImportDialog* self,
                        GObject* item);
static GtkButton* graphs_import_dialog_get_confirm_button (GraphsImportDialog* self);
static void graphs_import_dialog_on_is_valid (GraphsImportDialog* self);
static void _graphs_import_dialog_on_is_valid_g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self);
static GtkWidget* ___lambda38__gtk_list_box_create_widget_func (GObject* item,
                                                         gpointer self);
static AdwNavigationSplitView* graphs_import_dialog_get_navigation_view (GraphsImportDialog* self);
static void graphs_import_dialog_load_settings (GraphsImportDialog* self,
                                         GraphsImportSettings* settings);
static void graphs_import_dialog_load_mode_settings (GraphsImportDialog* self);
static GtkBox* graphs_import_dialog_get_file_settings_box (GraphsImportDialog* self);
static AdwPreferencesGroup* graphs_import_dialog_get_default_group (GraphsImportDialog* self);
static AdwPreferencesGroup* graphs_import_dialog_get_remove_group (GraphsImportDialog* self);
static void graphs_import_dialog_on_row_activated (GraphsImportDialog* self);
static void _graphs_import_dialog_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                        GtkListBoxRow* row,
                                                                        gpointer self);
static void graphs_import_dialog_on_row_selected (GraphsImportDialog* self,
                                           GtkListBoxRow* row);
static AdwNavigationPage* graphs_import_dialog_get_file_settings_page (GraphsImportDialog* self);
static void _graphs_import_dialog_on_row_selected_gtk_list_box_row_selected (GtkListBox* _sender,
                                                                      GtkListBoxRow* row,
                                                                      gpointer self);
static void graphs_import_dialog_on_add (GraphsImportDialog* self);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void __lambda39_ (Block5Data* _data5_,
                  GObject* d,
                  GAsyncResult* response);
static void ___lambda39__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void _graphs_import_dialog_on_add_gtk_button_clicked (GtkButton* _sender,
                                                      gpointer self);
static void graphs_import_dialog_on_mode (GraphsImportDialog* self);
static void _graphs_import_dialog_on_mode_g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self);
static void graphs_import_dialog_on_reset (GraphsImportDialog* self);
static void _graphs_import_dialog_on_reset_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self);
static void graphs_import_dialog_set_as_default (GraphsImportDialog* self);
static AdwToastOverlay* graphs_import_dialog_get_toast_overlay (GraphsImportDialog* self);
static void _graphs_import_dialog_set_as_default_adw_button_row_activated (AdwButtonRow* _sender,
                                                                    gpointer self);
static void graphs_import_dialog_remove (GraphsImportDialog* self);
static void _graphs_import_dialog_remove_adw_button_row_activated (AdwButtonRow* _sender,
                                                            gpointer self);
static void graphs_import_dialog_on_accept (GraphsImportDialog* self);
static void _graphs_import_dialog_on_accept_gtk_button_clicked (GtkButton* _sender,
                                                         gpointer self);
static void graphs_import_dialog_finalize (GObject * obj);
static GType graphs_import_dialog_get_type_once (void);
static void _vala_graphs_import_dialog_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static GtkLabel* graphs_import_file_row_get_filename (GraphsImportFileRow* self);
static GtkLabel* graphs_import_file_row_get_mode (GraphsImportFileRow* self);
static void graphs_import_file_row_on_is_valid (GraphsImportFileRow* self);
static void _graphs_import_file_row_on_is_valid_g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self);
static void graphs_import_file_row_finalize (GObject * obj);
static GType graphs_import_file_row_get_type_once (void);
static void _vala_graphs_import_file_row_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
graphs_import_dialog_get_instance_private (GraphsImportDialog* self)
{
	return G_STRUCT_MEMBER_P (self, GraphsImportDialog_private_offset);
}

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

static void
_graphs_import_dialog_on_is_valid_g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self)
{
	graphs_import_dialog_on_is_valid ((GraphsImportDialog*) self);
}

static GtkWidget*
__lambda38_ (GraphsImportDialog* self,
             GObject* item)
{
	GraphsImportSettings* settings = NULL;
	GraphsImportSettings* _tmp0_;
	GraphsImportSettings* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GraphsImportSettings* _tmp5_;
	GraphsImportSettings* _tmp6_;
	GraphsImportFileRow* _tmp7_;
	GtkWidget* result;
	g_return_val_if_fail (item != NULL, NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (item, GRAPHS_TYPE_IMPORT_SETTINGS, GraphsImportSettings));
	settings = _tmp0_;
	_tmp1_ = settings;
	_tmp2_ = graphs_import_settings_get_is_valid (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		GtkButton* _tmp4_;
		_tmp4_ = self->priv->_confirm_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
	}
	_tmp5_ = settings;
	g_signal_connect_object ((GObject*) _tmp5_, "notify::is-valid", (GCallback) _graphs_import_dialog_on_is_valid_g_object_notify, self, 0);
	_tmp6_ = settings;
	_tmp7_ = graphs_import_file_row_new (_tmp6_);
	g_object_ref_sink (_tmp7_);
	result = (GtkWidget*) _tmp7_;
	_g_object_unref0 (settings);
	return result;
}

static GtkWidget*
___lambda38__gtk_list_box_create_widget_func (GObject* item,
                                              gpointer self)
{
	GtkWidget* result;
	result = __lambda38_ ((GraphsImportDialog*) self, item);
	return result;
}

GraphsImportDialog*
graphs_import_dialog_construct (GType object_type,
                                GraphsWindow* window,
                                GListStore* settings_list)
{
	GraphsImportDialog * self = NULL;
	GraphsWindow* _tmp0_;
	GListStore* _tmp1_;
	AdwComboRow* _tmp2_;
	GtkStringList* _tmp3_;
	GtkStringList* _tmp4_;
	GtkListBox* _tmp5_;
	GtkListBox* _tmp6_;
	GtkListBox* _tmp7_;
	GtkListBoxRow* _tmp8_;
	AdwNavigationSplitView* _tmp9_;
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (settings_list != NULL, NULL);
	self = (GraphsImportDialog*) g_object_new (object_type, NULL);
	_vala_assert (g_list_model_get_item_type ((GListModel*) settings_list) == GRAPHS_TYPE_IMPORT_SETTINGS, "settings_list.get_item_type () == typeof (ImportSettings)");
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp0_;
	_tmp1_ = _g_object_ref0 (settings_list);
	_g_object_unref0 (self->priv->settings_list);
	self->priv->settings_list = _tmp1_;
	_tmp2_ = self->priv->_mode;
	_tmp3_ = graphs_data_importer_get_parser_names ();
	_tmp4_ = _tmp3_;
	adw_combo_row_set_model (_tmp2_, (GListModel*) _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->priv->_file_list;
	gtk_list_box_bind_model (_tmp5_, (GListModel*) settings_list, ___lambda38__gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp6_ = self->priv->_file_list;
	_tmp7_ = self->priv->_file_list;
	_tmp8_ = gtk_list_box_get_row_at_index (_tmp7_, 0);
	gtk_list_box_select_row (_tmp6_, _tmp8_);
	_tmp9_ = self->priv->_navigation_view;
	adw_navigation_split_view_set_show_content (_tmp9_, FALSE);
	adw_dialog_present ((AdwDialog*) self, (GtkWidget*) window);
	return self;
}

GraphsImportDialog*
graphs_import_dialog_new (GraphsWindow* window,
                          GListStore* settings_list)
{
	return graphs_import_dialog_construct (GRAPHS_TYPE_IMPORT_DIALOG, window, settings_list);
}

static void
graphs_import_dialog_on_is_valid (GraphsImportDialog* self)
{
	gboolean is_valid = FALSE;
	GtkButton* _tmp9_;
	g_return_if_fail (self != NULL);
	is_valid = TRUE;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GListStore* _tmp2_;
				GraphsImportSettings* settings = NULL;
				GListStore* _tmp3_;
				GObject* _tmp4_;
				gboolean _tmp5_ = FALSE;
				if (!_tmp0_) {
					guint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->settings_list;
				if (!(i < g_list_model_get_n_items ((GListModel*) _tmp2_))) {
					break;
				}
				_tmp3_ = self->priv->settings_list;
				_tmp4_ = g_list_model_get_item ((GListModel*) _tmp3_, i);
				settings = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GRAPHS_TYPE_IMPORT_SETTINGS, GraphsImportSettings);
				if (is_valid) {
					GraphsImportSettings* _tmp6_;
					gboolean _tmp7_;
					gboolean _tmp8_;
					_tmp6_ = settings;
					_tmp7_ = graphs_import_settings_get_is_valid (_tmp6_);
					_tmp8_ = _tmp7_;
					_tmp5_ = _tmp8_;
				} else {
					_tmp5_ = FALSE;
				}
				is_valid = _tmp5_;
				if (!is_valid) {
					_g_object_unref0 (settings);
					break;
				}
				_g_object_unref0 (settings);
			}
		}
	}
	_tmp9_ = self->priv->_confirm_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, is_valid);
}

static void
graphs_import_dialog_load_settings (GraphsImportDialog* self,
                                    GraphsImportSettings* settings)
{
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	GraphsImportSettings* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (settings != NULL);
	_g_object_unref0 (self->priv->current_settings);
	self->priv->current_settings = NULL;
	_tmp0_ = self->priv->_mode;
	_tmp1_ = graphs_import_settings_get_mode (settings);
	_tmp2_ = _tmp1_;
	adw_combo_row_set_selected (_tmp0_, _tmp2_);
	_tmp3_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->priv->current_settings);
	self->priv->current_settings = _tmp3_;
	graphs_import_dialog_load_mode_settings (self);
}

static void
graphs_import_dialog_load_mode_settings (GraphsImportDialog* self)
{
	GtkWidget* widget = NULL;
	GraphsImportSettings* _tmp6_;
	GtkBox* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp9_;
	AdwPreferencesGroup* _tmp10_;
	GraphsImportSettings* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	AdwPreferencesGroup* _tmp14_;
	GListStore* _tmp15_;
	g_return_if_fail (self != NULL);
	while (TRUE) {
		GtkBox* _tmp0_;
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		GtkBox* _tmp4_;
		GtkWidget* _tmp5_;
		_tmp0_ = self->priv->_file_settings_box;
		_tmp1_ = gtk_widget_get_last_child ((GtkWidget*) _tmp0_);
		_tmp2_ = _g_object_ref0 (_tmp1_);
		_g_object_unref0 (widget);
		widget = _tmp2_;
		_tmp3_ = widget;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = self->priv->_file_settings_box;
		_tmp5_ = widget;
		gtk_box_remove (_tmp4_, _tmp5_);
	}
	_tmp6_ = self->priv->current_settings;
	_tmp7_ = self->priv->_file_settings_box;
	_tmp8_ = graphs_data_importer_append_settings_widgets (_tmp6_, _tmp7_);
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp9_);
	_tmp10_ = self->priv->_default_group;
	_tmp11_ = self->priv->current_settings;
	_tmp12_ = graphs_import_settings_get_has_schema (_tmp11_);
	_tmp13_ = _tmp12_;
	gtk_widget_set_visible ((GtkWidget*) _tmp10_, _tmp13_);
	_tmp14_ = self->priv->_remove_group;
	_tmp15_ = self->priv->settings_list;
	gtk_widget_set_visible ((GtkWidget*) _tmp14_, g_list_model_get_n_items ((GListModel*) _tmp15_) > ((guint) 1));
	_g_object_unref0 (widget);
}

static void
graphs_import_dialog_on_row_activated (GraphsImportDialog* self)
{
	AdwNavigationSplitView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_navigation_view;
	if (adw_navigation_split_view_get_collapsed (_tmp0_)) {
		AdwNavigationSplitView* _tmp1_;
		_tmp1_ = self->priv->_navigation_view;
		adw_navigation_split_view_set_show_content (_tmp1_, TRUE);
	}
}

static void
_graphs_import_dialog_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                   GtkListBoxRow* row,
                                                                   gpointer self)
{
	graphs_import_dialog_on_row_activated ((GraphsImportDialog*) self);
}

static void
graphs_import_dialog_on_row_selected (GraphsImportDialog* self,
                                      GtkListBoxRow* row)
{
	GraphsImportFileRow* file_row = NULL;
	GraphsImportFileRow* _tmp0_;
	AdwNavigationPage* _tmp1_;
	GraphsImportFileRow* _tmp2_;
	GraphsImportSettings* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GraphsImportFileRow* _tmp6_;
	GraphsImportSettings* _tmp7_;
	g_return_if_fail (self != NULL);
	if (row == NULL) {
		return;
	}
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row, GRAPHS_TYPE_IMPORT_FILE_ROW, GraphsImportFileRow));
	file_row = _tmp0_;
	_tmp1_ = self->priv->_file_settings_page;
	_tmp2_ = file_row;
	_tmp3_ = _tmp2_->settings;
	_tmp4_ = graphs_import_settings_get_filename (_tmp3_);
	_tmp5_ = _tmp4_;
	adw_navigation_page_set_title (_tmp1_, _tmp5_);
	_tmp6_ = file_row;
	_tmp7_ = _tmp6_->settings;
	graphs_import_dialog_load_settings (self, _tmp7_);
	_g_object_unref0 (file_row);
}

static void
_graphs_import_dialog_on_row_selected_gtk_list_box_row_selected (GtkListBox* _sender,
                                                                 GtkListBoxRow* row,
                                                                 gpointer self)
{
	graphs_import_dialog_on_row_selected ((GraphsImportDialog*) self, row);
}

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_)) {
		GraphsImportDialog* self;
		self = _data5_->self;
		_g_object_unref0 (_data5_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static void
__lambda39_ (Block5Data* _data5_,
             GObject* d,
             GAsyncResult* response)
{
	GraphsImportDialog* self;
	GError* _inner_error0_ = NULL;
	self = _data5_->self;
	g_return_if_fail (response != NULL);
	{
		GListModel* files_list_model = NULL;
		GListModel* _tmp0_;
		AdwPreferencesGroup* _tmp14_;
		_tmp0_ = gtk_file_dialog_open_multiple_finish (_data5_->dialog, response, &_inner_error0_);
		files_list_model = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		{
			guint i = 0U;
			i = (guint) 0;
			{
				gboolean _tmp1_ = FALSE;
				_tmp1_ = TRUE;
				while (TRUE) {
					GListModel* _tmp3_;
					GFile* file = NULL;
					GListModel* _tmp4_;
					GObject* _tmp5_;
					GraphsImportSettings* settings = NULL;
					GFile* _tmp6_;
					GraphsImportSettings* _tmp7_;
					GraphsImportSettings* _tmp8_;
					gboolean _tmp9_;
					gboolean _tmp10_;
					GListStore* _tmp12_;
					GraphsImportSettings* _tmp13_;
					if (!_tmp1_) {
						guint _tmp2_;
						_tmp2_ = i;
						i = _tmp2_ + 1;
					}
					_tmp1_ = FALSE;
					_tmp3_ = files_list_model;
					if (!(i < g_list_model_get_n_items (_tmp3_))) {
						break;
					}
					_tmp4_ = files_list_model;
					_tmp5_ = g_list_model_get_item (_tmp4_, i);
					file = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, g_file_get_type (), GFile);
					_tmp6_ = file;
					_tmp7_ = graphs_data_importer_get_settings_for_file (_tmp6_);
					settings = _tmp7_;
					_tmp8_ = settings;
					_tmp9_ = graphs_import_settings_get_is_valid (_tmp8_);
					_tmp10_ = _tmp9_;
					if (!_tmp10_) {
						GtkButton* _tmp11_;
						_tmp11_ = self->priv->_confirm_button;
						gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, FALSE);
					}
					_tmp12_ = self->priv->settings_list;
					_tmp13_ = settings;
					g_list_store_append (_tmp12_, (GObject*) _tmp13_);
					_g_object_unref0 (settings);
					_g_object_unref0 (file);
				}
			}
		}
		_tmp14_ = self->priv->_remove_group;
		gtk_widget_set_visible ((GtkWidget*) _tmp14_, TRUE);
		_g_object_unref0 (files_list_model);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda39__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda39_ (self, source_object, res);
	block5_data_unref (self);
}

static void
graphs_import_dialog_on_add (GraphsImportDialog* self)
{
	Block5Data* _data5_;
	GtkFileDialog* _tmp0_;
	GListStore* _tmp1_;
	GListStore* _tmp2_;
	GraphsWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp0_ = gtk_file_dialog_new ();
	_data5_->dialog = _tmp0_;
	_tmp1_ = graphs_data_importer_get_file_filters ();
	_tmp2_ = _tmp1_;
	gtk_file_dialog_set_filters (_data5_->dialog, (GListModel*) _tmp2_);
	_tmp3_ = self->priv->window;
	gtk_file_dialog_open_multiple (_data5_->dialog, (GtkWindow*) _tmp3_, NULL, ___lambda39__gasync_ready_callback, block5_data_ref (_data5_));
	block5_data_unref (_data5_);
	_data5_ = NULL;
}

static void
_graphs_import_dialog_on_add_gtk_button_clicked (GtkButton* _sender,
                                                 gpointer self)
{
	graphs_import_dialog_on_add ((GraphsImportDialog*) self);
}

static void
graphs_import_dialog_on_mode (GraphsImportDialog* self)
{
	GraphsImportSettings* _tmp0_;
	GraphsImportSettings* _tmp1_;
	AdwComboRow* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_settings;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->current_settings;
	_tmp2_ = self->priv->_mode;
	graphs_import_settings_set_mode (_tmp1_, adw_combo_row_get_selected (_tmp2_));
	graphs_import_dialog_load_mode_settings (self);
}

static void
_graphs_import_dialog_on_mode_g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self)
{
	graphs_import_dialog_on_mode ((GraphsImportDialog*) self);
}

static void
graphs_import_dialog_on_reset (GraphsImportDialog* self)
{
	GraphsImportSettings* _tmp0_;
	GraphsImportSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_settings;
	graphs_data_importer_reset (_tmp0_);
	_tmp1_ = self->priv->current_settings;
	graphs_import_dialog_load_settings (self, _tmp1_);
}

static void
_graphs_import_dialog_on_reset_gtk_button_clicked (GtkButton* _sender,
                                                   gpointer self)
{
	graphs_import_dialog_on_reset ((GraphsImportDialog*) self);
}

static void
graphs_import_dialog_set_as_default (GraphsImportDialog* self)
{
	GraphsImportSettings* _tmp0_;
	AdwToast* toast = NULL;
	AdwToast* _tmp1_;
	AdwToastOverlay* _tmp2_;
	AdwToast* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_settings;
	graphs_data_importer_set_as_default (_tmp0_);
	_tmp1_ = adw_toast_new (_ ("Defaults updated"));
	toast = _tmp1_;
	_tmp2_ = self->priv->_toast_overlay;
	_tmp3_ = _g_object_ref0 (toast);
	adw_toast_overlay_add_toast (_tmp2_, _tmp3_);
	_g_object_unref0 (toast);
}

static void
_graphs_import_dialog_set_as_default_adw_button_row_activated (AdwButtonRow* _sender,
                                                               gpointer self)
{
	graphs_import_dialog_set_as_default ((GraphsImportDialog*) self);
}

static void
graphs_import_dialog_remove (GraphsImportDialog* self)
{
	guint index = 0U;
	GListStore* _tmp0_;
	GraphsImportSettings* _tmp1_;
	guint _tmp2_ = 0U;
	GListStore* _tmp3_;
	gint _tmp4_ = 0;
	gint new_index = 0;
	GtkListBox* _tmp5_;
	GtkListBox* _tmp6_;
	GtkListBoxRow* _tmp7_;
	AdwNavigationSplitView* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->settings_list;
	_tmp1_ = self->priv->current_settings;
	g_list_store_find (_tmp0_, (GObject*) _tmp1_, &_tmp2_);
	index = _tmp2_;
	_tmp3_ = self->priv->settings_list;
	g_list_store_remove (_tmp3_, index);
	if (index == ((guint) 0)) {
		_tmp4_ = 0;
	} else {
		_tmp4_ = ((gint) index) - 1;
	}
	new_index = _tmp4_;
	_tmp5_ = self->priv->_file_list;
	_tmp6_ = self->priv->_file_list;
	_tmp7_ = gtk_list_box_get_row_at_index (_tmp6_, new_index);
	gtk_list_box_select_row (_tmp5_, _tmp7_);
	graphs_import_dialog_on_is_valid (self);
	_tmp8_ = self->priv->_navigation_view;
	if (adw_navigation_split_view_get_collapsed (_tmp8_)) {
		AdwNavigationSplitView* _tmp9_;
		_tmp9_ = self->priv->_navigation_view;
		adw_navigation_split_view_set_show_content (_tmp9_, FALSE);
	}
}

static void
_graphs_import_dialog_remove_adw_button_row_activated (AdwButtonRow* _sender,
                                                       gpointer self)
{
	graphs_import_dialog_remove ((GraphsImportDialog*) self);
}

static void
graphs_import_dialog_on_accept (GraphsImportDialog* self)
{
	GraphsItemList* itemlist = NULL;
	GraphsItemList* _tmp0_;
	GraphsWindow* _tmp17_;
	GraphsData* _tmp18_;
	GraphsData* _tmp19_;
	GraphsItemList* _tmp20_;
	gint _tmp21_ = 0;
	GraphsItem** _tmp22_;
	GraphsItem** _tmp23_;
	gint _tmp23__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = graphs_item_list_new ();
	itemlist = _tmp0_;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GListStore* _tmp3_;
				GraphsImportSettings* settings = NULL;
				GListStore* _tmp4_;
				GObject* _tmp5_;
				gchar* message = NULL;
				GraphsItemList* _tmp6_;
				GraphsImportSettings* _tmp7_;
				GraphsWindow* _tmp8_;
				GraphsData* _tmp9_;
				GraphsData* _tmp10_;
				gchar* _tmp11_;
				const gchar* _tmp12_;
				gint _tmp13_;
				gint _tmp14_;
				if (!_tmp1_) {
					guint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = self->priv->settings_list;
				if (!(i < g_list_model_get_n_items ((GListModel*) _tmp3_))) {
					break;
				}
				_tmp4_ = self->priv->settings_list;
				_tmp5_ = g_list_model_get_item ((GListModel*) _tmp4_, i);
				settings = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GRAPHS_TYPE_IMPORT_SETTINGS, GraphsImportSettings);
				_tmp6_ = itemlist;
				_tmp7_ = settings;
				_tmp8_ = self->priv->window;
				_tmp9_ = graphs_window_get_data (_tmp8_);
				_tmp10_ = _tmp9_;
				_tmp11_ = graphs_data_importer_parse (_tmp6_, _tmp7_, _tmp10_);
				message = _tmp11_;
				_tmp12_ = message;
				_tmp13_ = strlen (_tmp12_);
				_tmp14_ = _tmp13_;
				if (_tmp14_ != 0) {
					GraphsWindow* _tmp15_;
					const gchar* _tmp16_;
					_tmp15_ = self->priv->window;
					_tmp16_ = message;
					graphs_window_add_toast_string (_tmp15_, _tmp16_);
				}
				_g_free0 (message);
				_g_object_unref0 (settings);
			}
		}
	}
	_tmp17_ = self->priv->window;
	_tmp18_ = graphs_window_get_data (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = itemlist;
	_tmp22_ = graphs_item_list_to_array (_tmp20_, &_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp23__length1 = _tmp21_;
	graphs_data_add_items (_tmp19_, _tmp23_, (gint) _tmp21_);
	_tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) g_object_unref), NULL);
	adw_dialog_close ((AdwDialog*) self);
	_g_object_unref0 (itemlist);
}

static void
_graphs_import_dialog_on_accept_gtk_button_clicked (GtkButton* _sender,
                                                    gpointer self)
{
	graphs_import_dialog_on_accept ((GraphsImportDialog*) self);
}

static AdwNavigationSplitView*
graphs_import_dialog_get_navigation_view (GraphsImportDialog* self)
{
	AdwNavigationSplitView* result;
	AdwNavigationSplitView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_navigation_view;
	result = _tmp0_;
	return result;
}

static AdwNavigationPage*
graphs_import_dialog_get_file_settings_page (GraphsImportDialog* self)
{
	AdwNavigationPage* result;
	AdwNavigationPage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_settings_page;
	result = _tmp0_;
	return result;
}

static AdwComboRow*
graphs_import_dialog_get_mode (GraphsImportDialog* self)
{
	AdwComboRow* result;
	AdwComboRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mode;
	result = _tmp0_;
	return result;
}

static AdwToastOverlay*
graphs_import_dialog_get_toast_overlay (GraphsImportDialog* self)
{
	AdwToastOverlay* result;
	AdwToastOverlay* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toast_overlay;
	result = _tmp0_;
	return result;
}

static GtkListBox*
graphs_import_dialog_get_file_list (GraphsImportDialog* self)
{
	GtkListBox* result;
	GtkListBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_list;
	result = _tmp0_;
	return result;
}

static GtkBox*
graphs_import_dialog_get_file_settings_box (GraphsImportDialog* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_settings_box;
	result = _tmp0_;
	return result;
}

static AdwPreferencesGroup*
graphs_import_dialog_get_default_group (GraphsImportDialog* self)
{
	AdwPreferencesGroup* result;
	AdwPreferencesGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_default_group;
	result = _tmp0_;
	return result;
}

static AdwPreferencesGroup*
graphs_import_dialog_get_remove_group (GraphsImportDialog* self)
{
	AdwPreferencesGroup* result;
	AdwPreferencesGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_remove_group;
	result = _tmp0_;
	return result;
}

static GtkButton*
graphs_import_dialog_get_confirm_button (GraphsImportDialog* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_confirm_button;
	result = _tmp0_;
	return result;
}

static void
graphs_import_dialog_class_init (GraphsImportDialogClass * klass,
                                 gpointer klass_data)
{
	graphs_import_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraphsImportDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_graphs_import_dialog_get_property;
	G_OBJECT_CLASS (klass)->finalize = graphs_import_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/se/sjoerd/Graphs/ui/import/dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "navigation_view", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _navigation_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "file_settings_page", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _file_settings_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "mode", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _mode));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "toast_overlay", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _toast_overlay));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "file_list", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _file_list));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "file_settings_box", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _file_settings_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "default_group", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _default_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "remove_group", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _remove_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "confirm_button", FALSE, GraphsImportDialog_private_offset + G_STRUCT_OFFSET (GraphsImportDialogPrivate, _confirm_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_row_activated", G_CALLBACK(_graphs_import_dialog_on_row_activated_gtk_list_box_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_row_selected", G_CALLBACK(_graphs_import_dialog_on_row_selected_gtk_list_box_row_selected));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_add", G_CALLBACK(_graphs_import_dialog_on_add_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_mode", G_CALLBACK(_graphs_import_dialog_on_mode_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_reset", G_CALLBACK(_graphs_import_dialog_on_reset_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "set_as_default", G_CALLBACK(_graphs_import_dialog_set_as_default_adw_button_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "remove", G_CALLBACK(_graphs_import_dialog_remove_adw_button_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_accept", G_CALLBACK(_graphs_import_dialog_on_accept_gtk_button_clicked));
}

static void
graphs_import_dialog_instance_init (GraphsImportDialog * self,
                                    gpointer klass)
{
	self->priv = graphs_import_dialog_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
graphs_import_dialog_finalize (GObject * obj)
{
	GraphsImportDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRAPHS_TYPE_IMPORT_DIALOG, GraphsImportDialog);
	_g_object_unref0 (self->priv->window);
	_g_object_unref0 (self->priv->settings_list);
	_g_object_unref0 (self->priv->current_settings);
	G_OBJECT_CLASS (graphs_import_dialog_parent_class)->finalize (obj);
}

static GType
graphs_import_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraphsImportDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) graphs_import_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraphsImportDialog), 0, (GInstanceInitFunc) graphs_import_dialog_instance_init, NULL };
	GType graphs_import_dialog_type_id;
	graphs_import_dialog_type_id = g_type_register_static (adw_dialog_get_type (), "GraphsImportDialog", &g_define_type_info, 0);
	GraphsImportDialog_private_offset = g_type_add_instance_private (graphs_import_dialog_type_id, sizeof (GraphsImportDialogPrivate));
	return graphs_import_dialog_type_id;
}

GType
graphs_import_dialog_get_type (void)
{
	static volatile gsize graphs_import_dialog_type_id__once = 0;
	if (g_once_init_enter (&graphs_import_dialog_type_id__once)) {
		GType graphs_import_dialog_type_id;
		graphs_import_dialog_type_id = graphs_import_dialog_get_type_once ();
		g_once_init_leave (&graphs_import_dialog_type_id__once, graphs_import_dialog_type_id);
	}
	return graphs_import_dialog_type_id__once;
}

static void
_vala_graphs_import_dialog_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	GraphsImportDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRAPHS_TYPE_IMPORT_DIALOG, GraphsImportDialog);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
graphs_import_file_row_get_instance_private (GraphsImportFileRow* self)
{
	return G_STRUCT_MEMBER_P (self, GraphsImportFileRow_private_offset);
}

static void
_graphs_import_file_row_on_is_valid_g_object_notify (GObject* _sender,
                                                     GParamSpec* pspec,
                                                     gpointer self)
{
	graphs_import_file_row_on_is_valid ((GraphsImportFileRow*) self);
}

GraphsImportFileRow*
graphs_import_file_row_construct (GType object_type,
                                  GraphsImportSettings* settings)
{
	GraphsImportFileRow * self = NULL;
	GraphsImportSettings* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GtkLabel* _tmp4_;
	g_return_val_if_fail (settings != NULL, NULL);
	self = (GraphsImportFileRow*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->settings);
	self->settings = _tmp0_;
	_tmp1_ = self->priv->_filename;
	_tmp2_ = graphs_import_settings_get_filename (settings);
	_tmp3_ = _tmp2_;
	gtk_label_set_label (_tmp1_, _tmp3_);
	_tmp4_ = self->priv->_mode;
	g_object_bind_property_with_closures ((GObject*) settings, "mode_name", (GObject*) _tmp4_, "label", 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)));
	g_signal_connect_object ((GObject*) settings, "notify::is-valid", (GCallback) _graphs_import_file_row_on_is_valid_g_object_notify, self, 0);
	graphs_import_file_row_on_is_valid (self);
	return self;
}

GraphsImportFileRow*
graphs_import_file_row_new (GraphsImportSettings* settings)
{
	return graphs_import_file_row_construct (GRAPHS_TYPE_IMPORT_FILE_ROW, settings);
}

static void
graphs_import_file_row_on_is_valid (GraphsImportFileRow* self)
{
	GraphsImportSettings* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->settings;
	_tmp1_ = graphs_import_settings_get_is_valid (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gtk_widget_remove_css_class ((GtkWidget*) self, "error");
	} else {
		gtk_widget_add_css_class ((GtkWidget*) self, "error");
	}
}

static GtkLabel*
graphs_import_file_row_get_filename (GraphsImportFileRow* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_filename;
	result = _tmp0_;
	return result;
}

static GtkLabel*
graphs_import_file_row_get_mode (GraphsImportFileRow* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mode;
	result = _tmp0_;
	return result;
}

static void
graphs_import_file_row_class_init (GraphsImportFileRowClass * klass,
                                   gpointer klass_data)
{
	graphs_import_file_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraphsImportFileRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_graphs_import_file_row_get_property;
	G_OBJECT_CLASS (klass)->finalize = graphs_import_file_row_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/se/sjoerd/Graphs/ui/import/file-row.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filename", FALSE, GraphsImportFileRow_private_offset + G_STRUCT_OFFSET (GraphsImportFileRowPrivate, _filename));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "mode", FALSE, GraphsImportFileRow_private_offset + G_STRUCT_OFFSET (GraphsImportFileRowPrivate, _mode));
}

static void
graphs_import_file_row_instance_init (GraphsImportFileRow * self,
                                      gpointer klass)
{
	self->priv = graphs_import_file_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
graphs_import_file_row_finalize (GObject * obj)
{
	GraphsImportFileRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRAPHS_TYPE_IMPORT_FILE_ROW, GraphsImportFileRow);
	_g_object_unref0 (self->settings);
	G_OBJECT_CLASS (graphs_import_file_row_parent_class)->finalize (obj);
}

static GType
graphs_import_file_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraphsImportFileRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) graphs_import_file_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraphsImportFileRow), 0, (GInstanceInitFunc) graphs_import_file_row_instance_init, NULL };
	GType graphs_import_file_row_type_id;
	graphs_import_file_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "GraphsImportFileRow", &g_define_type_info, 0);
	GraphsImportFileRow_private_offset = g_type_add_instance_private (graphs_import_file_row_type_id, sizeof (GraphsImportFileRowPrivate));
	return graphs_import_file_row_type_id;
}

GType
graphs_import_file_row_get_type (void)
{
	static volatile gsize graphs_import_file_row_type_id__once = 0;
	if (g_once_init_enter (&graphs_import_file_row_type_id__once)) {
		GType graphs_import_file_row_type_id;
		graphs_import_file_row_type_id = graphs_import_file_row_get_type_once ();
		g_once_init_leave (&graphs_import_file_row_type_id__once, graphs_import_file_row_type_id);
	}
	return graphs_import_file_row_type_id__once;
}

static void
_vala_graphs_import_file_row_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	GraphsImportFileRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRAPHS_TYPE_IMPORT_FILE_ROW, GraphsImportFileRow);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

