/* downloader.c generated by valac 0.18.0.29-efcd0, the Vala compiler
 * generated from downloader.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <libsoup/soup.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <osinfo/osinfo.h>
#include <libcommon.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>


#define BOXES_TYPE_DOWNLOADER (boxes_downloader_get_type ())
#define BOXES_DOWNLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DOWNLOADER, BoxesDownloader))
#define BOXES_DOWNLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DOWNLOADER, BoxesDownloaderClass))
#define BOXES_IS_DOWNLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DOWNLOADER))
#define BOXES_IS_DOWNLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DOWNLOADER))
#define BOXES_DOWNLOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DOWNLOADER, BoxesDownloaderClass))

typedef struct _BoxesDownloader BoxesDownloader;
typedef struct _BoxesDownloaderClass BoxesDownloaderClass;
typedef struct _BoxesDownloaderPrivate BoxesDownloaderPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block59Data Block59Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesDownloaderDownloadData BoxesDownloaderDownloadData;
typedef struct _BoxesDownloaderFetchOsLogoData BoxesDownloaderFetchOsLogoData;
typedef struct _Block60Data Block60Data;
typedef struct _BoxesDownloaderAwaitDownloadData BoxesDownloaderAwaitDownloadData;

struct _BoxesDownloader {
	GObject parent_instance;
	BoxesDownloaderPrivate * priv;
};

struct _BoxesDownloaderClass {
	GObjectClass parent_class;
};

struct _BoxesDownloaderPrivate {
	SoupSessionAsync* session;
	GHashTable* downloads;
};

struct _Block59Data {
	int _ref_count_;
	BoxesDownloader * self;
	gpointer _async_data_;
};

struct _BoxesDownloaderDownloadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesDownloader* self;
	GFile* remote_file;
	gchar* cached_path;
	GFile* result;
	Block59Data* _data59_;
	GFile* _tmp0_;
	gchar* _tmp1_;
	gchar* uri;
	GHashTable* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GFile* _tmp7_;
	GFile* _tmp8_;
	const gchar* _tmp9_;
	GFile* _tmp10_;
	GFile* cached_file;
	GFile* _tmp11_;
	gboolean _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GHashTable* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	GFile* _tmp19_;
	GFile* _tmp20_;
	const gchar* _tmp21_;
	SoupMessage* _tmp22_;
	SoupMessage* msg;
	SoupSessionAsync* _tmp23_;
	SoupMessage* _tmp24_;
	SoupMessage* _tmp25_;
	SoupMessage* _tmp26_;
	guint _tmp27_;
	guint _tmp28_;
	SoupMessage* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	GError* _tmp33_;
	GError* _tmp34_;
	GFile* _tmp35_;
	SoupMessage* _tmp36_;
	SoupMessageBody* _tmp37_;
	guint8* _tmp38_;
	gint _tmp38__length1;
	GError* _error_;
	const gchar* _tmp39_;
	GFile* _tmp40_;
	GError* _tmp41_;
	GError* _tmp42_;
	GError* _tmp43_;
	GHashTable* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	GFile* _tmp49_;
	GError * _inner_error_;
};

struct _BoxesDownloaderFetchOsLogoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	GtkImage* image;
	OsinfoOs* os;
	gint size;
	OsinfoOs* _tmp0_;
	gchar* _tmp1_;
	gchar* logo_url;
	const gchar* _tmp2_;
	OsinfoOs* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GFile* _tmp8_;
	GFile* remote_file;
	GFile* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* cached_path;
	BoxesDownloader* _tmp14_;
	BoxesDownloader* _tmp15_;
	GFile* _tmp16_;
	const gchar* _tmp17_;
	GFile* _tmp18_;
	GFile* _tmp19_;
	GFile* cached_file;
	GFile* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gint _tmp23_;
	gint _tmp24_;
	GdkPixbuf* _tmp25_;
	GdkPixbuf* _tmp26_;
	GdkPixbuf* pixbuf;
	GtkImage* _tmp27_;
	GdkPixbuf* _tmp28_;
	GError* _error_;
	const gchar* _tmp29_;
	GError* _tmp30_;
	const gchar* _tmp31_;
	GError * _inner_error_;
};

struct _Block60Data {
	int _ref_count_;
	BoxesDownloader * self;
	GFile* downloaded_file;
	GError* download_error;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gchar* uri;
	gpointer _async_data_;
};

struct _BoxesDownloaderAwaitDownloadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesDownloader* self;
	gchar* uri;
	gchar* cached_path;
	GFile* result;
	Block60Data* _data60_;
	const gchar* _tmp0_;
	gulong _tmp1_;
	gulong downloaded_id;
	gulong _tmp2_;
	gulong downloaded_failed_id;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GError* _tmp5_;
	GFile* cached_file;
	gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gboolean _tmp9_;
	const gchar* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GFile* _tmp13_;
	GError * _inner_error_;
};


static gpointer boxes_downloader_parent_class = NULL;
static BoxesDownloader* boxes_downloader_downloader;
static BoxesDownloader* boxes_downloader_downloader = NULL;

GType boxes_downloader_get_type (void) G_GNUC_CONST;
#define BOXES_DOWNLOADER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_DOWNLOADER, BoxesDownloaderPrivate))
enum  {
	BOXES_DOWNLOADER_DUMMY_PROPERTY
};
BoxesDownloader* boxes_downloader_get_instance (void);
static BoxesDownloader* boxes_downloader_new (void);
static BoxesDownloader* boxes_downloader_construct (GType object_type);
static gchar* boxes_downloader_fetch_os_logo_url (OsinfoOs* os);
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static void boxes_downloader_download_data_free (gpointer _data);
void boxes_downloader_download (BoxesDownloader* self, GFile* remote_file, const gchar* cached_path, GAsyncReadyCallback _callback_, gpointer _user_data_);
GFile* boxes_downloader_download_finish (BoxesDownloader* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_downloader_download_co (BoxesDownloaderDownloadData* _data_);
static Block59Data* block59_data_ref (Block59Data* _data59_);
static void block59_data_unref (void * _userdata_);
static void boxes_downloader_await_download (BoxesDownloader* self, const gchar* uri, const gchar* cached_path, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GFile* boxes_downloader_await_download_finish (BoxesDownloader* self, GAsyncResult* _res_, GError** error);
static void boxes_downloader_download_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void ___lambda145_ (Block59Data* _data59_, SoupSession* session, SoupMessage* msg);
static void ____lambda145__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self);
static void boxes_downloader_fetch_os_logo_data_free (gpointer _data);
void boxes_downloader_fetch_os_logo (GtkImage* image, OsinfoOs* os, gint size, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_downloader_fetch_os_logo_finish (GAsyncResult* _res_);
static gboolean boxes_downloader_fetch_os_logo_co (BoxesDownloaderFetchOsLogoData* _data_);
static void boxes_downloader_fetch_os_logo_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_downloader_await_download_data_free (gpointer _data);
static gboolean boxes_downloader_await_download_co (BoxesDownloaderAwaitDownloadData* _data_);
static Block60Data* block60_data_ref (Block60Data* _data60_);
static void block60_data_unref (void * _userdata_);
static gboolean _boxes_downloader_await_download_co_gsource_func (gpointer self);
static void __lambda143_ (Block60Data* _data60_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file);
static void ___lambda143__boxes_downloader_downloaded (BoxesDownloader* _sender, const gchar* uri, GFile* cached_file, gpointer self);
static void __lambda144_ (Block60Data* _data60_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file, GError* _error_);
static void ___lambda144__boxes_downloader_download_failed (BoxesDownloader* _sender, const gchar* uri, GFile* cached_file, GError* _error_, gpointer self);
static void boxes_downloader_await_download_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void g_cclosure_user_marshal_VOID__STRING_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__STRING_OBJECT_POINTER (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void boxes_downloader_finalize (GObject* obj);


static gpointer _g_object_ref0 (gpointer self) {
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return self ? g_object_ref (self) : NULL;
#line 268 "downloader.c"
}


BoxesDownloader* boxes_downloader_get_instance (void) {
	BoxesDownloader* result = NULL;
	BoxesDownloader* _tmp0_;
	BoxesDownloader* _tmp2_;
	BoxesDownloader* _tmp3_;
#line 13 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = boxes_downloader_downloader;
#line 13 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_tmp0_ == NULL) {
#line 281 "downloader.c"
		BoxesDownloader* _tmp1_;
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp1_ = boxes_downloader_new ();
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (boxes_downloader_downloader);
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		boxes_downloader_downloader = _tmp1_;
#line 289 "downloader.c"
	}
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = boxes_downloader_downloader;
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	result = _tmp3_;
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return result;
#line 299 "downloader.c"
}


static gchar* boxes_downloader_fetch_os_logo_url (OsinfoOs* os) {
	gchar* result = NULL;
	OsinfoOs* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* logo_url;
	OsinfoOs* _tmp7_;
	OsinfoProductList* _tmp8_ = NULL;
	OsinfoProductList* derived;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = os;
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = osinfo_product_get_logo ((OsinfoProduct*) _tmp0_);
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = _tmp1_;
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_tmp2_ != NULL) {
#line 322 "downloader.c"
		OsinfoOs* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
#line 21 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp3_ = os;
#line 21 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp4_ = osinfo_product_get_logo ((OsinfoProduct*) _tmp3_);
#line 21 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp5_ = _tmp4_;
#line 21 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp6_ = g_strdup (_tmp5_);
#line 21 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		result = _tmp6_;
#line 21 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return result;
#line 339 "downloader.c"
	}
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	logo_url = NULL;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp7_ = os;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp8_ = osinfo_product_get_related ((OsinfoProduct*) _tmp7_, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM);
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	derived = _tmp8_;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	while (TRUE) {
#line 351 "downloader.c"
		gboolean _tmp9_ = FALSE;
		OsinfoProductList* _tmp10_;
		gint _tmp11_ = 0;
		gboolean _tmp13_;
		OsinfoProductList* _tmp14_;
		OsinfoEntity* _tmp15_ = NULL;
		OsinfoOs* _tmp16_;
		OsinfoOs* parent;
		OsinfoOs* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp10_ = derived;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp11_ = osinfo_list_get_length ((OsinfoList*) _tmp10_);
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_tmp11_ > 0) {
#line 369 "downloader.c"
			const gchar* _tmp12_;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp12_ = logo_url;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp9_ = _tmp12_ == NULL;
#line 375 "downloader.c"
		} else {
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp9_ = FALSE;
#line 379 "downloader.c"
		}
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp13_ = _tmp9_;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (!_tmp13_) {
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			break;
#line 387 "downloader.c"
		}
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp14_ = derived;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp15_ = osinfo_list_get_nth ((OsinfoList*) _tmp14_, 0);
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, osinfo_os_get_type ()) ? ((OsinfoOs*) _tmp15_) : NULL);
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		parent = _tmp16_;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp17_ = parent;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp18_ = osinfo_product_get_logo ((OsinfoProduct*) _tmp17_);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_tmp19_ = _tmp18_;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_tmp19_ != NULL) {
#line 405 "downloader.c"
			OsinfoOs* _tmp20_;
			const gchar* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp20_ = parent;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp21_ = osinfo_product_get_logo ((OsinfoProduct*) _tmp20_);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp22_ = _tmp21_;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp23_ = g_strdup (_tmp22_);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_free0 (logo_url);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			logo_url = _tmp23_;
#line 422 "downloader.c"
		} else {
			OsinfoOs* _tmp24_;
			OsinfoProductList* _tmp25_ = NULL;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp24_ = parent;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp25_ = osinfo_product_get_related ((OsinfoProduct*) _tmp24_, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (derived);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			derived = _tmp25_;
#line 434 "downloader.c"
		}
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (parent);
#line 438 "downloader.c"
	}
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	result = logo_url;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (derived);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return result;
#line 446 "downloader.c"
}


static void _g_free0_ (gpointer var) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	var = (g_free (var), NULL);
#line 453 "downloader.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 460 "downloader.c"
}


static BoxesDownloader* boxes_downloader_construct (GType object_type) {
	BoxesDownloader * self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	SoupSessionAsync* _tmp3_;
	SoupSessionAsync* _tmp4_;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = (BoxesDownloader*) g_object_new (object_type, NULL);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = g_str_hash;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = g_str_equal;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_hash_table_unref0 (self->priv->downloads);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self->priv->downloads = _tmp2_;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = (SoupSessionAsync*) soup_session_async_new ();
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (self->priv->session);
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self->priv->session = _tmp3_;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp4_ = self->priv->session;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	soup_session_add_feature_by_type ((SoupSession*) _tmp4_, soup_proxy_resolver_default_get_type ());
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return self;
#line 495 "downloader.c"
}


static BoxesDownloader* boxes_downloader_new (void) {
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return boxes_downloader_construct (BOXES_TYPE_DOWNLOADER);
#line 502 "downloader.c"
}


static void boxes_downloader_download_data_free (gpointer _data) {
	BoxesDownloaderDownloadData* _data_;
	_data_ = _data;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->remote_file);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->cached_path);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->result);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->self);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_slice_free (BoxesDownloaderDownloadData, _data_);
#line 519 "downloader.c"
}


void boxes_downloader_download (BoxesDownloader* self, GFile* remote_file, const gchar* cached_path, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesDownloaderDownloadData* _data_;
	BoxesDownloader* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_slice_new0 (BoxesDownloaderDownloadData);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_downloader_download);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_downloader_download_data_free);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->self = _tmp0_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = remote_file;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->remote_file);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->remote_file = _tmp2_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = cached_path;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->cached_path);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_path = _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_co (_data_);
#line 558 "downloader.c"
}


GFile* boxes_downloader_download_finish (BoxesDownloader* self, GAsyncResult* _res_, GError** error) {
	GFile* result;
	BoxesDownloaderDownloadData* _data_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return NULL;
#line 569 "downloader.c"
	}
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	result = _data_->result;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->result = NULL;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return result;
#line 579 "downloader.c"
}


static Block59Data* block59_data_ref (Block59Data* _data59_) {
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_atomic_int_inc (&_data59_->_ref_count_);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return _data59_;
#line 588 "downloader.c"
}


static void block59_data_unref (void * _userdata_) {
	Block59Data* _data59_;
	_data59_ = (Block59Data*) _userdata_;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_atomic_int_dec_and_test (&_data59_->_ref_count_)) {
#line 597 "downloader.c"
		BoxesDownloader * self;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		self = _data59_->self;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (self);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_slice_free (Block59Data, _data59_);
#line 605 "downloader.c"
	}
}


static void boxes_downloader_download_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesDownloaderDownloadData* _data_;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = _user_data_;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_source_object_ = source_object;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_res_ = _res_;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_co (_data_);
#line 620 "downloader.c"
}


static void ___lambda145_ (Block59Data* _data59_, SoupSession* session, SoupMessage* msg) {
	BoxesDownloader * self;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data59_->self;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (session != NULL);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (msg != NULL);
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_co (_data59_->_async_data_);
#line 634 "downloader.c"
}


static void ____lambda145__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self) {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	___lambda145_ (self, session, msg);
#line 641 "downloader.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return self ? g_error_copy (self) : NULL;
#line 648 "downloader.c"
}


static gboolean boxes_downloader_download_co (BoxesDownloaderDownloadData* _data_) {
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	switch (_data_->_state_) {
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 0:
#line 657 "downloader.c"
		goto _state_0;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 661 "downloader.c"
		goto _state_1;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 2:
#line 665 "downloader.c"
		goto _state_2;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 3:
#line 669 "downloader.c"
		goto _state_3;
		default:
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 674 "downloader.c"
	}
	_state_0:
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data59_ = g_slice_new0 (Block59Data);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data59_->_ref_count_ = 1;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data59_->self = g_object_ref (_data_->self);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data59_->_async_data_ = _data_;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->remote_file;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = NULL;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = g_file_get_uri (_data_->_tmp0_);
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->uri = _data_->_tmp1_;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = _data_->self->priv->downloads;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->uri;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = FALSE;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = g_hash_table_contains (_data_->_tmp2_, _data_->_tmp3_);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp4_) {
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp5_ = _data_->uri;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp6_ = _data_->cached_path;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 1;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		boxes_downloader_await_download (_data_->self, _data_->_tmp5_, _data_->_tmp6_, boxes_downloader_download_ready, _data_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 713 "downloader.c"
		_state_1:
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp7_ = NULL;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp7_ = boxes_downloader_await_download_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp8_ = _data_->_tmp7_;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_error_free (_data_->_inner_error_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_free0 (_data_->uri);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			block59_data_unref (_data_->_data59_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_data59_ = NULL;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			if (_data_->_state_ == 0) {
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 737 "downloader.c"
			} else {
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 741 "downloader.c"
			}
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_object_unref (_data_->_async_result);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			return FALSE;
#line 747 "downloader.c"
		}
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->result = _data_->_tmp8_;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->uri);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block59_data_unref (_data_->_data59_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data59_ = NULL;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 761 "downloader.c"
		} else {
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 765 "downloader.c"
		}
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 771 "downloader.c"
	}
#line 52 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = _data_->cached_path;
#line 52 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = NULL;
#line 52 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = g_file_new_for_path (_data_->_tmp9_);
#line 52 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_file = _data_->_tmp10_;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp11_ = _data_->cached_file;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = FALSE;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = g_file_query_exists (_data_->_tmp11_, NULL);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp12_) {
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp13_ = _data_->uri;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp14_ = _data_->cached_path;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_debug ("downloader.vala:54: '%s' already available locally at '%s'. Not downlo" \
"ading.", _data_->_tmp13_, _data_->_tmp14_);
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->result = _data_->cached_file;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->uri);
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block59_data_unref (_data_->_data59_);
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data59_ = NULL;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 807 "downloader.c"
		} else {
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 811 "downloader.c"
		}
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 817 "downloader.c"
	}
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp15_ = _data_->uri;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:58: Downloading '%s'...", _data_->_tmp15_);
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp16_ = _data_->self->priv->downloads;
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp17_ = _data_->uri;
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp19_ = _data_->cached_file;
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp20_ = _g_object_ref0 (_data_->_tmp19_);
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_hash_table_insert (_data_->_tmp16_, _data_->_tmp18_, _data_->_tmp20_);
#line 835 "downloader.c"
	{
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp21_ = _data_->uri;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp22_ = soup_message_new ("GET", _data_->_tmp21_);
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->msg = _data_->_tmp22_;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = _data_->self->priv->session;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp24_ = _data_->msg;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp25_ = _g_object_ref0 (_data_->_tmp24_);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		soup_session_queue_message ((SoupSession*) _data_->_tmp23_, _data_->_tmp25_, ____lambda145__soup_session_callback, _data_->_data59_);
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 2;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 855 "downloader.c"
		_state_2:
		;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp26_ = _data_->msg;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp27_ = 0U;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_get (_data_->_tmp26_, "status-code", &_data_->_tmp27_, NULL);
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp28_ = _data_->_tmp27_;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_tmp28_ != ((guint) SOUP_STATUS_OK)) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp29_ = _data_->msg;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp30_ = NULL;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_object_get (_data_->_tmp29_, "reason-phrase", &_data_->_tmp30_, NULL);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp31_ = _data_->_tmp30_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp32_ = _data_->_tmp31_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp33_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_INVALID, _data_->_tmp32_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp34_ = _data_->_tmp33_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_free0 (_data_->_tmp32_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_inner_error_ = _data_->_tmp34_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (_data_->msg);
#line 888 "downloader.c"
			goto __catch96_g_error;
		}
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp35_ = _data_->cached_file;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp36_ = _data_->msg;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp37_ = _data_->_tmp36_->response_body;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp38_ = _data_->_tmp37_->data;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp38__length1 = (gint) _data_->_tmp37_->length;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 3;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_file_replace_contents_async (_data_->_tmp35_, _data_->_tmp38_, (gsize) _data_->_tmp38__length1, NULL, FALSE, 0, NULL, boxes_downloader_download_ready, _data_);
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 907 "downloader.c"
		_state_3:
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_file_replace_contents_finish (_data_->_tmp35_, _data_->_res_, NULL, &_data_->_inner_error_);
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (_data_->msg);
#line 915 "downloader.c"
			goto __catch96_g_error;
		}
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->msg);
#line 920 "downloader.c"
	}
	goto __finally96;
	__catch96_g_error:
	{
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = NULL;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp39_ = _data_->uri;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp40_ = _data_->cached_file;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp41_ = _data_->_error_;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_signal_emit_by_name (_data_->self, "download-failed", _data_->_tmp39_, _data_->_tmp40_, _data_->_tmp41_);
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp42_ = _data_->_error_;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp43_ = _g_error_copy0 (_data_->_tmp42_);
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = _data_->_tmp43_;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_error_free0 (_data_->_error_);
#line 945 "downloader.c"
		goto __finally96;
	}
	__finally96:
	{
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp44_ = _data_->self->priv->downloads;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp45_ = _data_->uri;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_hash_table_remove (_data_->_tmp44_, _data_->_tmp45_);
#line 956 "downloader.c"
	}
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_inner_error_ != NULL) {
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->uri);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block59_data_unref (_data_->_data59_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data59_ = NULL;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 976 "downloader.c"
		} else {
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 980 "downloader.c"
		}
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 986 "downloader.c"
	}
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp46_ = _data_->uri;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp47_ = _data_->cached_path;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:78: Downloaded '%s' and its now locally available at '" \
"%s'.", _data_->_tmp46_, _data_->_tmp47_);
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp48_ = _data_->uri;
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp49_ = _data_->cached_file;
#line 79 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_emit_by_name (_data_->self, "downloaded", _data_->_tmp48_, _data_->_tmp49_);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->result = _data_->cached_file;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->uri);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block59_data_unref (_data_->_data59_);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data59_ = NULL;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1012 "downloader.c"
	} else {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1016 "downloader.c"
	}
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->cached_file);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->uri);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block59_data_unref (_data_->_data59_);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data59_ = NULL;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1034 "downloader.c"
	} else {
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1038 "downloader.c"
	}
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1044 "downloader.c"
}


static void boxes_downloader_fetch_os_logo_data_free (gpointer _data) {
	BoxesDownloaderFetchOsLogoData* _data_;
	_data_ = _data;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->image);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->os);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_slice_free (BoxesDownloaderFetchOsLogoData, _data_);
#line 1057 "downloader.c"
}


void boxes_downloader_fetch_os_logo (GtkImage* image, OsinfoOs* os, gint size, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesDownloaderFetchOsLogoData* _data_;
	GtkImage* _tmp0_;
	GtkImage* _tmp1_;
	OsinfoOs* _tmp2_;
	OsinfoOs* _tmp3_;
	gint _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_slice_new0 (BoxesDownloaderFetchOsLogoData);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, boxes_downloader_fetch_os_logo);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_downloader_fetch_os_logo_data_free);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = image;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->image);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->image = _tmp1_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = os;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->os);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->os = _tmp3_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp4_ = size;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->size = _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_fetch_os_logo_co (_data_);
#line 1096 "downloader.c"
}


void boxes_downloader_fetch_os_logo_finish (GAsyncResult* _res_) {
	BoxesDownloaderFetchOsLogoData* _data_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 1104 "downloader.c"
}


static void boxes_downloader_fetch_os_logo_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesDownloaderFetchOsLogoData* _data_;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = _user_data_;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_source_object_ = source_object;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_res_ = _res_;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_fetch_os_logo_co (_data_);
#line 1118 "downloader.c"
}


static gboolean boxes_downloader_fetch_os_logo_co (BoxesDownloaderFetchOsLogoData* _data_) {
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	switch (_data_->_state_) {
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 0:
#line 1127 "downloader.c"
		goto _state_0;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 1131 "downloader.c"
		goto _state_1;
		default:
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 1136 "downloader.c"
	}
	_state_0:
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->os;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = NULL;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = boxes_downloader_fetch_os_logo_url (_data_->_tmp0_);
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->logo_url = _data_->_tmp1_;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = _data_->logo_url;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp2_ == NULL) {
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->logo_url);
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1157 "downloader.c"
		} else {
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1161 "downloader.c"
		}
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1167 "downloader.c"
	}
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->os;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = osinfo_product_get_name ((OsinfoProduct*) _data_->_tmp3_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp5_ = _data_->_tmp4_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = _data_->logo_url;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:89: %s has logo '%s'.", _data_->_tmp5_, _data_->_tmp6_);
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp7_ = _data_->logo_url;
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = NULL;
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = g_file_new_for_uri (_data_->_tmp7_);
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->remote_file = _data_->_tmp8_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = _data_->remote_file;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = NULL;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = g_file_get_basename (_data_->_tmp9_);
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp11_ = _data_->_tmp10_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = NULL;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = boxes_get_logo_cache (_data_->_tmp11_);
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp13_ = _data_->_tmp12_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->_tmp11_);
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_path = _data_->_tmp13_;
#line 1205 "downloader.c"
	{
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp14_ = NULL;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp14_ = boxes_downloader_get_instance ();
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp15_ = _data_->_tmp14_;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp16_ = _data_->remote_file;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp17_ = _data_->cached_path;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 1;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		boxes_downloader_download (_data_->_tmp15_, _data_->_tmp16_, _data_->_tmp17_, boxes_downloader_fetch_os_logo_ready, _data_);
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1223 "downloader.c"
		_state_1:
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp18_ = NULL;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp18_ = boxes_downloader_download_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp19_ = _data_->_tmp18_;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->_tmp15_);
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->cached_file = _data_->_tmp19_;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 1237 "downloader.c"
			goto __catch97_g_error;
		}
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp20_ = _data_->cached_file;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp21_ = NULL;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp21_ = g_file_get_path (_data_->_tmp20_);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp22_ = _data_->_tmp21_;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = _data_->size;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp24_ = _data_->size;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp25_ = gdk_pixbuf_new_from_file_at_size (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp24_, &_data_->_inner_error_);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp26_ = _data_->_tmp25_;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->_tmp22_);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->pixbuf = _data_->_tmp26_;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (_data_->cached_file);
#line 1264 "downloader.c"
			goto __catch97_g_error;
		}
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp27_ = _data_->image;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp28_ = _data_->pixbuf;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		gtk_image_set_from_pixbuf (_data_->_tmp27_, _data_->_tmp28_);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->pixbuf);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 1277 "downloader.c"
	}
	goto __finally97;
	__catch97_g_error:
	{
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = NULL;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp29_ = _data_->logo_url;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp30_ = _data_->_error_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp31_ = _data_->_tmp30_->message;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_warning ("downloader.vala:98: Error loading logo file '%s': %s", _data_->_tmp29_, _data_->_tmp31_);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_error_free0 (_data_->_error_);
#line 1296 "downloader.c"
	}
	__finally97:
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_inner_error_ != NULL) {
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->cached_path);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->remote_file);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->logo_url);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		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);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_clear_error (&_data_->_inner_error_);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1313 "downloader.c"
	}
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->cached_path);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->remote_file);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->logo_url);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1325 "downloader.c"
	} else {
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1329 "downloader.c"
	}
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1335 "downloader.c"
}


static void boxes_downloader_await_download_data_free (gpointer _data) {
	BoxesDownloaderAwaitDownloadData* _data_;
	_data_ = _data;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->cached_path);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->result);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->self);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_slice_free (BoxesDownloaderAwaitDownloadData, _data_);
#line 1350 "downloader.c"
}


static void boxes_downloader_await_download (BoxesDownloader* self, const gchar* uri, const gchar* cached_path, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesDownloaderAwaitDownloadData* _data_;
	BoxesDownloader* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_slice_new0 (BoxesDownloaderAwaitDownloadData);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_downloader_await_download);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_downloader_await_download_data_free);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->self = _tmp0_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = uri;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->uri);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->uri = _tmp2_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = cached_path;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->cached_path);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_path = _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_await_download_co (_data_);
#line 1389 "downloader.c"
}


static GFile* boxes_downloader_await_download_finish (BoxesDownloader* self, GAsyncResult* _res_, GError** error) {
	GFile* result;
	BoxesDownloaderAwaitDownloadData* _data_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return NULL;
#line 1400 "downloader.c"
	}
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	result = _data_->result;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->result = NULL;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return result;
#line 1410 "downloader.c"
}


static Block60Data* block60_data_ref (Block60Data* _data60_) {
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_atomic_int_inc (&_data60_->_ref_count_);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return _data60_;
#line 1419 "downloader.c"
}


static void block60_data_unref (void * _userdata_) {
	Block60Data* _data60_;
	_data60_ = (Block60Data*) _userdata_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_atomic_int_dec_and_test (&_data60_->_ref_count_)) {
#line 1428 "downloader.c"
		BoxesDownloader * self;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		self = _data60_->self;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		(_data60_->callback_target_destroy_notify == NULL) ? NULL : (_data60_->callback_target_destroy_notify (_data60_->callback_target), NULL);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data60_->callback = NULL;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data60_->callback_target = NULL;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data60_->callback_target_destroy_notify = NULL;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_error_free0 (_data60_->download_error);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data60_->downloaded_file);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data60_->uri);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (self);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_slice_free (Block60Data, _data60_);
#line 1450 "downloader.c"
	}
}


static gboolean _boxes_downloader_await_download_co_gsource_func (gpointer self) {
	gboolean result;
	result = boxes_downloader_await_download_co (self);
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return result;
#line 1460 "downloader.c"
}


static void __lambda143_ (Block60Data* _data60_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file) {
	BoxesDownloader * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data60_->self;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloader != NULL);
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloaded_uri != NULL);
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (file != NULL);
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = downloaded_uri;
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _data60_->uri;
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_strcmp0 (_tmp0_, _tmp1_) != 0) {
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return;
#line 1486 "downloader.c"
	}
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = file;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data60_->downloaded_file);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data60_->downloaded_file = _tmp3_;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data60_->callback (_data60_->callback_target);
#line 1498 "downloader.c"
}


static void ___lambda143__boxes_downloader_downloaded (BoxesDownloader* _sender, const gchar* uri, GFile* cached_file, gpointer self) {
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	__lambda143_ (self, _sender, uri, cached_file);
#line 1505 "downloader.c"
}


static void __lambda144_ (Block60Data* _data60_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file, GError* _error_) {
	BoxesDownloader * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GError* _tmp2_;
	GError* _tmp3_;
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data60_->self;
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloader != NULL);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloaded_uri != NULL);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (file != NULL);
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = downloaded_uri;
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _data60_->uri;
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_strcmp0 (_tmp0_, _tmp1_) != 0) {
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return;
#line 1531 "downloader.c"
	}
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = _error_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _g_error_copy0 (_tmp2_);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_error_free0 (_data60_->download_error);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data60_->download_error = _tmp3_;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data60_->callback (_data60_->callback_target);
#line 1543 "downloader.c"
}


static void ___lambda144__boxes_downloader_download_failed (BoxesDownloader* _sender, const gchar* uri, GFile* cached_file, GError* _error_, gpointer self) {
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	__lambda144_ (self, _sender, uri, cached_file, _error_);
#line 1550 "downloader.c"
}


static void boxes_downloader_await_download_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesDownloaderAwaitDownloadData* _data_;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = _user_data_;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_source_object_ = source_object;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_res_ = _res_;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_await_download_co (_data_);
#line 1564 "downloader.c"
}


static gboolean boxes_downloader_await_download_co (BoxesDownloaderAwaitDownloadData* _data_) {
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	switch (_data_->_state_) {
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 0:
#line 1573 "downloader.c"
		goto _state_0;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 1577 "downloader.c"
		goto _state_1;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 2:
#line 1581 "downloader.c"
		goto _state_2;
		default:
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 1586 "downloader.c"
	}
	_state_0:
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_ = g_slice_new0 (Block60Data);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->_ref_count_ = 1;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->self = g_object_ref (_data_->self);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->uri;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->_data60_->uri);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->uri = _data_->_tmp0_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->_async_data_ = _data_;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->downloaded_file = NULL;
#line 104 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->download_error = NULL;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->callback = _boxes_downloader_await_download_co_gsource_func;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->callback_target = _data_;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_->callback_target_destroy_notify = NULL;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = 0UL;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = g_signal_connect_data (_data_->self, "downloaded", (GCallback) ___lambda143__boxes_downloader_downloaded, block60_data_ref (_data_->_data60_), (GClosureNotify) block60_data_unref, 0);
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->downloaded_id = _data_->_tmp1_;
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = 0UL;
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = g_signal_connect_data (_data_->self, "download-failed", (GCallback) ___lambda144__boxes_downloader_download_failed, block60_data_ref (_data_->_data60_), (GClosureNotify) block60_data_unref, 0);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->downloaded_failed_id = _data_->_tmp2_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->_data60_->uri;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:122: '%s' already being downloaded. Waiting for downlo" \
"ad to complete..", _data_->_tmp3_);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_state_ = 1;
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1633 "downloader.c"
	_state_1:
	;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = _data_->_data60_->uri;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:124: Finished waiting for '%s' to download.", _data_->_tmp4_);
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_handler_disconnect ((GObject*) _data_->self, _data_->downloaded_id);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_handler_disconnect ((GObject*) _data_->self, _data_->downloaded_failed_id);
#line 128 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_data60_->download_error != NULL) {
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp5_ = _g_error_copy0 (_data_->_data60_->download_error);
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = _data_->_tmp5_;
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block60_data_unref (_data_->_data60_);
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data60_ = NULL;
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1662 "downloader.c"
		} else {
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1666 "downloader.c"
		}
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 129 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1672 "downloader.c"
	}
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = NULL;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = g_file_get_path (_data_->_data60_->downloaded_file);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp7_ = _data_->_tmp6_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = _data_->cached_path;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = g_strcmp0 (_data_->_tmp7_, _data_->_tmp8_) != 0;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->_tmp7_);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp9_) {
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp10_ = _data_->cached_path;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp11_ = NULL;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp11_ = g_file_new_for_path (_data_->_tmp10_);
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->cached_file = _data_->_tmp11_;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp12_ = _data_->cached_file;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 2;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_file_copy_async (_data_->_data60_->downloaded_file, _data_->_tmp12_, G_FILE_COPY_OVERWRITE, G_PRIORITY_DEFAULT, NULL, NULL, NULL, boxes_downloader_await_download_ready, _data_);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1706 "downloader.c"
		_state_2:
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_file_copy_finish (_data_->_data60_->downloaded_file, _data_->_res_, &_data_->_inner_error_);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_error_free (_data_->_inner_error_);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (_data_->cached_file);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			block60_data_unref (_data_->_data60_);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_data60_ = NULL;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			if (_data_->_state_ == 0) {
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1726 "downloader.c"
			} else {
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1730 "downloader.c"
			}
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_object_unref (_data_->_async_result);
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			return FALSE;
#line 1736 "downloader.c"
		}
	} else {
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp13_ = _g_object_ref0 (_data_->_data60_->downloaded_file);
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->cached_file = _data_->_tmp13_;
#line 1745 "downloader.c"
	}
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->result = _data_->cached_file;
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block60_data_unref (_data_->_data60_);
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_ = NULL;
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1757 "downloader.c"
	} else {
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1761 "downloader.c"
	}
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->cached_file);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block60_data_unref (_data_->_data60_);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data60_ = NULL;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1777 "downloader.c"
	} else {
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1781 "downloader.c"
	}
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1787 "downloader.c"
}


static void g_cclosure_user_marshal_VOID__STRING_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__STRING_OBJECT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (n_param_values == 3);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data1 = closure->data;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data2 = param_values->data[0].v_pointer;
#line 1806 "downloader.c"
	} else {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data1 = param_values->data[0].v_pointer;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data2 = closure->data;
#line 1812 "downloader.c"
	}
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	callback = (GMarshalFunc_VOID__STRING_OBJECT) (marshal_data ? marshal_data : cc->callback);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	callback (data1, g_value_get_string (param_values + 1), g_value_get_object (param_values + 2), data2);
#line 1818 "downloader.c"
}


static void g_cclosure_user_marshal_VOID__STRING_OBJECT_POINTER (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__STRING_OBJECT_POINTER) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_OBJECT_POINTER callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (n_param_values == 4);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data1 = closure->data;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data2 = param_values->data[0].v_pointer;
#line 1837 "downloader.c"
	} else {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data1 = param_values->data[0].v_pointer;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		data2 = closure->data;
#line 1843 "downloader.c"
	}
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	callback = (GMarshalFunc_VOID__STRING_OBJECT_POINTER) (marshal_data ? marshal_data : cc->callback);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	callback (data1, g_value_get_string (param_values + 1), g_value_get_object (param_values + 2), g_value_get_pointer (param_values + 3), data2);
#line 1849 "downloader.c"
}


static void boxes_downloader_class_init (BoxesDownloaderClass * klass) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_parent_class = g_type_class_peek_parent (klass);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_type_class_add_private (klass, sizeof (BoxesDownloaderPrivate));
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_downloader_finalize;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_new ("downloaded", BOXES_TYPE_DOWNLOADER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_OBJECT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_FILE);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_new ("download_failed", BOXES_TYPE_DOWNLOADER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_OBJECT_POINTER, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_FILE, G_TYPE_POINTER);
#line 1864 "downloader.c"
}


static void boxes_downloader_instance_init (BoxesDownloader * self) {
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self->priv = BOXES_DOWNLOADER_GET_PRIVATE (self);
#line 1871 "downloader.c"
}


static void boxes_downloader_finalize (GObject* obj) {
	BoxesDownloader * self;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_DOWNLOADER, BoxesDownloader);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (self->priv->session);
#line 7 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_hash_table_unref0 (self->priv->downloads);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	G_OBJECT_CLASS (boxes_downloader_parent_class)->finalize (obj);
#line 1885 "downloader.c"
}


GType boxes_downloader_get_type (void) {
	static volatile gsize boxes_downloader_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_downloader_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesDownloaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_downloader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesDownloader), 0, (GInstanceInitFunc) boxes_downloader_instance_init, NULL };
		GType boxes_downloader_type_id;
		boxes_downloader_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesDownloader", &g_define_type_info, 0);
		g_once_init_leave (&boxes_downloader_type_id__volatile, boxes_downloader_type_id);
	}
	return boxes_downloader_type_id__volatile;
}



