/* ovirt-broker.c generated by valac 0.39.5, the Vala compiler
 * generated from ovirt-broker.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <libcommon.h>
#include <stdlib.h>
#include <string.h>
#include <govirt/govirt.h>
#include <gtk/gtk.h>
#include <rest/rest-proxy.h>
#include <rest/oauth-proxy-call.h>
#include <rest/oauth-proxy.h>
#include <rest/oauth2-proxy-call.h>
#include <rest/oauth2-proxy.h>
#include <rest/rest-enum-types.h>
#include <rest/rest-param.h>
#include <rest/rest-params.h>
#include <rest/rest-proxy-auth.h>
#include <rest/rest-proxy-call.h>
#include <rest/rest-xml-node.h>
#include <rest/rest-xml-parser.h>
#include <glib/gi18n-lib.h>


#define BOXES_TYPE_BROKER (boxes_broker_get_type ())
#define BOXES_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_BROKER, BoxesBroker))
#define BOXES_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_BROKER, BoxesBrokerClass))
#define BOXES_IS_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_BROKER))
#define BOXES_IS_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_BROKER))
#define BOXES_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_BROKER, BoxesBrokerClass))

typedef struct _BoxesBroker BoxesBroker;
typedef struct _BoxesBrokerClass BoxesBrokerClass;
typedef struct _BoxesBrokerPrivate BoxesBrokerPrivate;

#define BOXES_TYPE_OVIRT_BROKER (boxes_ovirt_broker_get_type ())
#define BOXES_OVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBroker))
#define BOXES_OVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBrokerClass))
#define BOXES_IS_OVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OVIRT_BROKER))
#define BOXES_IS_OVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OVIRT_BROKER))
#define BOXES_OVIRT_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBrokerClass))

typedef struct _BoxesOvirtBroker BoxesOvirtBroker;
typedef struct _BoxesOvirtBrokerClass BoxesOvirtBrokerClass;
typedef struct _BoxesOvirtBrokerPrivate BoxesOvirtBrokerPrivate;
enum  {
	BOXES_OVIRT_BROKER_0_PROPERTY,
	BOXES_OVIRT_BROKER_NUM_PROPERTIES
};
static GParamSpec* boxes_ovirt_broker_properties[BOXES_OVIRT_BROKER_NUM_PROPERTIES];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_OVIRT_MACHINE (boxes_ovirt_machine_get_type ())
#define BOXES_OVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OVIRT_MACHINE, BoxesOvirtMachine))
#define BOXES_OVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OVIRT_MACHINE, BoxesOvirtMachineClass))
#define BOXES_IS_OVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OVIRT_MACHINE))
#define BOXES_IS_OVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OVIRT_MACHINE))
#define BOXES_OVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OVIRT_MACHINE, BoxesOvirtMachineClass))

typedef struct _BoxesOvirtMachine BoxesOvirtMachine;
typedef struct _BoxesOvirtMachineClass BoxesOvirtMachineClass;

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block105Data Block105Data;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;

#define BOXES_TYPE_NOTIFICATIONBAR (boxes_notificationbar_get_type ())
#define BOXES_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbar))
#define BOXES_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))
#define BOXES_IS_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_IS_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_NOTIFICATIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_NOTIFICATION (boxes_notification_get_type ())
#define BOXES_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATION, BoxesNotification))
#define BOXES_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATION, BoxesNotificationClass))
#define BOXES_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATION))
#define BOXES_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATION))
#define BOXES_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATION, BoxesNotificationClass))

typedef struct _BoxesNotification BoxesNotification;
typedef struct _BoxesNotificationClass BoxesNotificationClass;
#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
typedef struct _BoxesOvirtBrokerAddSourceData BoxesOvirtBrokerAddSourceData;

struct _BoxesBroker {
	GObject parent_instance;
	BoxesBrokerPrivate * priv;
};

struct _BoxesBrokerClass {
	GObjectClass parent_class;
	void (*add_source) (BoxesBroker* self, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*add_source_finish) (BoxesBroker* self, GAsyncResult* _res_, GError** error);
};

struct _BoxesOvirtBroker {
	BoxesBroker parent_instance;
	BoxesOvirtBrokerPrivate * priv;
};

struct _BoxesOvirtBrokerClass {
	BoxesBrokerClass parent_class;
};

struct _BoxesOvirtBrokerPrivate {
	GHashTable* proxies;
};

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollection* collection;
	BoxesAsyncLauncher* async_launcher;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _Block105Data {
	int _ref_count_;
	BoxesOvirtBroker* self;
	RestProxy* proxy;
	RestProxyAuth* auth;
};

typedef void (*BoxesAuthNotificationAuthFunc) (const gchar* username, const gchar* password, void* user_data);
typedef void (*BoxesNotificationDismissFunc) (void* user_data);
struct _BoxesOvirtBrokerAddSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesOvirtBroker* self;
	BoxesCollectionSource* source;
	GHashTable* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gconstpointer _tmp4_;
	gboolean _tmp5_;
	OvirtProxy* proxy;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	OvirtProxy* _tmp9_;
	OvirtProxy* _tmp10_;
	OvirtProxy* _tmp11_;
	OvirtProxy* _tmp12_;
	GByteArray* _tmp13_;
	GByteArray* _tmp14_;
	OvirtProxy* _tmp15_;
	GError* _error_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	BoxesApp* _tmp18_;
	BoxesAppWindow* _tmp19_;
	BoxesAppWindow* _tmp20_;
	BoxesNotificationbar* _tmp21_;
	BoxesNotificationbar* _tmp22_;
	BoxesNotification* _tmp23_;
	BoxesNotification* _tmp24_;
	GHashTable* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	OvirtProxy* _tmp28_;
	OvirtProxy* _tmp29_;
	OvirtProxy* _tmp30_;
	GList* _tmp31_;
	GList* vm_collection;
	GList* vm_it;
	OvirtVm* _tmp32_;
	OvirtVm* vm;
	OvirtProxy* _tmp33_;
	OvirtVm* _tmp34_;
	GError * _inner_error_;
};


static gpointer boxes_ovirt_broker_parent_class = NULL;
static BoxesOvirtBroker* boxes_ovirt_broker_broker;
static BoxesOvirtBroker* boxes_ovirt_broker_broker = NULL;
extern BoxesApp* boxes_app_app;

GType boxes_broker_get_type (void) G_GNUC_CONST;
GType boxes_ovirt_broker_get_type (void) G_GNUC_CONST;
#define BOXES_OVIRT_BROKER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBrokerPrivate))
BoxesOvirtBroker* boxes_ovirt_broker_get_default (void);
static BoxesOvirtBroker* boxes_ovirt_broker_new (void);
static BoxesOvirtBroker* boxes_ovirt_broker_construct (GType object_type);
BoxesBroker* boxes_broker_construct (GType object_type);
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static void boxes_ovirt_broker_add_vm (BoxesOvirtBroker* self,
                                BoxesCollectionSource* source,
                                OvirtProxy* proxy,
                                OvirtVm* vm);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_ovirt_machine_get_type (void) G_GNUC_CONST;
BoxesOvirtMachine* boxes_ovirt_machine_new (BoxesCollectionSource* source,
                                            OvirtProxy* proxy,
                                            OvirtVm* vm,
                                            GError** error);
BoxesOvirtMachine* boxes_ovirt_machine_construct (GType object_type,
                                                  BoxesCollectionSource* source,
                                                  OvirtProxy* proxy,
                                                  OvirtVm* vm,
                                                  GError** error);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
void boxes_collection_add_item (BoxesCollection* self,
                                BoxesCollectionItem* item);
static void boxes_ovirt_broker_real_add_source_data_free (gpointer _data);
static void boxes_ovirt_broker_real_add_source_async_ready_wrapper (GObject *source_object,
                                                             GAsyncResult *res,
                                                             void *user_data);
static void boxes_ovirt_broker_real_add_source (BoxesBroker* base,
                                         BoxesCollectionSource* source,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static gboolean boxes_ovirt_broker_real_add_source_co (BoxesOvirtBrokerAddSourceData* _data_);
static gboolean __lambda243_ (BoxesOvirtBroker* self,
                       RestProxy* proxy,
                       RestProxyAuth* auth,
                       gboolean retrying);
static Block105Data* block105_data_ref (Block105Data* _data105_);
static void block105_data_unref (void * _userdata_);
static void __lambda244_ (Block105Data* _data105_,
                   const gchar* username,
                   const gchar* password);
static void ___lambda244__boxes_auth_notification_auth_func (const gchar* username,
                                                      const gchar* password,
                                                      gpointer self);
static void __lambda245_ (Block105Data* _data105_);
static void ___lambda245__boxes_notification_dismiss_func (gpointer self);
GType boxes_app_window_get_type (void) G_GNUC_CONST;
BoxesAppWindow* boxes_app_get_main_window (BoxesApp* self);
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
BoxesNotificationbar* boxes_app_window_get_notificationbar (BoxesAppWindow* self);
GType boxes_notification_get_type (void) G_GNUC_CONST;
BoxesNotification* boxes_notificationbar_display_for_optional_auth (BoxesNotificationbar* self,
                                                                    const gchar* broker_name,
                                                                    BoxesAuthNotificationAuthFunc auth_func,
                                                                    void* auth_func_target,
                                                                    GDestroyNotify auth_func_target_destroy_notify,
                                                                    BoxesNotificationDismissFunc dismiss_func,
                                                                    void* dismiss_func_target,
                                                                    GDestroyNotify dismiss_func_target_destroy_notify);
static gboolean ___lambda243__rest_proxy_authenticate (RestProxy* _sender,
                                                RestProxyAuth* auth,
                                                gboolean retrying,
                                                gpointer self);
static void boxes_ovirt_broker_add_source_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
BoxesNotification* boxes_notificationbar_display_error (BoxesNotificationbar* self,
                                                        const gchar* message,
                                                        gint timeout);
#define BOXES_NOTIFICATIONBAR_DEFAULT_TIMEOUT 6
void boxes_broker_add_source (BoxesBroker* self,
                              BoxesCollectionSource* source,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
void boxes_broker_add_source_finish (BoxesBroker* self,
                                     GAsyncResult* _res_,
                                     GError** error);
static void boxes_ovirt_broker_finalize (GObject * obj);


static gpointer
_g_object_ref0 (gpointer self)
{
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return self ? g_object_ref (self) : NULL;
#line 338 "ovirt-broker.c"
}


BoxesOvirtBroker*
boxes_ovirt_broker_get_default (void)
{
	BoxesOvirtBroker* result = NULL;
	BoxesOvirtBroker* _tmp0_;
	BoxesOvirtBroker* _tmp2_;
	BoxesOvirtBroker* _tmp3_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = boxes_ovirt_broker_broker;
#line 9 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_tmp0_ == NULL) {
#line 353 "ovirt-broker.c"
		BoxesOvirtBroker* _tmp1_;
#line 10 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp1_ = boxes_ovirt_broker_new ();
#line 10 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (boxes_ovirt_broker_broker);
#line 10 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		boxes_ovirt_broker_broker = _tmp1_;
#line 361 "ovirt-broker.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = boxes_ovirt_broker_broker;
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	result = _tmp3_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return result;
#line 371 "ovirt-broker.c"
}


static void
_g_free0_ (gpointer var)
{
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	var = (g_free (var), NULL);
#line 380 "ovirt-broker.c"
}


static void
_g_object_unref0_ (gpointer var)
{
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 389 "ovirt-broker.c"
}


static BoxesOvirtBroker*
boxes_ovirt_broker_construct (GType object_type)
{
	BoxesOvirtBroker * self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
#line 15 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = (BoxesOvirtBroker*) boxes_broker_construct (object_type);
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = g_str_hash;
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = g_str_equal;
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_hash_table_unref0 (self->priv->proxies);
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self->priv->proxies = _tmp2_;
#line 15 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return self;
#line 414 "ovirt-broker.c"
}


static BoxesOvirtBroker*
boxes_ovirt_broker_new (void)
{
#line 15 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return boxes_ovirt_broker_construct (BOXES_TYPE_OVIRT_BROKER);
#line 423 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_add_vm (BoxesOvirtBroker* self,
                           BoxesCollectionSource* source,
                           OvirtProxy* proxy,
                           OvirtVm* vm)
{
	GError * _inner_error_ = NULL;
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (self != NULL);
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (source != NULL);
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (proxy != NULL);
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (vm != NULL);
#line 442 "ovirt-broker.c"
	{
		BoxesOvirtMachine* machine = NULL;
		BoxesOvirtMachine* _tmp0_;
		BoxesApp* _tmp1_;
		BoxesCollection* _tmp2_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp0_ = boxes_ovirt_machine_new (source, proxy, vm, &_inner_error_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		machine = _tmp0_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 454 "ovirt-broker.c"
			goto __catch154_g_error;
		}
#line 22 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp1_ = boxes_app_app;
#line 22 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp2_ = _tmp1_->collection;
#line 22 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		boxes_collection_add_item (_tmp2_, (BoxesCollectionItem*) machine);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (machine);
#line 465 "ovirt-broker.c"
	}
	goto __finally154;
	__catch154_g_error:
	{
		GError* _error_ = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_error_ = _inner_error_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_inner_error_ = NULL;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp3_ = boxes_collection_source_get_name (source);
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp4_ = _tmp3_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp5_ = _tmp4_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp6_ = _error_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp7_ = _tmp6_->message;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_warning ("ovirt-broker.vala:24: Failed to create source '%s': %s", _tmp5_, _tmp7_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_free0 (_tmp5_);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_error_free0 (_error_);
#line 496 "ovirt-broker.c"
	}
	__finally154:
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		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);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_clear_error (&_inner_error_);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return;
#line 507 "ovirt-broker.c"
	}
}


static void
boxes_ovirt_broker_real_add_source_data_free (gpointer _data)
{
	BoxesOvirtBrokerAddSourceData* _data_;
	_data_ = _data;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->source);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->self);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_slice_free (BoxesOvirtBrokerAddSourceData, _data_);
#line 523 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_real_add_source_async_ready_wrapper (GObject *source_object,
                                                        GAsyncResult *res,
                                                        void *user_data)
{
	BoxesOvirtBrokerAddSourceData* _task_data_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_task_data_->_callback_ != NULL) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 539 "ovirt-broker.c"
	}
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_task_data_->_task_complete_ = TRUE;
#line 543 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_real_add_source (BoxesBroker* base,
                                    BoxesCollectionSource* source,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	BoxesOvirtBroker * self;
	BoxesOvirtBrokerAddSourceData* _data_;
	BoxesOvirtBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = (BoxesOvirtBroker*) base;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_ = g_slice_new0 (BoxesOvirtBrokerAddSourceData);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_callback_ = _callback_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_ovirt_broker_real_add_source_async_ready_wrapper, _user_data_);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_callback_ == NULL) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_task_complete_ = TRUE;
#line 569 "ovirt-broker.c"
	}
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_ovirt_broker_real_add_source_data_free);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->self = _tmp0_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = _g_object_ref0 (source);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->source);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->source = _tmp1_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	boxes_ovirt_broker_real_add_source_co (_data_);
#line 585 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_real_add_source_finish (BoxesBroker* base,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	BoxesOvirtBrokerAddSourceData* _data_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (NULL == _data_) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return;
#line 601 "ovirt-broker.c"
	}
}


static Block105Data*
block105_data_ref (Block105Data* _data105_)
{
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_atomic_int_inc (&_data105_->_ref_count_);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return _data105_;
#line 613 "ovirt-broker.c"
}


static void
block105_data_unref (void * _userdata_)
{
	Block105Data* _data105_;
	_data105_ = (Block105Data*) _userdata_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (g_atomic_int_dec_and_test (&_data105_->_ref_count_)) {
#line 624 "ovirt-broker.c"
		BoxesOvirtBroker* self;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		self = _data105_->self;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data105_->proxy);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data105_->auth);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (self);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_slice_free (Block105Data, _data105_);
#line 636 "ovirt-broker.c"
	}
}


static void
__lambda244_ (Block105Data* _data105_,
              const gchar* username,
              const gchar* password)
{
	BoxesOvirtBroker* self;
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = _data105_->self;
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (username != NULL);
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (password != NULL);
#line 39 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_object_set (_data105_->proxy, "username", username, NULL);
#line 40 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_object_set (_data105_->proxy, "password", password, NULL);
#line 41 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	rest_proxy_auth_unpause (_data105_->auth);
#line 659 "ovirt-broker.c"
}


static void
___lambda244__boxes_auth_notification_auth_func (const gchar* username,
                                                 const gchar* password,
                                                 gpointer self)
{
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	__lambda244_ (self, username, password);
#line 670 "ovirt-broker.c"
}


static void
__lambda245_ (Block105Data* _data105_)
{
	BoxesOvirtBroker* self;
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = _data105_->self;
#line 46 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	rest_proxy_auth_unpause (_data105_->auth);
#line 682 "ovirt-broker.c"
}


static void
___lambda245__boxes_notification_dismiss_func (gpointer self)
{
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	__lambda245_ (self);
#line 691 "ovirt-broker.c"
}


static gboolean
__lambda243_ (BoxesOvirtBroker* self,
              RestProxy* proxy,
              RestProxyAuth* auth,
              gboolean retrying)
{
	gboolean result = FALSE;
	Block105Data* _data105_;
	RestProxy* _tmp0_;
	RestProxyAuth* _tmp1_;
	BoxesAuthNotificationAuthFunc auth_cb = NULL;
	void* auth_cb_target;
	GDestroyNotify auth_cb_target_destroy_notify;
	BoxesNotificationDismissFunc cancel_cb = NULL;
	void* cancel_cb_target;
	GDestroyNotify cancel_cb_target_destroy_notify;
	BoxesApp* _tmp2_;
	BoxesAppWindow* _tmp3_;
	BoxesAppWindow* _tmp4_;
	BoxesNotificationbar* _tmp5_;
	BoxesNotificationbar* _tmp6_;
	BoxesAuthNotificationAuthFunc _tmp7_;
	void* _tmp7__target;
	GDestroyNotify _tmp7__target_destroy_notify;
	BoxesNotificationDismissFunc _tmp8_;
	void* _tmp8__target;
	GDestroyNotify _tmp8__target_destroy_notify;
	BoxesNotification* _tmp9_;
	BoxesNotification* _tmp10_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_val_if_fail (proxy != NULL, FALSE);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_val_if_fail (auth != NULL, FALSE);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data105_ = g_slice_new0 (Block105Data);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data105_->_ref_count_ = 1;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data105_->self = g_object_ref (self);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = _g_object_ref0 (proxy);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data105_->proxy);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data105_->proxy = _tmp0_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = _g_object_ref0 (auth);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data105_->auth);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data105_->auth = _tmp1_;
#line 35 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (retrying) {
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		result = FALSE;
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		block105_data_unref (_data105_);
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data105_ = NULL;
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return result;
#line 756 "ovirt-broker.c"
	}
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb = ___lambda244__boxes_auth_notification_auth_func;
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target = block105_data_ref (_data105_);
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target_destroy_notify = block105_data_unref;
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb = ___lambda245__boxes_notification_dismiss_func;
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target = block105_data_ref (_data105_);
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target_destroy_notify = block105_data_unref;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = boxes_app_app;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp3_ = boxes_app_get_main_window (_tmp2_);
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp4_ = _tmp3_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp5_ = boxes_app_window_get_notificationbar (_tmp4_);
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp6_ = _tmp5_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp7_ = auth_cb;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp7__target = auth_cb_target;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp7__target_destroy_notify = auth_cb_target_destroy_notify;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target_destroy_notify = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp8_ = cancel_cb;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp8__target = cancel_cb_target;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp8__target_destroy_notify = cancel_cb_target_destroy_notify;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target_destroy_notify = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp9_ = boxes_notificationbar_display_for_optional_auth (_tmp6_, "oVirt broker", _tmp7_, _tmp7__target, _tmp7__target_destroy_notify, _tmp8_, _tmp8__target, _tmp8__target_destroy_notify);
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp10_ = _tmp9_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_tmp10_);
#line 49 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	rest_proxy_auth_pause (_data105_->auth);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	result = FALSE;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	(cancel_cb_target_destroy_notify == NULL) ? NULL : (cancel_cb_target_destroy_notify (cancel_cb_target), NULL);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target_destroy_notify = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	(auth_cb_target_destroy_notify == NULL) ? NULL : (auth_cb_target_destroy_notify (auth_cb_target), NULL);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target_destroy_notify = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	block105_data_unref (_data105_);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data105_ = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return result;
#line 836 "ovirt-broker.c"
}


static gboolean
___lambda243__rest_proxy_authenticate (RestProxy* _sender,
                                       RestProxyAuth* auth,
                                       gboolean retrying,
                                       gpointer self)
{
	gboolean result;
	result = __lambda243_ ((BoxesOvirtBroker*) self, _sender, auth, retrying);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return result;
#line 850 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_add_source_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	BoxesOvirtBrokerAddSourceData* _data_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_ = _user_data_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_source_object_ = source_object;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_res_ = _res_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_task_complete_ = TRUE;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	boxes_ovirt_broker_real_add_source_co (_data_);
#line 870 "ovirt-broker.c"
}


static gboolean
boxes_ovirt_broker_real_add_source_co (BoxesOvirtBrokerAddSourceData* _data_)
{
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	switch (_data_->_state_) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 0:
#line 881 "ovirt-broker.c"
		goto _state_0;
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 1:
#line 885 "ovirt-broker.c"
		goto _state_1;
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 2:
#line 889 "ovirt-broker.c"
		goto _state_2;
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 3:
#line 893 "ovirt-broker.c"
		goto _state_3;
		default:
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_assert_not_reached ();
#line 898 "ovirt-broker.c"
	}
	_state_0:
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp0_ = _data_->self->priv->proxies;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp1_ = boxes_collection_source_get_name (_data_->source);
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp2_ = _data_->_tmp1_;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp3_ = _data_->_tmp2_;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp4_ = g_hash_table_lookup (_data_->_tmp0_, _data_->_tmp3_);
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp5_ = ((OvirtProxy*) _data_->_tmp4_) != NULL;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_free0 (_data_->_tmp3_);
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_data_->_tmp5_) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (_data_->_state_ != 0) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 925 "ovirt-broker.c"
			}
		}
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_object_unref (_data_->_async_result);
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 932 "ovirt-broker.c"
	}
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp6_ = boxes_collection_source_get_uri (_data_->source);
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp7_ = _data_->_tmp6_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp8_ = _data_->_tmp7_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp9_ = ovirt_proxy_new (_data_->_tmp8_);
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp10_ = _data_->_tmp9_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_free0 (_data_->_tmp8_);
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->proxy = _data_->_tmp10_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp11_ = _data_->proxy;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_signal_connect_object ((RestProxy*) _data_->_tmp11_, "authenticate", (GCallback) ___lambda243__rest_proxy_authenticate, _data_->self, 0);
#line 952 "ovirt-broker.c"
	{
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp12_ = _data_->proxy;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_state_ = 1;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		ovirt_proxy_fetch_ca_certificate_async (_data_->_tmp12_, NULL, boxes_ovirt_broker_add_source_ready, _data_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 962 "ovirt-broker.c"
		_state_1:
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp13_ = ovirt_proxy_fetch_ca_certificate_finish (_data_->_tmp12_, _data_->_res_, &_data_->_inner_error_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp14_ = _data_->_tmp13_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_byte_array_unref0 (_data_->_tmp14_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 972 "ovirt-broker.c"
			goto __catch155_g_error;
		}
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp15_ = _data_->proxy;
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_state_ = 2;
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		ovirt_proxy_fetch_vms_async (_data_->_tmp15_, NULL, boxes_ovirt_broker_add_source_ready, _data_);
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 983 "ovirt-broker.c"
		_state_2:
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		ovirt_proxy_fetch_vms_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 989 "ovirt-broker.c"
			goto __catch155_g_error;
		}
	}
	goto __finally155;
	__catch155_g_error:
	{
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_inner_error_ = NULL;
#line 58 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp16_ = _data_->_error_;
#line 58 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp17_ = _data_->_tmp16_->message;
#line 58 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_debug ("ovirt-broker.vala:58: Failed to connect to broker: %s", _data_->_tmp17_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp18_ = boxes_app_app;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp19_ = boxes_app_get_main_window (_data_->_tmp18_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp20_ = _data_->_tmp19_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp21_ = boxes_app_window_get_notificationbar (_data_->_tmp20_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp22_ = _data_->_tmp21_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp23_ = boxes_notificationbar_display_error (_data_->_tmp22_, _ ("Connection to oVirt broker failed"), BOXES_NOTIFICATIONBAR_DEFAULT_TIMEOUT);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp24_ = _data_->_tmp23_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data_->_tmp24_);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_error_free0 (_data_->_error_);
#line 1024 "ovirt-broker.c"
	}
	__finally155:
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data_->proxy);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_object_unref (_data_->_async_result);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 1037 "ovirt-broker.c"
	}
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp25_ = _data_->self->priv->proxies;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp26_ = boxes_collection_source_get_name (_data_->source);
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp27_ = _data_->_tmp26_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp28_ = _data_->proxy;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp29_ = _g_object_ref0 (_data_->_tmp28_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_hash_table_insert (_data_->_tmp25_, _data_->_tmp27_, _data_->_tmp29_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp30_ = _data_->proxy;
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp31_ = ovirt_proxy_get_vms (_data_->_tmp30_);
#line 1055 "ovirt-broker.c"
	{
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->vm_collection = _data_->_tmp31_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		for (_data_->vm_it = _data_->vm_collection; _data_->vm_it != NULL; _data_->vm_it = _data_->vm_it->next) {
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			_data_->_tmp32_ = _g_object_ref0 ((OvirtVm*) _data_->vm_it->data);
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			_data_->vm = _data_->_tmp32_;
#line 1065 "ovirt-broker.c"
			{
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_data_->_tmp33_ = _data_->proxy;
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_data_->_tmp34_ = _data_->vm;
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				boxes_ovirt_broker_add_vm (_data_->self, _data_->source, _data_->_tmp33_, _data_->_tmp34_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_g_object_unref0 (_data_->vm);
#line 1075 "ovirt-broker.c"
			}
		}
	}
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_state_ = 3;
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	BOXES_BROKER_CLASS (boxes_ovirt_broker_parent_class)->add_source (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, BOXES_TYPE_BROKER, BoxesBroker), _data_->source, boxes_ovirt_broker_add_source_ready, _data_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return FALSE;
#line 1085 "ovirt-broker.c"
	_state_3:
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	BOXES_BROKER_CLASS (boxes_ovirt_broker_parent_class)->add_source_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, BOXES_TYPE_BROKER, BoxesBroker), _data_->_res_, &_data_->_inner_error_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data_->proxy);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_object_unref (_data_->_async_result);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 1099 "ovirt-broker.c"
	}
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->proxy);
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_data_->_state_ != 0) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1111 "ovirt-broker.c"
		}
	}
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_object_unref (_data_->_async_result);
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return FALSE;
#line 1118 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_class_init (BoxesOvirtBrokerClass * klass)
{
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	boxes_ovirt_broker_parent_class = g_type_class_peek_parent (klass);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_type_class_add_private (klass, sizeof (BoxesOvirtBrokerPrivate));
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	((BoxesBrokerClass *) klass)->add_source = (void (*) (BoxesBroker *, BoxesCollectionSource*, GAsyncReadyCallback, gpointer)) boxes_ovirt_broker_real_add_source;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	((BoxesBrokerClass *) klass)->add_source_finish = (void (*) (BoxesBroker *, GAsyncResult*, GError**)) boxes_ovirt_broker_real_add_source_finish;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_ovirt_broker_finalize;
#line 1135 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_instance_init (BoxesOvirtBroker * self)
{
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self->priv = BOXES_OVIRT_BROKER_GET_PRIVATE (self);
#line 1144 "ovirt-broker.c"
}


static void
boxes_ovirt_broker_finalize (GObject * obj)
{
	BoxesOvirtBroker * self;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBroker);
#line 6 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_hash_table_unref0 (self->priv->proxies);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	G_OBJECT_CLASS (boxes_ovirt_broker_parent_class)->finalize (obj);
#line 1158 "ovirt-broker.c"
}


GType
boxes_ovirt_broker_get_type (void)
{
	static volatile gsize boxes_ovirt_broker_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_ovirt_broker_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesOvirtBrokerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_ovirt_broker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesOvirtBroker), 0, (GInstanceInitFunc) boxes_ovirt_broker_instance_init, NULL };
		GType boxes_ovirt_broker_type_id;
		boxes_ovirt_broker_type_id = g_type_register_static (BOXES_TYPE_BROKER, "BoxesOvirtBroker", &g_define_type_info, 0);
		g_once_init_leave (&boxes_ovirt_broker_type_id__volatile, boxes_ovirt_broker_type_id);
	}
	return boxes_ovirt_broker_type_id__volatile;
}



