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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include "deja.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <glib-object.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  {
	DEJA_DUP_OPERATION_RESTORE_0_PROPERTY,
	DEJA_DUP_OPERATION_RESTORE_DEST_PROPERTY,
	DEJA_DUP_OPERATION_RESTORE_TAG_PROPERTY,
	DEJA_DUP_OPERATION_RESTORE_TREE_PROPERTY,
	DEJA_DUP_OPERATION_RESTORE_RESTORE_FILES_PROPERTY,
	DEJA_DUP_OPERATION_RESTORE_NUM_PROPERTIES
};
static GParamSpec* deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _DejaDupOperationRestoreStartData DejaDupOperationRestoreStartData;
typedef struct _DejaDupOperationRestoreOperationFinishedData DejaDupOperationRestoreOperationFinishedData;

struct _DejaDupOperationRestorePrivate {
	gchar* _dest;
	gchar* _tag;
	DejaDupFileTree* _tree;
	GList* _restore_files;
};

struct _DejaDupOperationRestoreStartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DejaDupOperationRestore* self;
};

struct _DejaDupOperationRestoreOperationFinishedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DejaDupOperationRestore* self;
	gboolean success;
	gboolean cancelled;
	gboolean _tmp0_;
};

static gint DejaDupOperationRestore_private_offset;
static gpointer deja_dup_operation_restore_parent_class = NULL;

VALA_EXTERN void deja_dup_operation_operation_finished (DejaDupOperation* self,
                                            gboolean success,
                                            gboolean cancelled,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void deja_dup_operation_operation_finished_finish (DejaDupOperation* self,
                                                   GAsyncResult* _res_);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void deja_dup_operation_restore_real_start_data_free (gpointer _data);
static void deja_dup_operation_restore_real_start (DejaDupOperation* base,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static gboolean deja_dup_operation_restore_real_start_co (DejaDupOperationRestoreStartData* _data_);
static void deja_dup_operation_restore_start_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static GList* deja_dup_operation_restore_real_make_argv (DejaDupOperation* base);
static gchar* deja_dup_operation_restore_real_get_success_detail (DejaDupOperation* base);
static void deja_dup_operation_restore_real_operation_finished_data_free (gpointer _data);
static void deja_dup_operation_restore_real_operation_finished (DejaDupOperation* base,
                                                         gboolean success,
                                                         gboolean cancelled,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static gboolean deja_dup_operation_restore_real_operation_finished_co (DejaDupOperationRestoreOperationFinishedData* _data_);
static void deja_dup_operation_restore_operation_finished_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static void deja_dup_operation_restore_finalize (GObject * obj);
static GType deja_dup_operation_restore_get_type_once (void);
static void _vala_deja_dup_operation_restore_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_deja_dup_operation_restore_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
deja_dup_operation_restore_get_instance_private (DejaDupOperationRestore* self)
{
	return G_STRUCT_MEMBER_P (self, DejaDupOperationRestore_private_offset);
}

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

DejaDupOperationRestore*
deja_dup_operation_restore_construct (GType object_type,
                                      DejaDupBackend* backend,
                                      const gchar* dest_in,
                                      DejaDupFileTree* tree,
                                      const gchar* tag,
                                      GList* files_in)
{
	DejaDupOperationRestore * self = NULL;
	g_return_val_if_fail (backend != NULL, NULL);
	g_return_val_if_fail (dest_in != NULL, NULL);
	g_return_val_if_fail (tree != NULL, NULL);
	g_return_val_if_fail (tag != NULL, NULL);
	self = (DejaDupOperationRestore*) g_object_new (object_type, "dest", dest_in, "tree", tree, "tag", tag, "restore-files", files_in, "mode", DEJA_DUP_TOOL_JOB_MODE_RESTORE, "backend", backend, NULL);
	return self;
}

DejaDupOperationRestore*
deja_dup_operation_restore_new (DejaDupBackend* backend,
                                const gchar* dest_in,
                                DejaDupFileTree* tree,
                                const gchar* tag,
                                GList* files_in)
{
	return deja_dup_operation_restore_construct (DEJA_DUP_TYPE_OPERATION_RESTORE, backend, dest_in, tree, tag, files_in);
}

static void
deja_dup_operation_restore_real_start_data_free (gpointer _data)
{
	DejaDupOperationRestoreStartData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DejaDupOperationRestoreStartData, _data_);
}

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

static void
deja_dup_operation_restore_real_start (DejaDupOperation* base,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DejaDupOperationRestore * self;
	DejaDupOperationRestoreStartData* _data_;
	DejaDupOperationRestore* _tmp0_;
	self = (DejaDupOperationRestore*) base;
	_data_ = g_slice_new0 (DejaDupOperationRestoreStartData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, deja_dup_operation_restore_real_start_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	deja_dup_operation_restore_real_start_co (_data_);
}

static void
deja_dup_operation_restore_start_finish (DejaDupOperation* base,
                                         GAsyncResult* _res_)
{
	DejaDupOperationRestoreStartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
deja_dup_operation_restore_start_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DejaDupOperationRestoreStartData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	deja_dup_operation_restore_real_start_co (_data_);
}

static gboolean
deja_dup_operation_restore_real_start_co (DejaDupOperationRestoreStartData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_signal_emit_by_name ((DejaDupOperation*) _data_->self, "action-desc-changed", _ ("Restoring files…"));
	_data_->_state_ = 1;
	DEJA_DUP_OPERATION_CLASS (deja_dup_operation_restore_parent_class)->start (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, DEJA_DUP_TYPE_OPERATION, DejaDupOperation), deja_dup_operation_restore_start_ready, _data_);
	return FALSE;
	_state_1:
	DEJA_DUP_OPERATION_CLASS (deja_dup_operation_restore_parent_class)->start_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, DEJA_DUP_TYPE_OPERATION, DejaDupOperation), _data_->_res_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static GList*
deja_dup_operation_restore_real_make_argv (DejaDupOperation* base)
{
	DejaDupOperationRestore * self;
	DejaDupToolJob* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	DejaDupToolJob* _tmp3_;
	const gchar* _tmp4_;
	DejaDupToolJob* _tmp5_;
	DejaDupFileTree* _tmp6_;
	DejaDupToolJob* _tmp7_;
	const gchar* _tmp8_;
	GFile* _tmp9_;
	GFile* _tmp10_;
	GList* result;
	self = (DejaDupOperationRestore*) base;
	_tmp0_ = ((DejaDupOperation*) self)->job;
	_tmp1_ = deja_dup_operation_restore_get_restore_files (self);
	_tmp2_ = _tmp1_;
	deja_dup_tool_job_set_restore_files (_tmp0_, _tmp2_);
	_tmp3_ = ((DejaDupOperation*) self)->job;
	_tmp4_ = self->priv->_tag;
	deja_dup_tool_job_set_tag (_tmp3_, _tmp4_);
	_tmp5_ = ((DejaDupOperation*) self)->job;
	_tmp6_ = self->priv->_tree;
	deja_dup_tool_job_set_tree (_tmp5_, _tmp6_);
	_tmp7_ = ((DejaDupOperation*) self)->job;
	_tmp8_ = self->priv->_dest;
	_tmp9_ = g_file_new_for_path (_tmp8_);
	_tmp10_ = _tmp9_;
	deja_dup_tool_job_set_local (_tmp7_, _tmp10_);
	_g_object_unref0 (_tmp10_);
	result = NULL;
	return result;
}

static gchar*
deja_dup_operation_restore_real_get_success_detail (DejaDupOperation* base)
{
	DejaDupOperationRestore * self;
	gchar* detail = NULL;
	GList* error_files = NULL;
	GList* _tmp0_;
	GList* _tmp1_;
	gchar* result;
	self = (DejaDupOperationRestore*) base;
	detail = NULL;
	_tmp0_ = deja_dup_operation_get_local_error_files ((DejaDupOperation*) self);
	error_files = _tmp0_;
	_tmp1_ = error_files;
	if (g_list_length (_tmp1_) > ((guint) 0)) {
		gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		GList* _tmp5_;
		_tmp2_ = g_strdup (_ ("Could not restore the following files.  Please make sure you are able " \
"to write to them."));
		_g_free0 (detail);
		detail = _tmp2_;
		_tmp3_ = detail;
		_tmp4_ = g_strconcat (_tmp3_, "\n", NULL);
		_g_free0 (detail);
		detail = _tmp4_;
		_tmp5_ = error_files;
		{
			GList* f_collection = NULL;
			GList* f_it = NULL;
			f_collection = _tmp5_;
			for (f_it = f_collection; f_it != NULL; f_it = f_it->next) {
				const gchar* f = NULL;
				f = (const gchar*) f_it->data;
				{
					const gchar* _tmp6_;
					const gchar* _tmp7_;
					gchar* _tmp8_;
					gchar* _tmp9_;
					gchar* _tmp10_;
					_tmp6_ = detail;
					_tmp7_ = f;
					_tmp8_ = g_strdup_printf ("\n%s", _tmp7_);
					_tmp9_ = _tmp8_;
					_tmp10_ = g_strconcat (_tmp6_, _tmp9_, NULL);
					_g_free0 (detail);
					detail = _tmp10_;
					_g_free0 (_tmp9_);
				}
			}
		}
	}
	result = detail;
	(error_files == NULL) ? NULL : (error_files = (g_list_free (error_files), NULL));
	return result;
}

static void
deja_dup_operation_restore_real_operation_finished_data_free (gpointer _data)
{
	DejaDupOperationRestoreOperationFinishedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DejaDupOperationRestoreOperationFinishedData, _data_);
}

static void
deja_dup_operation_restore_real_operation_finished (DejaDupOperation* base,
                                                    gboolean success,
                                                    gboolean cancelled,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	DejaDupOperationRestore * self;
	DejaDupOperationRestoreOperationFinishedData* _data_;
	DejaDupOperationRestore* _tmp0_;
	self = (DejaDupOperationRestore*) base;
	_data_ = g_slice_new0 (DejaDupOperationRestoreOperationFinishedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, deja_dup_operation_restore_real_operation_finished_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->success = success;
	_data_->cancelled = cancelled;
	deja_dup_operation_restore_real_operation_finished_co (_data_);
}

static void
deja_dup_operation_restore_operation_finished_finish (DejaDupOperation* base,
                                                      GAsyncResult* _res_)
{
	DejaDupOperationRestoreOperationFinishedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
deja_dup_operation_restore_operation_finished_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	DejaDupOperationRestoreOperationFinishedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	deja_dup_operation_restore_real_operation_finished_co (_data_);
}

static gboolean
deja_dup_operation_restore_real_operation_finished_co (DejaDupOperationRestoreOperationFinishedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->success) {
		_data_->_tmp0_ = !_data_->cancelled;
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		deja_dup_update_last_run_timestamp (DEJA_DUP_LAST_RESTORE_KEY);
	}
	_data_->_state_ = 1;
	DEJA_DUP_OPERATION_CLASS (deja_dup_operation_restore_parent_class)->operation_finished (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, DEJA_DUP_TYPE_OPERATION, DejaDupOperation), _data_->success, _data_->cancelled, deja_dup_operation_restore_operation_finished_ready, _data_);
	return FALSE;
	_state_1:
	DEJA_DUP_OPERATION_CLASS (deja_dup_operation_restore_parent_class)->operation_finished_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, DEJA_DUP_TYPE_OPERATION, DejaDupOperation), _data_->_res_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

const gchar*
deja_dup_operation_restore_get_dest (DejaDupOperationRestore* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_dest;
	result = _tmp0_;
	return result;
}

static void
deja_dup_operation_restore_set_dest (DejaDupOperationRestore* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = deja_dup_operation_restore_get_dest (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_dest);
		self->priv->_dest = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_DEST_PROPERTY]);
	}
}

const gchar*
deja_dup_operation_restore_get_tag (DejaDupOperationRestore* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tag;
	result = _tmp0_;
	return result;
}

static void
deja_dup_operation_restore_set_tag (DejaDupOperationRestore* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = deja_dup_operation_restore_get_tag (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tag);
		self->priv->_tag = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_TAG_PROPERTY]);
	}
}

DejaDupFileTree*
deja_dup_operation_restore_get_tree (DejaDupOperationRestore* self)
{
	DejaDupFileTree* result;
	DejaDupFileTree* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tree;
	result = _tmp0_;
	return result;
}

static void
deja_dup_operation_restore_set_tree (DejaDupOperationRestore* self,
                                     DejaDupFileTree* value)
{
	DejaDupFileTree* old_value;
	g_return_if_fail (self != NULL);
	old_value = deja_dup_operation_restore_get_tree (self);
	if (old_value != value) {
		DejaDupFileTree* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_tree);
		self->priv->_tree = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_TREE_PROPERTY]);
	}
}

GList*
deja_dup_operation_restore_get_restore_files (DejaDupOperationRestore* self)
{
	GList* result;
	GList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_restore_files;
	result = _tmp0_;
	return result;
}

static void
deja_dup_operation_restore_set_restore_files (DejaDupOperationRestore* self,
                                              GList* value)
{
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_list_copy_deep (value, (GCopyFunc) g_object_ref, NULL);
	(self->priv->_restore_files == NULL) ? NULL : (self->priv->_restore_files = (_g_list_free__g_object_unref0_ (self->priv->_restore_files), NULL));
	self->priv->_restore_files = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_RESTORE_FILES_PROPERTY]);
}

static void
deja_dup_operation_restore_class_init (DejaDupOperationRestoreClass * klass,
                                       gpointer klass_data)
{
	deja_dup_operation_restore_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DejaDupOperationRestore_private_offset);
	((DejaDupOperationClass *) klass)->start = (void (*) (DejaDupOperation*, GAsyncReadyCallback, gpointer)) deja_dup_operation_restore_real_start;
	((DejaDupOperationClass *) klass)->start_finish = (void (*) (DejaDupOperation*, GAsyncResult*)) deja_dup_operation_restore_start_finish;
	((DejaDupOperationClass *) klass)->make_argv = (GList* (*) (DejaDupOperation*)) deja_dup_operation_restore_real_make_argv;
	((DejaDupOperationClass *) klass)->get_success_detail = (gchar* (*) (DejaDupOperation*)) deja_dup_operation_restore_real_get_success_detail;
	((DejaDupOperationClass *) klass)->operation_finished = (void (*) (DejaDupOperation*, gboolean, gboolean, GAsyncReadyCallback, gpointer)) deja_dup_operation_restore_real_operation_finished;
	((DejaDupOperationClass *) klass)->operation_finished_finish = (void (*) (DejaDupOperation*, GAsyncResult*)) deja_dup_operation_restore_operation_finished_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_deja_dup_operation_restore_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_deja_dup_operation_restore_set_property;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_operation_restore_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_OPERATION_RESTORE_DEST_PROPERTY, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_DEST_PROPERTY] = g_param_spec_string ("dest", "dest", "dest", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_OPERATION_RESTORE_TAG_PROPERTY, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_TAG_PROPERTY] = g_param_spec_string ("tag", "tag", "tag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_OPERATION_RESTORE_TREE_PROPERTY, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_TREE_PROPERTY] = g_param_spec_object ("tree", "tree", "tree", DEJA_DUP_TYPE_FILE_TREE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_OPERATION_RESTORE_RESTORE_FILES_PROPERTY, deja_dup_operation_restore_properties[DEJA_DUP_OPERATION_RESTORE_RESTORE_FILES_PROPERTY] = g_param_spec_pointer ("restore-files", "restore-files", "restore-files", G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
deja_dup_operation_restore_instance_init (DejaDupOperationRestore * self,
                                          gpointer klass)
{
	self->priv = deja_dup_operation_restore_get_instance_private (self);
}

static void
deja_dup_operation_restore_finalize (GObject * obj)
{
	DejaDupOperationRestore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_OPERATION_RESTORE, DejaDupOperationRestore);
	_g_free0 (self->priv->_dest);
	_g_free0 (self->priv->_tag);
	_g_object_unref0 (self->priv->_tree);
	(self->priv->_restore_files == NULL) ? NULL : (self->priv->_restore_files = (_g_list_free__g_object_unref0_ (self->priv->_restore_files), NULL));
	G_OBJECT_CLASS (deja_dup_operation_restore_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
deja_dup_operation_restore_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DejaDupOperationRestoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_operation_restore_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupOperationRestore), 0, (GInstanceInitFunc) deja_dup_operation_restore_instance_init, NULL };
	GType deja_dup_operation_restore_type_id;
	deja_dup_operation_restore_type_id = g_type_register_static (DEJA_DUP_TYPE_OPERATION, "DejaDupOperationRestore", &g_define_type_info, 0);
	DejaDupOperationRestore_private_offset = g_type_add_instance_private (deja_dup_operation_restore_type_id, sizeof (DejaDupOperationRestorePrivate));
	return deja_dup_operation_restore_type_id;
}

GType
deja_dup_operation_restore_get_type (void)
{
	static gsize deja_dup_operation_restore_type_id__once = 0;
	if (g_once_init_enter (&deja_dup_operation_restore_type_id__once)) {
		GType deja_dup_operation_restore_type_id;
		deja_dup_operation_restore_type_id = deja_dup_operation_restore_get_type_once ();
		g_once_init_leave (&deja_dup_operation_restore_type_id__once, deja_dup_operation_restore_type_id);
	}
	return deja_dup_operation_restore_type_id__once;
}

static void
_vala_deja_dup_operation_restore_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	DejaDupOperationRestore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_OPERATION_RESTORE, DejaDupOperationRestore);
	switch (property_id) {
		case DEJA_DUP_OPERATION_RESTORE_DEST_PROPERTY:
		g_value_set_string (value, deja_dup_operation_restore_get_dest (self));
		break;
		case DEJA_DUP_OPERATION_RESTORE_TAG_PROPERTY:
		g_value_set_string (value, deja_dup_operation_restore_get_tag (self));
		break;
		case DEJA_DUP_OPERATION_RESTORE_TREE_PROPERTY:
		g_value_set_object (value, deja_dup_operation_restore_get_tree (self));
		break;
		case DEJA_DUP_OPERATION_RESTORE_RESTORE_FILES_PROPERTY:
		g_value_set_pointer (value, deja_dup_operation_restore_get_restore_files (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_deja_dup_operation_restore_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	DejaDupOperationRestore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_OPERATION_RESTORE, DejaDupOperationRestore);
	switch (property_id) {
		case DEJA_DUP_OPERATION_RESTORE_DEST_PROPERTY:
		deja_dup_operation_restore_set_dest (self, g_value_get_string (value));
		break;
		case DEJA_DUP_OPERATION_RESTORE_TAG_PROPERTY:
		deja_dup_operation_restore_set_tag (self, g_value_get_string (value));
		break;
		case DEJA_DUP_OPERATION_RESTORE_TREE_PROPERTY:
		deja_dup_operation_restore_set_tree (self, g_value_get_object (value));
		break;
		case DEJA_DUP_OPERATION_RESTORE_RESTORE_FILES_PROPERTY:
		deja_dup_operation_restore_set_restore_files (self, g_value_get_pointer (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

