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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
    This file is part of Déjà Dup.
    For copyright information, see AUTHORS.

    Déjà Dup is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Déjà Dup 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 Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>


#define DEJA_DUP_TYPE_LISTENER (deja_dup_listener_get_type ())
#define DEJA_DUP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_LISTENER, DejaDupListener))
#define DEJA_DUP_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_LISTENER, DejaDupListenerClass))
#define DEJA_DUP_IS_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_LISTENER))
#define DEJA_DUP_IS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_LISTENER))
#define DEJA_DUP_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_LISTENER, DejaDupListenerClass))

typedef struct _DejaDupListener DejaDupListener;
typedef struct _DejaDupListenerClass DejaDupListenerClass;
typedef struct _DejaDupListenerPrivate DejaDupListenerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DejaDupListenerCallButQuitOnFailData DejaDupListenerCallButQuitOnFailData;

#define DEJA_DUP_TYPE_CHECKER (deja_dup_checker_get_type ())
#define DEJA_DUP_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_CHECKER, DejaDupChecker))
#define DEJA_DUP_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_CHECKER, DejaDupCheckerClass))
#define DEJA_DUP_IS_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_CHECKER))
#define DEJA_DUP_IS_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_CHECKER))
#define DEJA_DUP_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_CHECKER, DejaDupCheckerClass))

typedef struct _DejaDupChecker DejaDupChecker;
typedef struct _DejaDupCheckerClass DejaDupCheckerClass;
typedef struct _DejaDupCheckerPrivate DejaDupCheckerPrivate;

#define DEJA_DUP_TYPE_U1_CHECKER (deja_dup_u1_checker_get_type ())
#define DEJA_DUP_U1_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_U1_CHECKER, DejaDupU1Checker))
#define DEJA_DUP_U1_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_U1_CHECKER, DejaDupU1CheckerClass))
#define DEJA_DUP_IS_U1_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_U1_CHECKER))
#define DEJA_DUP_IS_U1_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_U1_CHECKER))
#define DEJA_DUP_U1_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_U1_CHECKER, DejaDupU1CheckerClass))

typedef struct _DejaDupU1Checker DejaDupU1Checker;
typedef struct _DejaDupU1CheckerClass DejaDupU1CheckerClass;
typedef struct _DejaDupU1CheckerPrivate DejaDupU1CheckerPrivate;

#define DEJA_DUP_TYPE_PYTHON_CHECKER (deja_dup_python_checker_get_type ())
#define DEJA_DUP_PYTHON_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_PYTHON_CHECKER, DejaDupPythonChecker))
#define DEJA_DUP_PYTHON_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_PYTHON_CHECKER, DejaDupPythonCheckerClass))
#define DEJA_DUP_IS_PYTHON_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_PYTHON_CHECKER))
#define DEJA_DUP_IS_PYTHON_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_PYTHON_CHECKER))
#define DEJA_DUP_PYTHON_CHECKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_PYTHON_CHECKER, DejaDupPythonCheckerClass))

typedef struct _DejaDupPythonChecker DejaDupPythonChecker;
typedef struct _DejaDupPythonCheckerClass DejaDupPythonCheckerClass;

#define DEJA_DUP_TYPE_BACKEND (deja_dup_backend_get_type ())
#define DEJA_DUP_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_BACKEND, DejaDupBackend))
#define DEJA_DUP_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_BACKEND, DejaDupBackendClass))
#define DEJA_DUP_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_BACKEND))
#define DEJA_DUP_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_BACKEND))
#define DEJA_DUP_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_BACKEND, DejaDupBackendClass))

typedef struct _DejaDupBackend DejaDupBackend;
typedef struct _DejaDupBackendClass DejaDupBackendClass;
typedef struct _DejaDupBackendPrivate DejaDupBackendPrivate;

#define DEJA_DUP_OPERATION_TYPE_MODE (deja_dup_operation_mode_get_type ())

#define DEJA_DUP_TYPE_BACKEND_U1 (deja_dup_backend_u1_get_type ())
#define DEJA_DUP_BACKEND_U1(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_BACKEND_U1, DejaDupBackendU1))
#define DEJA_DUP_BACKEND_U1_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_BACKEND_U1, DejaDupBackendU1Class))
#define DEJA_DUP_IS_BACKEND_U1(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_BACKEND_U1))
#define DEJA_DUP_IS_BACKEND_U1_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_BACKEND_U1))
#define DEJA_DUP_BACKEND_U1_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_BACKEND_U1, DejaDupBackendU1Class))

typedef struct _DejaDupBackendU1 DejaDupBackendU1;
typedef struct _DejaDupBackendU1Class DejaDupBackendU1Class;
typedef struct _DejaDupBackendU1Private DejaDupBackendU1Private;

#define DEJA_DUP_TYPE_NETWORK (deja_dup_network_get_type ())
#define DEJA_DUP_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_NETWORK, DejaDupNetwork))
#define DEJA_DUP_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_NETWORK, DejaDupNetworkClass))
#define DEJA_DUP_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_NETWORK))
#define DEJA_DUP_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_NETWORK))
#define DEJA_DUP_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_NETWORK, DejaDupNetworkClass))

typedef struct _DejaDupNetwork DejaDupNetwork;
typedef struct _DejaDupNetworkClass DejaDupNetworkClass;

#define DEJA_DUP_TYPE_SIMPLE_SETTINGS (deja_dup_simple_settings_get_type ())
#define DEJA_DUP_SIMPLE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_SIMPLE_SETTINGS, DejaDupSimpleSettings))
#define DEJA_DUP_SIMPLE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_SIMPLE_SETTINGS, DejaDupSimpleSettingsClass))
#define DEJA_DUP_IS_SIMPLE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_SIMPLE_SETTINGS))
#define DEJA_DUP_IS_SIMPLE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_SIMPLE_SETTINGS))
#define DEJA_DUP_SIMPLE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_SIMPLE_SETTINGS, DejaDupSimpleSettingsClass))

typedef struct _DejaDupSimpleSettings DejaDupSimpleSettings;
typedef struct _DejaDupSimpleSettingsClass DejaDupSimpleSettingsClass;
typedef struct _Block4Data Block4Data;
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))
typedef struct _DejaDupBackendU1GetSpaceData DejaDupBackendU1GetSpaceData;
typedef struct _Block5Data Block5Data;
typedef struct _DejaDupBackendU1GetEnvpData DejaDupBackendU1GetEnvpData;
typedef struct _DejaDupBackendU1SignInData DejaDupBackendU1SignInData;

struct _DejaDupListener {
	GObject parent_instance;
	DejaDupListenerPrivate * priv;
};

struct _DejaDupListenerClass {
	GObjectClass parent_class;
};

typedef void (*DejaDupListenerHandler) (const gchar* name, GVariant* args, void* user_data);
struct _DejaDupListenerPrivate {
	GDBusProxy* _proxy;
	gchar* _method;
	GVariant* _args;
	DejaDupListenerHandler _handler;
	gpointer _handler_target;
	GDestroyNotify _handler_target_destroy_notify;
	GMainLoop* loop;
};

struct _DejaDupListenerCallButQuitOnFailData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	DejaDupListener* self;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	GError * e;
	GError * _inner_error_;
};

struct _DejaDupChecker {
	GObject parent_instance;
	DejaDupCheckerPrivate * priv;
};

struct _DejaDupCheckerClass {
	GObjectClass parent_class;
};

struct _DejaDupU1Checker {
	DejaDupChecker parent_instance;
	DejaDupU1CheckerPrivate * priv;
};

struct _DejaDupU1CheckerClass {
	DejaDupCheckerClass parent_class;
};

struct _DejaDupU1CheckerPrivate {
	DejaDupPythonChecker* pyu1;
};

typedef enum  {
	DEJA_DUP_OPERATION_MODE_INVALID,
	DEJA_DUP_OPERATION_MODE_BACKUP,
	DEJA_DUP_OPERATION_MODE_RESTORE,
	DEJA_DUP_OPERATION_MODE_STATUS,
	DEJA_DUP_OPERATION_MODE_LIST,
	DEJA_DUP_OPERATION_MODE_FILEHISTORY
} DejaDupOperationMode;

struct _DejaDupBackend {
	GObject parent_instance;
	DejaDupBackendPrivate * priv;
};

struct _DejaDupBackendClass {
	GObjectClass parent_class;
	gboolean (*is_native) (DejaDupBackend* self);
	GIcon* (*get_icon) (DejaDupBackend* self);
	gchar* (*get_location) (DejaDupBackend* self, GError** error);
	gchar* (*get_location_pretty) (DejaDupBackend* self, GError** error);
	gboolean (*is_ready) (DejaDupBackend* self, gchar** when);
	void (*get_envp) (DejaDupBackend* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*get_envp_finish) (DejaDupBackend* self, GAsyncResult* _res_, GError** error);
	void (*get_space) (DejaDupBackend* self, gboolean free, GAsyncReadyCallback _callback_, gpointer _user_data_);
	guint64 (*get_space_finish) (DejaDupBackend* self, GAsyncResult* _res_);
	gboolean (*space_can_be_infinite) (DejaDupBackend* self);
	void (*add_argv) (DejaDupBackend* self, DejaDupOperationMode mode, GList** argv);
	DejaDupBackend* (*clone) (DejaDupBackend* self);
};

struct _DejaDupBackendU1 {
	DejaDupBackend parent_instance;
	DejaDupBackendU1Private * priv;
};

struct _DejaDupBackendU1Class {
	DejaDupBackendClass parent_class;
};

struct _DejaDupBackendU1Private {
	gulong button_handler;
};

struct _Block4Data {
	int _ref_count_;
	DejaDupBackendU1 * self;
	guint64 total;
	guint64 used;
	gpointer _async_data_;
};

struct _DejaDupBackendU1GetSpaceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	DejaDupBackendU1* self;
	gboolean free;
	guint64 result;
	Block4Data* _data4_;
	GDBusProxy* obj;
	GDBusProxy* _tmp0_;
	GDBusProxy* _tmp1_;
	GError * e;
	const gchar* _tmp2_;
	DejaDupListener* _tmp3_;
	DejaDupListener* listener;
	guint64 _tmp4_;
	GError * _inner_error_;
};

struct _Block5Data {
	int _ref_count_;
	DejaDupBackendU1 * self;
	gboolean found;
	gpointer _async_data_;
};

struct _DejaDupBackendU1GetEnvpData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	DejaDupBackendU1* self;
	Block5Data* _data5_;
	GDBusProxy* _tmp0_;
	GDBusProxy* obj;
	const gchar* _tmp1_;
	DejaDupListener* _tmp2_;
	DejaDupListener* listener;
	GError * _inner_error_;
};

struct _DejaDupBackendU1SignInData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	DejaDupBackendU1* self;
	GDBusProxy* _tmp0_;
	GDBusProxy* obj;
	const gchar* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	DejaDupListener* _tmp4_;
	DejaDupListener* _tmp5_;
	DejaDupListener* listener;
	GError * e;
	GError * _inner_error_;
};


static gpointer deja_dup_listener_parent_class = NULL;
static gpointer deja_dup_u1_checker_parent_class = NULL;
static gpointer deja_dup_backend_u1_parent_class = NULL;
static DejaDupChecker* deja_dup_backend_u1_checker_instance;
static DejaDupChecker* deja_dup_backend_u1_checker_instance = NULL;
extern guint64 deja_dup_backend_INFINITE_SPACE;

#define DEJA_DUP_U1_ROOT "U1"
#define DEJA_DUP_U1_FOLDER_KEY "folder"
GType deja_dup_listener_get_type (void) G_GNUC_CONST;
#define DEJA_DUP_LISTENER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DEJA_DUP_TYPE_LISTENER, DejaDupListenerPrivate))
enum  {
	DEJA_DUP_LISTENER_DUMMY_PROPERTY,
	DEJA_DUP_LISTENER_PROXY,
	DEJA_DUP_LISTENER_METHOD,
	DEJA_DUP_LISTENER_ARGS
};
DejaDupListener* deja_dup_listener_new (GDBusProxy* proxy, const gchar* method, GVariant* args, DejaDupListenerHandler handler, void* handler_target);
DejaDupListener* deja_dup_listener_construct (GType object_type, GDBusProxy* proxy, const gchar* method, GVariant* args, DejaDupListenerHandler handler, void* handler_target);
void deja_dup_listener_set_handler (DejaDupListener* self, DejaDupListenerHandler value, gpointer value_target);
void deja_dup_listener_run (DejaDupListener* self);
static gboolean _lambda11_ (DejaDupListener* self);
static void deja_dup_listener_call_but_quit_on_fail (DejaDupListener* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void deja_dup_listener_call_but_quit_on_fail_finish (DejaDupListener* self, GAsyncResult* _res_);
static gboolean __lambda11__gsource_func (gpointer self);
GDBusProxy* deja_dup_listener_get_proxy (DejaDupListener* self);
static void deja_dup_listener_handle_dbus_signal (DejaDupListener* self, GDBusProxy* obj, const gchar* sender, const gchar* name, GVariant* args);
static void _deja_dup_listener_handle_dbus_signal_g_dbus_proxy_g_signal (GDBusProxy* _sender, const gchar* sender_name, const gchar* signal_name, GVariant* parameters, gpointer self);
static void deja_dup_listener_call_but_quit_on_fail_data_free (gpointer _data);
static gboolean deja_dup_listener_call_but_quit_on_fail_co (DejaDupListenerCallButQuitOnFailData* data);
const gchar* deja_dup_listener_get_method (DejaDupListener* self);
GVariant* deja_dup_listener_get_args (DejaDupListener* self);
static void deja_dup_listener_call_but_quit_on_fail_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
DejaDupListenerHandler deja_dup_listener_get_handler (DejaDupListener* self, gpointer* result_target);
static void deja_dup_listener_set_proxy (DejaDupListener* self, GDBusProxy* value);
static void deja_dup_listener_set_method (DejaDupListener* self, const gchar* value);
static void deja_dup_listener_set_args (DejaDupListener* self, GVariant* value);
static GObject * deja_dup_listener_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void deja_dup_listener_finalize (GObject* obj);
static void _vala_deja_dup_listener_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_deja_dup_listener_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType deja_dup_checker_get_type (void) G_GNUC_CONST;
GType deja_dup_u1_checker_get_type (void) G_GNUC_CONST;
GType deja_dup_python_checker_get_type (void) G_GNUC_CONST;
#define DEJA_DUP_U1_CHECKER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DEJA_DUP_TYPE_U1_CHECKER, DejaDupU1CheckerPrivate))
enum  {
	DEJA_DUP_U1_CHECKER_DUMMY_PROPERTY
};
DejaDupU1Checker* deja_dup_u1_checker_new (void);
DejaDupU1Checker* deja_dup_u1_checker_construct (GType object_type);
DejaDupChecker* deja_dup_checker_new (void);
DejaDupChecker* deja_dup_checker_construct (GType object_type);
static GObject * deja_dup_u1_checker_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
GDBusProxy* deja_dup_backend_u1_get_creds_proxy (GError** error);
void deja_dup_checker_set_available (DejaDupChecker* self, gboolean value);
void deja_dup_checker_set_complete (DejaDupChecker* self, gboolean value);
gboolean deja_dup_checker_get_complete (DejaDupChecker* self);
DejaDupPythonChecker* deja_dup_python_checker_get_checker (const gchar* module);
gboolean deja_dup_checker_get_available (DejaDupChecker* self);
static void _lambda10_ (DejaDupU1Checker* self);
static void __lambda10__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void deja_dup_u1_checker_finalize (GObject* obj);
GType deja_dup_backend_get_type (void) G_GNUC_CONST;
GType deja_dup_operation_mode_get_type (void) G_GNUC_CONST;
GType deja_dup_backend_u1_get_type (void) G_GNUC_CONST;
#define DEJA_DUP_BACKEND_U1_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DEJA_DUP_TYPE_BACKEND_U1, DejaDupBackendU1Private))
enum  {
	DEJA_DUP_BACKEND_U1_DUMMY_PROPERTY
};
GMountOperation* deja_dup_backend_get_mount_op (DejaDupBackend* self);
DejaDupChecker* deja_dup_backend_u1_get_checker (void);
static DejaDupBackend* deja_dup_backend_u1_real_clone (DejaDupBackend* base);
DejaDupBackendU1* deja_dup_backend_u1_new (void);
DejaDupBackendU1* deja_dup_backend_u1_construct (GType object_type);
static gboolean deja_dup_backend_u1_real_is_native (DejaDupBackend* base);
static gboolean deja_dup_backend_u1_real_space_can_be_infinite (DejaDupBackend* base);
static GIcon* deja_dup_backend_u1_real_get_icon (DejaDupBackend* base);
static gboolean deja_dup_backend_u1_real_is_ready (DejaDupBackend* base, gchar** when);
GType deja_dup_network_get_type (void) G_GNUC_CONST;
DejaDupNetwork* deja_dup_network_get (void);
gboolean deja_dup_network_get_connected (DejaDupNetwork* self);
static gchar* deja_dup_backend_u1_real_get_location (DejaDupBackend* base, GError** error);
GType deja_dup_simple_settings_get_type (void) G_GNUC_CONST;
DejaDupSimpleSettings* deja_dup_get_settings (const gchar* subdir);
gchar* deja_dup_get_folder_key (DejaDupSimpleSettings* settings, const gchar* key);
static gchar* deja_dup_backend_u1_real_get_location_pretty (DejaDupBackend* base, GError** error);
static void deja_dup_backend_u1_real_get_space_data_free (gpointer _data);
static void deja_dup_backend_u1_real_get_space (DejaDupBackend* base, gboolean free, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean deja_dup_backend_u1_real_get_space_co (DejaDupBackendU1GetSpaceData* data);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (Block4Data* _data4_);
GDBusProxy* deja_dup_backend_u1_get_prefs_proxy (GError** error);
static void _lambda12_ (const gchar* name, GVariant* args, Block4Data* _data4_);
static void __lambda12__deja_dup_listener_handler (const gchar* name, GVariant* args, gpointer self);
static void deja_dup_backend_u1_real_get_envp_data_free (gpointer _data);
static void deja_dup_backend_u1_real_get_envp (DejaDupBackend* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean deja_dup_backend_u1_real_get_envp_co (DejaDupBackendU1GetEnvpData* data);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (Block5Data* _data5_);
static void deja_dup_backend_u1_ask_password (DejaDupBackendU1* self);
static void _lambda14_ (const gchar* name, GVariant* args, Block5Data* _data5_);
static void __lambda14__deja_dup_listener_handler (const gchar* name, GVariant* args, gpointer self);
static void deja_dup_backend_u1_button_clicked (DejaDupBackendU1* self);
static void deja_dup_backend_u1_sign_in (DejaDupBackendU1* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void deja_dup_backend_u1_sign_in_finish (DejaDupBackendU1* self, GAsyncResult* _res_);
static void deja_dup_backend_u1_sign_in_data_free (gpointer _data);
static gboolean deja_dup_backend_u1_sign_in_co (DejaDupBackendU1SignInData* data);
static void _lambda13_ (const gchar* name, GVariant* args, DejaDupBackendU1* self);
static void __lambda13__deja_dup_listener_handler (const gchar* name, GVariant* args, gpointer self);
DejaDupBackend* deja_dup_backend_construct (GType object_type);
static void deja_dup_backend_u1_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);


DejaDupListener* deja_dup_listener_construct (GType object_type, GDBusProxy* proxy, const gchar* method, GVariant* args, DejaDupListenerHandler handler, void* handler_target) {
	DejaDupListener * self = NULL;
	g_return_val_if_fail (proxy != NULL, NULL);
	g_return_val_if_fail (method != NULL, NULL);
	self = (DejaDupListener*) g_object_new (object_type, "proxy", proxy, "method", method, "args", args, NULL);
	deja_dup_listener_set_handler (self, handler, handler_target);
	return self;
}


DejaDupListener* deja_dup_listener_new (GDBusProxy* proxy, const gchar* method, GVariant* args, DejaDupListenerHandler handler, void* handler_target) {
	return deja_dup_listener_construct (DEJA_DUP_TYPE_LISTENER, proxy, method, args, handler, handler_target);
}


static gboolean _lambda11_ (DejaDupListener* self) {
	gboolean result = FALSE;
	deja_dup_listener_call_but_quit_on_fail (self, NULL, NULL);
	result = FALSE;
	return result;
}


static gboolean __lambda11__gsource_func (gpointer self) {
	gboolean result;
	result = _lambda11_ (self);
	return result;
}


static void _deja_dup_listener_handle_dbus_signal_g_dbus_proxy_g_signal (GDBusProxy* _sender, const gchar* sender_name, const gchar* signal_name, GVariant* parameters, gpointer self) {
	deja_dup_listener_handle_dbus_signal (self, _sender, sender_name, signal_name, parameters);
}


void deja_dup_listener_run (DejaDupListener* self) {
	guint _tmp0_;
	g_return_if_fail (self != NULL);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda11__gsource_func, g_object_ref (self), g_object_unref);
	g_signal_connect_object (self->priv->_proxy, "g-signal", (GCallback) _deja_dup_listener_handle_dbus_signal_g_dbus_proxy_g_signal, self, 0);
	g_main_loop_run (self->priv->loop);
	g_signal_parse_name ("g-signal", G_TYPE_DBUS_PROXY, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (self->priv->_proxy, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _deja_dup_listener_handle_dbus_signal_g_dbus_proxy_g_signal, self);
}


static void deja_dup_listener_call_but_quit_on_fail_data_free (gpointer _data) {
	DejaDupListenerCallButQuitOnFailData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (DejaDupListenerCallButQuitOnFailData, data);
}


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


static void deja_dup_listener_call_but_quit_on_fail (DejaDupListener* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	DejaDupListenerCallButQuitOnFailData* _data_;
	_data_ = g_slice_new0 (DejaDupListenerCallButQuitOnFailData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, deja_dup_listener_call_but_quit_on_fail);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, deja_dup_listener_call_but_quit_on_fail_data_free);
	_data_->self = _g_object_ref0 (self);
	deja_dup_listener_call_but_quit_on_fail_co (_data_);
}


static void deja_dup_listener_call_but_quit_on_fail_finish (DejaDupListener* self, GAsyncResult* _res_) {
	DejaDupListenerCallButQuitOnFailData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void deja_dup_listener_call_but_quit_on_fail_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	DejaDupListenerCallButQuitOnFailData* data;
	data = _user_data_;
	data->_source_object_ = source_object;
	data->_res_ = _res_;
	deja_dup_listener_call_but_quit_on_fail_co (data);
}


static gboolean deja_dup_listener_call_but_quit_on_fail_co (DejaDupListenerCallButQuitOnFailData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_state_ = 1;
	g_dbus_proxy_call (data->self->priv->_proxy, data->self->priv->_method, data->self->priv->_args, G_DBUS_CALL_FLAGS_NONE, -1, NULL, deja_dup_listener_call_but_quit_on_fail_ready, data);
	return FALSE;
	_state_1:
	data->_tmp0_ = NULL;
	data->_tmp0_ = g_dbus_proxy_call_finish (data->self->priv->_proxy, data->_res_, &data->_inner_error_);
	data->_tmp1_ = data->_tmp0_;
	_g_variant_unref0 (data->_tmp1_);
	if (data->_inner_error_ != NULL) {
		goto __catch13_g_error;
	}
	goto __finally13;
	__catch13_g_error:
	{
		data->e = data->_inner_error_;
		data->_inner_error_ = NULL;
		g_warning ("BackendU1.vala:63: %s\n", data->e->message);
		g_main_loop_quit (data->self->priv->loop);
		_g_error_free0 (data->e);
	}
	__finally13:
	if (data->_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
		g_clear_error (&data->_inner_error_);
		return FALSE;
	}
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


static void deja_dup_listener_handle_dbus_signal (DejaDupListener* self, GDBusProxy* obj, const gchar* sender, const gchar* name, GVariant* args) {
	DejaDupListenerHandler _tmp0_ = NULL;
	void* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (sender != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (args != NULL);
	_tmp0_ = deja_dup_listener_get_handler (self, &_tmp1_);
	_tmp0_ (name, args, _tmp1_);
	g_main_loop_quit (self->priv->loop);
}


GDBusProxy* deja_dup_listener_get_proxy (DejaDupListener* self) {
	GDBusProxy* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_proxy;
	return result;
}


static void deja_dup_listener_set_proxy (DejaDupListener* self, GDBusProxy* value) {
	GDBusProxy* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_proxy);
	self->priv->_proxy = _tmp0_;
	g_object_notify ((GObject *) self, "proxy");
}


const gchar* deja_dup_listener_get_method (DejaDupListener* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_method;
	return result;
}


static void deja_dup_listener_set_method (DejaDupListener* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_method);
	self->priv->_method = _tmp0_;
	g_object_notify ((GObject *) self, "method");
}


GVariant* deja_dup_listener_get_args (DejaDupListener* self) {
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_args;
	return result;
}


static gpointer _g_variant_ref0 (gpointer self) {
	return self ? g_variant_ref (self) : NULL;
}


static void deja_dup_listener_set_args (DejaDupListener* self, GVariant* value) {
	GVariant* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_variant_ref0 (value);
	_g_variant_unref0 (self->priv->_args);
	self->priv->_args = _tmp0_;
	g_object_notify ((GObject *) self, "args");
}


DejaDupListenerHandler deja_dup_listener_get_handler (DejaDupListener* self, gpointer* result_target) {
	DejaDupListenerHandler result;
	DejaDupListenerHandler _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_handler;
	*result_target = self->priv->_handler_target;
	result = _tmp0_;
	return result;
}


void deja_dup_listener_set_handler (DejaDupListener* self, DejaDupListenerHandler value, gpointer value_target) {
	DejaDupListenerHandler _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	(self->priv->_handler_target_destroy_notify == NULL) ? NULL : (self->priv->_handler_target_destroy_notify (self->priv->_handler_target), NULL);
	self->priv->_handler = NULL;
	self->priv->_handler_target = NULL;
	self->priv->_handler_target_destroy_notify = NULL;
	self->priv->_handler = _tmp0_;
	self->priv->_handler_target = value_target;
	self->priv->_handler_target_destroy_notify = NULL;
}


static GObject * deja_dup_listener_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	DejaDupListener * self;
	GMainLoop* _tmp0_ = NULL;
	parent_class = G_OBJECT_CLASS (deja_dup_listener_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = DEJA_DUP_LISTENER (obj);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_g_main_loop_unref0 (self->priv->loop);
	self->priv->loop = _tmp0_;
	return obj;
}


static void deja_dup_listener_class_init (DejaDupListenerClass * klass) {
	deja_dup_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (DejaDupListenerPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_deja_dup_listener_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_deja_dup_listener_set_property;
	G_OBJECT_CLASS (klass)->constructor = deja_dup_listener_constructor;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_LISTENER_PROXY, g_param_spec_object ("proxy", "proxy", "proxy", G_TYPE_DBUS_PROXY, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_LISTENER_METHOD, g_param_spec_string ("method", "method", "method", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_LISTENER_ARGS, g_param_spec_variant ("args", "args", "args", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void deja_dup_listener_instance_init (DejaDupListener * self) {
	self->priv = DEJA_DUP_LISTENER_GET_PRIVATE (self);
}


static void deja_dup_listener_finalize (GObject* obj) {
	DejaDupListener * self;
	self = DEJA_DUP_LISTENER (obj);
	_g_object_unref0 (self->priv->_proxy);
	_g_free0 (self->priv->_method);
	_g_variant_unref0 (self->priv->_args);
	(self->priv->_handler_target_destroy_notify == NULL) ? NULL : (self->priv->_handler_target_destroy_notify (self->priv->_handler_target), NULL);
	self->priv->_handler = NULL;
	self->priv->_handler_target = NULL;
	self->priv->_handler_target_destroy_notify = NULL;
	_g_main_loop_unref0 (self->priv->loop);
	G_OBJECT_CLASS (deja_dup_listener_parent_class)->finalize (obj);
}


GType deja_dup_listener_get_type (void) {
	static volatile gsize deja_dup_listener_type_id__volatile = 0;
	if (g_once_init_enter (&deja_dup_listener_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DejaDupListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupListener), 0, (GInstanceInitFunc) deja_dup_listener_instance_init, NULL };
		GType deja_dup_listener_type_id;
		deja_dup_listener_type_id = g_type_register_static (G_TYPE_OBJECT, "DejaDupListener", &g_define_type_info, 0);
		g_once_init_leave (&deja_dup_listener_type_id__volatile, deja_dup_listener_type_id);
	}
	return deja_dup_listener_type_id__volatile;
}


static void _vala_deja_dup_listener_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	DejaDupListener * self;
	self = DEJA_DUP_LISTENER (object);
	switch (property_id) {
		case DEJA_DUP_LISTENER_PROXY:
		g_value_set_object (value, deja_dup_listener_get_proxy (self));
		break;
		case DEJA_DUP_LISTENER_METHOD:
		g_value_set_string (value, deja_dup_listener_get_method (self));
		break;
		case DEJA_DUP_LISTENER_ARGS:
		g_value_set_variant (value, deja_dup_listener_get_args (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_deja_dup_listener_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	DejaDupListener * self;
	self = DEJA_DUP_LISTENER (object);
	switch (property_id) {
		case DEJA_DUP_LISTENER_PROXY:
		deja_dup_listener_set_proxy (self, g_value_get_object (value));
		break;
		case DEJA_DUP_LISTENER_METHOD:
		deja_dup_listener_set_method (self, g_value_get_string (value));
		break;
		case DEJA_DUP_LISTENER_ARGS:
		deja_dup_listener_set_args (self, g_value_get_variant (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


DejaDupU1Checker* deja_dup_u1_checker_construct (GType object_type) {
	DejaDupU1Checker * self = NULL;
	self = (DejaDupU1Checker*) deja_dup_checker_construct (object_type);
	return self;
}


DejaDupU1Checker* deja_dup_u1_checker_new (void) {
	return deja_dup_u1_checker_construct (DEJA_DUP_TYPE_U1_CHECKER);
}


static void _lambda10_ (DejaDupU1Checker* self) {
	gboolean _tmp0_;
	gboolean _tmp1_;
	_tmp0_ = deja_dup_checker_get_available ((DejaDupChecker*) self->priv->pyu1);
	deja_dup_checker_set_available ((DejaDupChecker*) self, _tmp0_);
	_tmp1_ = deja_dup_checker_get_complete ((DejaDupChecker*) self->priv->pyu1);
	deja_dup_checker_set_complete ((DejaDupChecker*) self, _tmp1_);
	_g_object_unref0 (self->priv->pyu1);
	self->priv->pyu1 = NULL;
}


static void __lambda10__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_lambda10_ (self);
}


static GObject * deja_dup_u1_checker_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	DejaDupU1Checker * self;
	GDBusProxy* _tmp0_ = NULL;
	GDBusProxy* proxy;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_;
	GError * _inner_error_ = NULL;
	parent_class = G_OBJECT_CLASS (deja_dup_u1_checker_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = DEJA_DUP_U1_CHECKER (obj);
	_tmp0_ = deja_dup_backend_u1_get_creds_proxy (&_inner_error_);
	proxy = _tmp0_;
	if (_inner_error_ != NULL) {
		goto __catch14_g_error;
	}
	_tmp1_ = g_dbus_proxy_get_name_owner (proxy);
	if (_tmp1_ == NULL) {
		deja_dup_checker_set_available ((DejaDupChecker*) self, FALSE);
		deja_dup_checker_set_complete ((DejaDupChecker*) self, TRUE);
	}
	_g_object_unref0 (proxy);
	goto __finally14;
	__catch14_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("BackendU1.vala:88: %s\n", e->message);
		deja_dup_checker_set_available ((DejaDupChecker*) self, FALSE);
		deja_dup_checker_set_complete ((DejaDupChecker*) self, TRUE);
		_g_error_free0 (e);
	}
	__finally14:
	if (_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_);
	}
	_tmp2_ = deja_dup_checker_get_complete ((DejaDupChecker*) self);
	if (!_tmp2_) {
		DejaDupPythonChecker* _tmp3_ = NULL;
		gboolean _tmp4_;
		_tmp3_ = deja_dup_python_checker_get_checker ("ubuntuone.platform.credentials, ubuntuone.couch.auth");
		_g_object_unref0 (self->priv->pyu1);
		self->priv->pyu1 = _tmp3_;
		_tmp4_ = deja_dup_checker_get_complete ((DejaDupChecker*) self->priv->pyu1);
		if (_tmp4_) {
			gboolean _tmp5_;
			gboolean _tmp6_;
			_tmp5_ = deja_dup_checker_get_available ((DejaDupChecker*) self->priv->pyu1);
			deja_dup_checker_set_available ((DejaDupChecker*) self, _tmp5_);
			_tmp6_ = deja_dup_checker_get_complete ((DejaDupChecker*) self->priv->pyu1);
			deja_dup_checker_set_complete ((DejaDupChecker*) self, _tmp6_);
		} else {
			g_signal_connect_object ((GObject*) self->priv->pyu1, "notify::complete", (GCallback) __lambda10__g_object_notify, self, 0);
		}
	}
	return obj;
}


static void deja_dup_u1_checker_class_init (DejaDupU1CheckerClass * klass) {
	deja_dup_u1_checker_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (DejaDupU1CheckerPrivate));
	G_OBJECT_CLASS (klass)->constructor = deja_dup_u1_checker_constructor;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_u1_checker_finalize;
}


static void deja_dup_u1_checker_instance_init (DejaDupU1Checker * self) {
	self->priv = DEJA_DUP_U1_CHECKER_GET_PRIVATE (self);
}


static void deja_dup_u1_checker_finalize (GObject* obj) {
	DejaDupU1Checker * self;
	self = DEJA_DUP_U1_CHECKER (obj);
	_g_object_unref0 (self->priv->pyu1);
	G_OBJECT_CLASS (deja_dup_u1_checker_parent_class)->finalize (obj);
}


GType deja_dup_u1_checker_get_type (void) {
	static volatile gsize deja_dup_u1_checker_type_id__volatile = 0;
	if (g_once_init_enter (&deja_dup_u1_checker_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DejaDupU1CheckerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_u1_checker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupU1Checker), 0, (GInstanceInitFunc) deja_dup_u1_checker_instance_init, NULL };
		GType deja_dup_u1_checker_type_id;
		deja_dup_u1_checker_type_id = g_type_register_static (DEJA_DUP_TYPE_CHECKER, "DejaDupU1Checker", &g_define_type_info, 0);
		g_once_init_leave (&deja_dup_u1_checker_type_id__volatile, deja_dup_u1_checker_type_id);
	}
	return deja_dup_u1_checker_type_id__volatile;
}


DejaDupChecker* deja_dup_backend_u1_get_checker (void) {
	DejaDupChecker* result = NULL;
	DejaDupChecker* _tmp1_;
	if (deja_dup_backend_u1_checker_instance == NULL) {
		DejaDupU1Checker* _tmp0_ = NULL;
		_tmp0_ = deja_dup_u1_checker_new ();
		_g_object_unref0 (deja_dup_backend_u1_checker_instance);
		deja_dup_backend_u1_checker_instance = (DejaDupChecker*) _tmp0_;
	}
	_tmp1_ = _g_object_ref0 (deja_dup_backend_u1_checker_instance);
	result = _tmp1_;
	return result;
}


static DejaDupBackend* deja_dup_backend_u1_real_clone (DejaDupBackend* base) {
	DejaDupBackendU1 * self;
	DejaDupBackend* result = NULL;
	DejaDupBackendU1* _tmp0_ = NULL;
	self = (DejaDupBackendU1*) base;
	_tmp0_ = deja_dup_backend_u1_new ();
	result = (DejaDupBackend*) _tmp0_;
	return result;
}


static gboolean deja_dup_backend_u1_real_is_native (DejaDupBackend* base) {
	DejaDupBackendU1 * self;
	gboolean result = FALSE;
	self = (DejaDupBackendU1*) base;
	result = FALSE;
	return result;
}


static gboolean deja_dup_backend_u1_real_space_can_be_infinite (DejaDupBackend* base) {
	DejaDupBackendU1 * self;
	gboolean result = FALSE;
	self = (DejaDupBackendU1*) base;
	result = FALSE;
	return result;
}


static GIcon* deja_dup_backend_u1_real_get_icon (DejaDupBackend* base) {
	DejaDupBackendU1 * self;
	GIcon* result = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_ = NULL;
	gchar** _tmp4_;
	gint _tmp4__length1;
	GThemedIcon* _tmp5_ = NULL;
	GIcon* _tmp6_;
	self = (DejaDupBackendU1*) base;
	_tmp0_ = g_strdup ("ubuntuone");
	_tmp1_ = g_strdup ("ubuntuone-installer");
	_tmp2_ = g_strdup ("deja-dup-cloud");
	_tmp3_ = g_new0 (gchar*, 3 + 1);
	_tmp3_[0] = _tmp0_;
	_tmp3_[1] = _tmp1_;
	_tmp3_[2] = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp4__length1 = 3;
	_tmp5_ = (GThemedIcon*) g_themed_icon_new_from_names (_tmp4_, 3);
	_tmp6_ = (GIcon*) _tmp5_;
	_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	result = _tmp6_;
	return result;
}


static gboolean deja_dup_backend_u1_real_is_ready (DejaDupBackend* base, gchar** when) {
	DejaDupBackendU1 * self;
	gchar* _when = NULL;
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	DejaDupNetwork* _tmp2_ = NULL;
	DejaDupNetwork* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = (DejaDupBackendU1*) base;
	_tmp0_ = _ ("Backup will begin when a network connection becomes available.");
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (_when);
	_when = _tmp1_;
	_tmp2_ = deja_dup_network_get ();
	_tmp3_ = _tmp2_;
	_tmp4_ = deja_dup_network_get_connected (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	result = _tmp5_;
	if (when) {
		*when = _when;
	} else {
		_g_free0 (_when);
	}
	return result;
}


static gchar* deja_dup_backend_u1_real_get_location (DejaDupBackend* base, GError** error) {
	DejaDupBackendU1 * self;
	gchar* result = NULL;
	DejaDupSimpleSettings* _tmp0_ = NULL;
	DejaDupSimpleSettings* settings;
	gchar* _tmp1_ = NULL;
	gchar* folder;
	gchar* _tmp2_ = NULL;
	self = (DejaDupBackendU1*) base;
	_tmp0_ = deja_dup_get_settings (DEJA_DUP_U1_ROOT);
	settings = _tmp0_;
	_tmp1_ = deja_dup_get_folder_key (settings, DEJA_DUP_U1_FOLDER_KEY);
	folder = _tmp1_;
	_tmp2_ = g_strdup_printf ("u1+http://%s", folder);
	result = _tmp2_;
	_g_free0 (folder);
	_g_object_unref0 (settings);
	return result;
}


static gchar* deja_dup_backend_u1_real_get_location_pretty (DejaDupBackend* base, GError** error) {
	DejaDupBackendU1 * self;
	gchar* result = NULL;
	DejaDupSimpleSettings* _tmp0_ = NULL;
	DejaDupSimpleSettings* settings;
	gchar* _tmp1_ = NULL;
	gchar* folder;
	self = (DejaDupBackendU1*) base;
	_tmp0_ = deja_dup_get_settings (DEJA_DUP_U1_ROOT);
	settings = _tmp0_;
	_tmp1_ = deja_dup_get_folder_key (settings, DEJA_DUP_U1_FOLDER_KEY);
	folder = _tmp1_;
	if (g_strcmp0 (folder, "") == 0) {
		const gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp2_ = _ ("Ubuntu One");
		_tmp3_ = g_strdup (_tmp2_);
		result = _tmp3_;
		_g_free0 (folder);
		_g_object_unref0 (settings);
		return result;
	} else {
		const gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp4_ = _ ("%s on Ubuntu One");
		_tmp5_ = g_strdup_printf (_tmp4_, folder);
		result = _tmp5_;
		_g_free0 (folder);
		_g_object_unref0 (settings);
		return result;
	}
	_g_free0 (folder);
	_g_object_unref0 (settings);
}


static void deja_dup_backend_u1_real_get_space_data_free (gpointer _data) {
	DejaDupBackendU1GetSpaceData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (DejaDupBackendU1GetSpaceData, data);
}


static void deja_dup_backend_u1_real_get_space (DejaDupBackend* base, gboolean free, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	DejaDupBackendU1 * self;
	DejaDupBackendU1GetSpaceData* _data_;
	self = (DejaDupBackendU1*) base;
	_data_ = g_slice_new0 (DejaDupBackendU1GetSpaceData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, deja_dup_backend_u1_real_get_space);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, deja_dup_backend_u1_real_get_space_data_free);
	_data_->self = _g_object_ref0 (self);
	_data_->free = free;
	deja_dup_backend_u1_real_get_space_co (_data_);
}


static guint64 deja_dup_backend_u1_real_get_space_finish (DejaDupBackend* base, GAsyncResult* _res_) {
	guint64 result;
	DejaDupBackendU1GetSpaceData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


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


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


static guint64 uint64_parse (const gchar* str) {
	guint64 result = 0ULL;
	guint64 _tmp0_;
	g_return_val_if_fail (str != NULL, 0ULL);
	_tmp0_ = g_ascii_strtoull (str, NULL, (guint) 0);
	result = _tmp0_;
	return result;
}


static void _lambda12_ (const gchar* name, GVariant* args, Block4Data* _data4_) {
	DejaDupBackendU1 * self;
	self = _data4_->self;
	g_return_if_fail (name != NULL);
	g_return_if_fail (args != NULL);
	if (g_strcmp0 (name, "AccountInfoReady") == 0) {
		GVariantIter* iter = NULL;
		gchar* key = NULL;
		gchar* val = NULL;
		g_variant_get (args, "(a{ss})", &iter, NULL);
		while (TRUE) {
			gboolean _tmp0_;
			_tmp0_ = g_variant_iter_next (iter, "{ss}", &key, &val, NULL);
			if (!_tmp0_) {
				break;
			}
			if (g_strcmp0 (key, "quota_total") == 0) {
				guint64 _tmp1_;
				_tmp1_ = uint64_parse (val);
				_data4_->total = _tmp1_;
			} else {
				if (g_strcmp0 (key, "quota_used") == 0) {
					guint64 _tmp2_;
					_tmp2_ = uint64_parse (val);
					_data4_->used = _tmp2_;
				}
			}
		}
		_g_free0 (val);
		_g_free0 (key);
		_g_variant_iter_free0 (iter);
	}
}


static void __lambda12__deja_dup_listener_handler (const gchar* name, GVariant* args, gpointer self) {
	_lambda12_ (name, args, self);
}


static gboolean deja_dup_backend_u1_real_get_space_co (DejaDupBackendU1GetSpaceData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_data4_ = g_slice_new0 (Block4Data);
	data->_data4_->_ref_count_ = 1;
	data->_data4_->self = g_object_ref (data->self);
	data->_data4_->_async_data_ = data;
	data->obj = NULL;
	data->_tmp0_ = NULL;
	data->_tmp0_ = deja_dup_backend_u1_get_prefs_proxy (&data->_inner_error_);
	data->_tmp1_ = data->_tmp0_;
	if (data->_inner_error_ != NULL) {
		goto __catch15_g_error;
	}
	_g_object_unref0 (data->obj);
	data->obj = data->_tmp1_;
	goto __finally15;
	__catch15_g_error:
	{
		data->e = data->_inner_error_;
		data->_inner_error_ = NULL;
		g_warning ("BackendU1.vala:179: %s\n", data->e->message);
		data->result = deja_dup_backend_INFINITE_SPACE;
		_g_error_free0 (data->e);
		_g_object_unref0 (data->obj);
		block4_data_unref (data->_data4_);
		data->_data4_ = NULL;
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
	__finally15:
	if (data->_inner_error_ != NULL) {
		_g_object_unref0 (data->obj);
		block4_data_unref (data->_data4_);
		data->_data4_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
		g_clear_error (&data->_inner_error_);
		return FALSE;
	}
	data->_tmp2_ = NULL;
	data->_tmp2_ = g_dbus_proxy_get_name_owner (data->obj);
	if (data->_tmp2_ == NULL) {
		data->result = deja_dup_backend_INFINITE_SPACE;
		_g_object_unref0 (data->obj);
		block4_data_unref (data->_data4_);
		data->_data4_ = NULL;
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
	data->_data4_->total = deja_dup_backend_INFINITE_SPACE;
	data->_data4_->used = (guint64) 0;
	data->_tmp3_ = NULL;
	data->_tmp3_ = deja_dup_listener_new (data->obj, "account_info", NULL, __lambda12__deja_dup_listener_handler, data->_data4_);
	data->listener = data->_tmp3_;
	deja_dup_listener_run (data->listener);
	if (data->free) {
		if (data->_data4_->total > data->_data4_->used) {
			data->_tmp4_ = data->_data4_->total - data->_data4_->used;
		} else {
			data->_tmp4_ = (guint64) 0;
		}
		data->result = data->_tmp4_;
		_g_object_unref0 (data->listener);
		_g_object_unref0 (data->obj);
		block4_data_unref (data->_data4_);
		data->_data4_ = NULL;
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	} else {
		data->result = data->_data4_->total;
		_g_object_unref0 (data->listener);
		_g_object_unref0 (data->obj);
		block4_data_unref (data->_data4_);
		data->_data4_ = NULL;
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
	_g_object_unref0 (data->listener);
	_g_object_unref0 (data->obj);
	block4_data_unref (data->_data4_);
	data->_data4_ = NULL;
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


static void deja_dup_backend_u1_real_get_envp_data_free (gpointer _data) {
	DejaDupBackendU1GetEnvpData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (DejaDupBackendU1GetEnvpData, data);
}


static void deja_dup_backend_u1_real_get_envp (DejaDupBackend* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	DejaDupBackendU1 * self;
	DejaDupBackendU1GetEnvpData* _data_;
	self = (DejaDupBackendU1*) base;
	_data_ = g_slice_new0 (DejaDupBackendU1GetEnvpData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, deja_dup_backend_u1_real_get_envp);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, deja_dup_backend_u1_real_get_envp_data_free);
	_data_->self = _g_object_ref0 (self);
	deja_dup_backend_u1_real_get_envp_co (_data_);
}


static void deja_dup_backend_u1_real_get_envp_finish (DejaDupBackend* base, GAsyncResult* _res_, GError** error) {
	DejaDupBackendU1GetEnvpData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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


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


static void _lambda14_ (const gchar* name, GVariant* args, Block5Data* _data5_) {
	DejaDupBackendU1 * self;
	self = _data5_->self;
	g_return_if_fail (name != NULL);
	g_return_if_fail (args != NULL);
	if (g_strcmp0 (name, "CredentialsFound") == 0) {
		_data5_->found = TRUE;
	}
}


static void __lambda14__deja_dup_listener_handler (const gchar* name, GVariant* args, gpointer self) {
	_lambda14_ (name, args, self);
}


static gboolean deja_dup_backend_u1_real_get_envp_co (DejaDupBackendU1GetEnvpData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_data5_ = g_slice_new0 (Block5Data);
	data->_data5_->_ref_count_ = 1;
	data->_data5_->self = g_object_ref (data->self);
	data->_data5_->_async_data_ = data;
	data->_data5_->found = FALSE;
	data->_tmp0_ = NULL;
	data->_tmp0_ = deja_dup_backend_u1_get_creds_proxy (&data->_inner_error_);
	data->obj = data->_tmp0_;
	if (data->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (data->_async_result, data->_inner_error_);
		g_error_free (data->_inner_error_);
		block5_data_unref (data->_data5_);
		data->_data5_ = NULL;
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
	data->_tmp1_ = NULL;
	data->_tmp1_ = g_dbus_proxy_get_name_owner (data->obj);
	if (data->_tmp1_ == NULL) {
		deja_dup_backend_u1_ask_password (data->self);
		_g_object_unref0 (data->obj);
		block5_data_unref (data->_data5_);
		data->_data5_ = NULL;
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
	data->_tmp2_ = NULL;
	data->_tmp2_ = deja_dup_listener_new (data->obj, "find_credentials", NULL, __lambda14__deja_dup_listener_handler, data->_data5_);
	data->listener = data->_tmp2_;
	deja_dup_listener_run (data->listener);
	if (data->_data5_->found) {
		g_signal_emit_by_name ((DejaDupBackend*) data->self, "envp-ready", TRUE, NULL, NULL);
	} else {
		deja_dup_backend_u1_ask_password (data->self);
	}
	_g_object_unref0 (data->listener);
	_g_object_unref0 (data->obj);
	block5_data_unref (data->_data5_);
	data->_data5_ = NULL;
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


static void deja_dup_backend_u1_button_clicked (DejaDupBackendU1* self) {
	g_return_if_fail (self != NULL);
	deja_dup_backend_u1_sign_in (self, NULL, NULL);
}


static void deja_dup_backend_u1_ask_password (DejaDupBackendU1* self) {
	GMountOperation* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GMountOperation* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GMountOperation* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = deja_dup_backend_get_mount_op ((DejaDupBackend*) self);
	_tmp1_ = _ ("Connect to Ubuntu One");
	g_object_set ((GObject*) _tmp0_, "label_title", _tmp1_, NULL);
	_tmp2_ = deja_dup_backend_get_mount_op ((DejaDupBackend*) self);
	_tmp3_ = _ ("Sign into Ubuntu One…");
	g_object_set ((GObject*) _tmp2_, "label_button", _tmp3_, NULL);
	if (self->priv->button_handler == 0) {
		GMountOperation* _tmp4_ = NULL;
		gulong _tmp5_;
		_tmp4_ = deja_dup_backend_get_mount_op ((DejaDupBackend*) self);
		_tmp5_ = g_signal_connect_swapped (_tmp4_, "button-clicked", (GCallback) deja_dup_backend_u1_button_clicked, self);
		self->priv->button_handler = _tmp5_;
	}
	_tmp6_ = deja_dup_backend_get_mount_op ((DejaDupBackend*) self);
	g_signal_emit_by_name (_tmp6_, "ask-password", "", "", "", 0);
}


static void deja_dup_backend_u1_sign_in_data_free (gpointer _data) {
	DejaDupBackendU1SignInData* data;
	data = _data;
	_g_object_unref0 (data->self);
	g_slice_free (DejaDupBackendU1SignInData, data);
}


static void deja_dup_backend_u1_sign_in (DejaDupBackendU1* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	DejaDupBackendU1SignInData* _data_;
	_data_ = g_slice_new0 (DejaDupBackendU1SignInData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, deja_dup_backend_u1_sign_in);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, deja_dup_backend_u1_sign_in_data_free);
	_data_->self = _g_object_ref0 (self);
	deja_dup_backend_u1_sign_in_co (_data_);
}


static void deja_dup_backend_u1_sign_in_finish (DejaDupBackendU1* self, GAsyncResult* _res_) {
	DejaDupBackendU1SignInData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _lambda13_ (const gchar* name, GVariant* args, DejaDupBackendU1* self) {
	g_return_if_fail (name != NULL);
	g_return_if_fail (args != NULL);
	if (g_strcmp0 (name, "CredentialsFound") == 0) {
		GMountOperation* _tmp0_ = NULL;
		_tmp0_ = deja_dup_backend_get_mount_op ((DejaDupBackend*) self);
		g_object_set ((GObject*) _tmp0_, "go_forward", TRUE, NULL);
		g_signal_emit_by_name ((DejaDupBackend*) self, "envp-ready", TRUE, NULL, NULL);
	}
}


static void __lambda13__deja_dup_listener_handler (const gchar* name, GVariant* args, gpointer self) {
	_lambda13_ (name, args, self);
}


static gboolean deja_dup_backend_u1_sign_in_co (DejaDupBackendU1SignInData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	data->_tmp0_ = NULL;
	data->_tmp0_ = deja_dup_backend_u1_get_creds_proxy (&data->_inner_error_);
	data->obj = data->_tmp0_;
	if (data->_inner_error_ != NULL) {
		goto __catch16_g_error;
	}
	data->_tmp1_ = NULL;
	data->_tmp1_ = g_dbus_proxy_get_name_owner (data->obj);
	if (data->_tmp1_ == NULL) {
		g_signal_emit_by_name ((DejaDupBackend*) data->self, "envp-ready", FALSE, NULL, NULL);
		_g_object_unref0 (data->obj);
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
	data->_tmp2_ = NULL;
	data->_tmp2_ = g_variant_new ("(a{ss})", NULL, NULL);
	data->_tmp3_ = g_variant_ref_sink (data->_tmp2_);
	data->_tmp4_ = NULL;
	data->_tmp4_ = deja_dup_listener_new (data->obj, "login", data->_tmp3_, __lambda13__deja_dup_listener_handler, data->self);
	data->_tmp5_ = data->_tmp4_;
	_g_variant_unref0 (data->_tmp3_);
	data->listener = data->_tmp5_;
	deja_dup_listener_run (data->listener);
	_g_object_unref0 (data->listener);
	_g_object_unref0 (data->obj);
	goto __finally16;
	__catch16_g_error:
	{
		data->e = data->_inner_error_;
		data->_inner_error_ = NULL;
		g_warning ("BackendU1.vala:263: %s\n", data->e->message);
		g_signal_emit_by_name ((DejaDupBackend*) data->self, "envp-ready", FALSE, NULL, NULL);
		_g_error_free0 (data->e);
	}
	__finally16:
	if (data->_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
		g_clear_error (&data->_inner_error_);
		return FALSE;
	}
	if (data->_state_ == 0) {
		g_simple_async_result_complete_in_idle (data->_async_result);
	} else {
		g_simple_async_result_complete (data->_async_result);
	}
	g_object_unref (data->_async_result);
	return FALSE;
}


GDBusProxy* deja_dup_backend_u1_get_creds_proxy (GError** error) {
	GDBusProxy* result = NULL;
	GDBusProxy* creds_proxy = NULL;
	GDBusProxy* _tmp0_ = NULL;
	GDBusProxy* _tmp1_;
	GError * _inner_error_ = NULL;
	_tmp0_ = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, NULL, "com.ubuntuone.Credentials", "/credentials", "com.ubuntuone.CredentialsManagement", NULL, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (creds_proxy);
		return NULL;
	}
	_g_object_unref0 (creds_proxy);
	creds_proxy = _tmp1_;
	result = creds_proxy;
	return result;
}


GDBusProxy* deja_dup_backend_u1_get_prefs_proxy (GError** error) {
	GDBusProxy* result = NULL;
	GDBusProxy* prefs_proxy = NULL;
	GDBusProxy* _tmp0_ = NULL;
	GDBusProxy* _tmp1_;
	GError * _inner_error_ = NULL;
	_tmp0_ = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, NULL, "com.ubuntuone.controlpanel", "/preferences", "com.ubuntuone.controlpanel.Preferences", NULL, &_inner_error_);
	_tmp1_ = _tmp0_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (prefs_proxy);
		return NULL;
	}
	_g_object_unref0 (prefs_proxy);
	prefs_proxy = _tmp1_;
	result = prefs_proxy;
	return result;
}


DejaDupBackendU1* deja_dup_backend_u1_construct (GType object_type) {
	DejaDupBackendU1 * self = NULL;
	self = (DejaDupBackendU1*) deja_dup_backend_construct (object_type);
	return self;
}


DejaDupBackendU1* deja_dup_backend_u1_new (void) {
	return deja_dup_backend_u1_construct (DEJA_DUP_TYPE_BACKEND_U1);
}


static void deja_dup_backend_u1_class_init (DejaDupBackendU1Class * klass) {
	deja_dup_backend_u1_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (DejaDupBackendU1Private));
	DEJA_DUP_BACKEND_CLASS (klass)->clone = deja_dup_backend_u1_real_clone;
	DEJA_DUP_BACKEND_CLASS (klass)->is_native = deja_dup_backend_u1_real_is_native;
	DEJA_DUP_BACKEND_CLASS (klass)->space_can_be_infinite = deja_dup_backend_u1_real_space_can_be_infinite;
	DEJA_DUP_BACKEND_CLASS (klass)->get_icon = deja_dup_backend_u1_real_get_icon;
	DEJA_DUP_BACKEND_CLASS (klass)->is_ready = deja_dup_backend_u1_real_is_ready;
	DEJA_DUP_BACKEND_CLASS (klass)->get_location = deja_dup_backend_u1_real_get_location;
	DEJA_DUP_BACKEND_CLASS (klass)->get_location_pretty = deja_dup_backend_u1_real_get_location_pretty;
	DEJA_DUP_BACKEND_CLASS (klass)->get_space = deja_dup_backend_u1_real_get_space;
	DEJA_DUP_BACKEND_CLASS (klass)->get_space_finish = deja_dup_backend_u1_real_get_space_finish;
	DEJA_DUP_BACKEND_CLASS (klass)->get_envp = deja_dup_backend_u1_real_get_envp;
	DEJA_DUP_BACKEND_CLASS (klass)->get_envp_finish = deja_dup_backend_u1_real_get_envp_finish;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_backend_u1_finalize;
}


static void deja_dup_backend_u1_instance_init (DejaDupBackendU1 * self) {
	self->priv = DEJA_DUP_BACKEND_U1_GET_PRIVATE (self);
	self->priv->button_handler = (gulong) 0;
}


static void deja_dup_backend_u1_finalize (GObject* obj) {
	DejaDupBackendU1 * self;
	self = DEJA_DUP_BACKEND_U1 (obj);
	if (self->priv->button_handler > 0) {
		GMountOperation* _tmp0_ = NULL;
		_tmp0_ = deja_dup_backend_get_mount_op ((DejaDupBackend*) self);
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->button_handler);
		self->priv->button_handler = (gulong) 0;
	}
	G_OBJECT_CLASS (deja_dup_backend_u1_parent_class)->finalize (obj);
}


GType deja_dup_backend_u1_get_type (void) {
	static volatile gsize deja_dup_backend_u1_type_id__volatile = 0;
	if (g_once_init_enter (&deja_dup_backend_u1_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DejaDupBackendU1Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_backend_u1_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupBackendU1), 0, (GInstanceInitFunc) deja_dup_backend_u1_instance_init, NULL };
		GType deja_dup_backend_u1_type_id;
		deja_dup_backend_u1_type_id = g_type_register_static (DEJA_DUP_TYPE_BACKEND, "DejaDupBackendU1", &g_define_type_info, 0);
		g_once_init_leave (&deja_dup_backend_u1_type_id__volatile, deja_dup_backend_u1_type_id);
	}
	return deja_dup_backend_u1_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);
}



