/* downloader.c generated by valac 0.18.0.79-04df6, 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 <float.h>
#include <math.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))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesDownloaderDownloadData BoxesDownloaderDownloadData;
typedef struct _Block73Data Block73Data;
typedef struct _BoxesDownloaderDownloadFromHttpData BoxesDownloaderDownloadFromHttpData;
typedef struct _BoxesDownloaderFetchOsLogoData BoxesDownloaderFetchOsLogoData;
typedef struct _Block74Data Block74Data;
typedef struct _BoxesDownloaderAwaitDownloadData BoxesDownloaderAwaitDownloadData;

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

struct _BoxesDownloaderClass {
	GObjectClass parent_class;
};

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

struct _BoxesDownloaderDownloadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesDownloader* self;
	GFile* remote_file;
	gchar* cached_path;
	BoxesActivityProgress* progress;
	GFile* result;
	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_;
	gboolean _tmp21_;
	GFile* _tmp22_;
	gboolean _tmp23_;
	GFile* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	const gchar* _tmp27_;
	GFile* _tmp28_;
	BoxesActivityProgress* _tmp29_;
	GFile* _tmp30_;
	GFile* _tmp31_;
	GError* _error_;
	const gchar* _tmp32_;
	GFile* _tmp33_;
	GError* _tmp34_;
	GError* _tmp35_;
	GError* _tmp36_;
	GHashTable* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	GFile* _tmp42_;
	GError * _inner_error_;
};

struct _Block73Data {
	int _ref_count_;
	BoxesDownloader * self;
	SoupMessage* msg;
	gint64 total_num_bytes;
	gint64 current_num_bytes;
	BoxesActivityProgress* progress;
	gpointer _async_data_;
};

struct _BoxesDownloaderDownloadFromHttpData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesDownloader* self;
	gchar* uri;
	GFile* cached_file;
	BoxesActivityProgress* progress;
	Block73Data* _data73_;
	BoxesActivityProgress* _tmp0_;
	const gchar* _tmp1_;
	SoupMessage* _tmp2_;
	SoupMessage* _tmp3_;
	SoupAddress* _tmp4_;
	SoupAddress* _tmp5_;
	SoupAddress* address;
	SoupAddress* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	SoupAddress* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	GNetworkAddress* _tmp12_;
	GNetworkAddress* connectable;
	GNetworkMonitor* _tmp13_;
	GNetworkMonitor* _tmp14_;
	GNetworkMonitor* network_monitor;
	GNetworkMonitor* _tmp15_;
	GNetworkAddress* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	SoupAddress* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	SoupAddress* _tmp22_;
	gint _tmp23_;
	gint _tmp24_;
	GError* _tmp25_;
	SoupMessage* _tmp26_;
	SoupMessage* _tmp27_;
	SoupSessionAsync* _tmp28_;
	SoupMessage* _tmp29_;
	SoupMessage* _tmp30_;
	SoupMessage* _tmp31_;
	guint _tmp32_;
	guint _tmp33_;
	SoupMessage* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	GError* _tmp38_;
	GError* _tmp39_;
	GFile* _tmp40_;
	SoupMessage* _tmp41_;
	SoupMessageBody* _tmp42_;
	guint8* _tmp43_;
	gint _tmp43__length1;
	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_;
	BoxesActivityProgress* _tmp18_;
	BoxesActivityProgress* _tmp19_;
	GFile* _tmp20_;
	GFile* _tmp21_;
	GFile* cached_file;
	GFile* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	GdkPixbuf* _tmp27_;
	GdkPixbuf* _tmp28_;
	GdkPixbuf* pixbuf;
	GtkImage* _tmp29_;
	GdkPixbuf* _tmp30_;
	GError* _error_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	GError * _inner_error_;
};

struct _Block74Data {
	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;
	Block74Data* _data74_;
	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, BoxesActivityProgress* progress, 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 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 boxes_downloader_download_from_http (BoxesDownloader* self, const gchar* uri, GFile* cached_file, BoxesActivityProgress* progress, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_downloader_download_from_http_finish (BoxesDownloader* self, GAsyncResult* _res_, GError** error);
void boxes_copy_file (GFile* src_file, GFile* dest_file, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_copy_file_finish (GAsyncResult* _res_, GError** error);
static void boxes_downloader_download_from_http_data_free (gpointer _data);
static gboolean boxes_downloader_download_from_http_co (BoxesDownloaderDownloadFromHttpData* _data_);
static Block73Data* block73_data_ref (Block73Data* _data73_);
static void block73_data_unref (void * _userdata_);
static void boxes_downloader_download_from_http_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void __lambda57_ (Block73Data* _data73_);
static void ___lambda57__soup_message_got_headers (SoupMessage* _sender, gpointer self);
static void __lambda58_ (Block73Data* _data73_, SoupMessage* msg, SoupBuffer* chunk);
static void ___lambda58__soup_message_got_chunk (SoupMessage* _sender, SoupBuffer* chunk, gpointer self);
static void __lambda59_ (Block73Data* _data73_, SoupSession* session, SoupMessage* msg);
static void ___lambda59__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 Block74Data* block74_data_ref (Block74Data* _data74_);
static void block74_data_unref (void * _userdata_);
static gboolean _boxes_downloader_await_download_co_gsource_func (gpointer self);
static void __lambda55_ (Block74Data* _data74_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file);
static void ___lambda55__boxes_downloader_downloaded (BoxesDownloader* _sender, const gchar* uri, GFile* cached_file, gpointer self);
static void __lambda56_ (Block74Data* _data74_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file, GError* _error_);
static void ___lambda56__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 340 "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 353 "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 361 "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 371 "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 394 "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 411 "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 423 "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 441 "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 447 "downloader.c"
		} else {
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_tmp9_ = FALSE;
#line 451 "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 459 "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 477 "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 494 "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 506 "downloader.c"
		}
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (parent);
#line 510 "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 518 "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 525 "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 532 "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 567 "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 574 "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_->progress);
#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 593 "downloader.c"
}


void boxes_downloader_download (BoxesDownloader* self, GFile* remote_file, const gchar* cached_path, BoxesActivityProgress* progress, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesDownloaderDownloadData* _data_;
	BoxesDownloader* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	BoxesActivityProgress* _tmp5_;
	BoxesActivityProgress* _tmp6_;
#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"
	_tmp5_ = progress;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->progress);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->progress = _tmp6_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_co (_data_);
#line 642 "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 653 "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 663 "downloader.c"
}


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


static gpointer _g_error_copy0 (gpointer self) {
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return self ? g_error_copy (self) : NULL;
#line 684 "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 693 "downloader.c"
		goto _state_0;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 697 "downloader.c"
		goto _state_1;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 2:
#line 701 "downloader.c"
		goto _state_2;
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 3:
#line 705 "downloader.c"
		goto _state_3;
		default:
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 710 "downloader.c"
	}
	_state_0:
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->remote_file;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = NULL;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = g_file_get_uri (_data_->_tmp0_);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->uri = _data_->_tmp1_;
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = _data_->self->priv->downloads;
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->uri;
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = FALSE;
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = g_hash_table_contains (_data_->_tmp2_, _data_->_tmp3_);
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp4_) {
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp5_ = _data_->uri;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp6_ = _data_->cached_path;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 1;
#line 51 "/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 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 741 "downloader.c"
		_state_1:
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp7_ = NULL;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp7_ = boxes_downloader_await_download_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp8_ = _data_->_tmp7_;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_error_free (_data_->_inner_error_);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_free0 (_data_->uri);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			if (_data_->_state_ == 0) {
#line 51 "/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 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 765 "downloader.c"
			}
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_object_unref (_data_->_async_result);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			return FALSE;
#line 771 "downloader.c"
		}
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->result = _data_->_tmp8_;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->uri);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 781 "downloader.c"
		} else {
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 785 "downloader.c"
		}
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 791 "downloader.c"
	}
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = _data_->cached_path;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = NULL;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = g_file_new_for_path (_data_->_tmp9_);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_file = _data_->_tmp10_;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp11_ = _data_->cached_file;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = FALSE;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = g_file_query_exists (_data_->_tmp11_, NULL);
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp12_) {
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp13_ = _data_->uri;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp14_ = _data_->cached_path;
#line 55 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_debug ("downloader.vala:55: '%s' already available locally at '%s'. Not downlo" \
"ading.", _data_->_tmp13_, _data_->_tmp14_);
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->result = _data_->cached_file;
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->uri);
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 823 "downloader.c"
		} else {
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 827 "downloader.c"
		}
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 833 "downloader.c"
	}
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp15_ = _data_->uri;
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:59: Downloading '%s'...", _data_->_tmp15_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp16_ = _data_->self->priv->downloads;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp17_ = _data_->uri;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp19_ = _data_->cached_file;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp20_ = _g_object_ref0 (_data_->_tmp19_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_hash_table_insert (_data_->_tmp16_, _data_->_tmp18_, _data_->_tmp20_);
#line 851 "downloader.c"
	{
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp22_ = _data_->remote_file;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = FALSE;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = g_file_has_uri_scheme (_data_->_tmp22_, "http");
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_tmp23_) {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp21_ = TRUE;
#line 863 "downloader.c"
		} else {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp24_ = _data_->remote_file;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp25_ = FALSE;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp25_ = g_file_has_uri_scheme (_data_->_tmp24_, "https");
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp21_ = _data_->_tmp25_;
#line 873 "downloader.c"
		}
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp26_ = _data_->_tmp21_;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_tmp26_) {
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp27_ = _data_->uri;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp28_ = _data_->cached_file;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp29_ = _data_->progress;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_state_ = 2;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			boxes_downloader_download_from_http (_data_->self, _data_->_tmp27_, _data_->_tmp28_, _data_->_tmp29_, boxes_downloader_download_ready, _data_);
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			return FALSE;
#line 891 "downloader.c"
			_state_2:
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			boxes_downloader_download_from_http_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			if (_data_->_inner_error_ != NULL) {
#line 897 "downloader.c"
				goto __catch103_g_error;
			}
		} else {
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp30_ = _data_->remote_file;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_tmp31_ = _data_->cached_file;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_state_ = 3;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			boxes_copy_file (_data_->_tmp30_, _data_->_tmp31_, NULL, boxes_downloader_download_ready, _data_);
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			return FALSE;
#line 911 "downloader.c"
			_state_3:
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			boxes_copy_file_finish (_data_->_res_, &_data_->_inner_error_);
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			if (_data_->_inner_error_ != NULL) {
#line 917 "downloader.c"
				goto __catch103_g_error;
			}
		}
	}
	goto __finally103;
	__catch103_g_error:
	{
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = NULL;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp32_ = _data_->uri;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp33_ = _data_->cached_file;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp34_ = _data_->_error_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_signal_emit_by_name (_data_->self, "download-failed", _data_->_tmp32_, _data_->_tmp33_, _data_->_tmp34_);
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp35_ = _data_->_error_;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp36_ = _g_error_copy0 (_data_->_tmp35_);
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = _data_->_tmp36_;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_error_free0 (_data_->_error_);
#line 945 "downloader.c"
		goto __finally103;
	}
	__finally103:
	{
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp37_ = _data_->self->priv->downloads;
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp38_ = _data_->uri;
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_hash_table_remove (_data_->_tmp37_, _data_->_tmp38_);
#line 956 "downloader.c"
	}
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_inner_error_ != NULL) {
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->uri);
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 972 "downloader.c"
		} else {
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 976 "downloader.c"
		}
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 982 "downloader.c"
	}
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp39_ = _data_->uri;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp40_ = _data_->cached_path;
#line 75 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:75: Downloaded '%s' and its now locally available at '" \
"%s'.", _data_->_tmp39_, _data_->_tmp40_);
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp41_ = _data_->uri;
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp42_ = _data_->cached_file;
#line 76 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_emit_by_name (_data_->self, "downloaded", _data_->_tmp41_, _data_->_tmp42_);
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->result = _data_->cached_file;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->uri);
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1004 "downloader.c"
	} else {
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1008 "downloader.c"
	}
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 78 "/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"
	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 1022 "downloader.c"
	} else {
#line 45 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1026 "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 1032 "downloader.c"
}


static void boxes_downloader_download_from_http_data_free (gpointer _data) {
	BoxesDownloaderDownloadFromHttpData* _data_;
	_data_ = _data;
#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"
	_g_object_unref0 (_data_->cached_file);
#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 (BoxesDownloaderDownloadFromHttpData, _data_);
#line 1047 "downloader.c"
}


static void boxes_downloader_download_from_http (BoxesDownloader* self, const gchar* uri, GFile* cached_file, BoxesActivityProgress* progress, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesDownloaderDownloadFromHttpData* _data_;
	BoxesDownloader* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	BoxesActivityProgress* _tmp5_;
	BoxesActivityProgress* _tmp6_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = g_slice_new0 (BoxesDownloaderDownloadFromHttpData);
#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_from_http);
#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_from_http_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_file;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->cached_file);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_file = _tmp4_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp5_ = progress;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->progress);
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->progress = _tmp6_;
#line 3 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_from_http_co (_data_);
#line 1096 "downloader.c"
}


static void boxes_downloader_download_from_http_finish (BoxesDownloader* self, GAsyncResult* _res_, GError** error) {
	BoxesDownloaderDownloadFromHttpData* _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;
#line 1106 "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 1110 "downloader.c"
}


static Block73Data* block73_data_ref (Block73Data* _data73_) {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_atomic_int_inc (&_data73_->_ref_count_);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return _data73_;
#line 1119 "downloader.c"
}


static void block73_data_unref (void * _userdata_) {
	Block73Data* _data73_;
	_data73_ = (Block73Data*) _userdata_;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_atomic_int_dec_and_test (&_data73_->_ref_count_)) {
#line 1128 "downloader.c"
		BoxesDownloader * self;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		self = _data73_->self;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data73_->msg);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data73_->progress);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (self);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_slice_free (Block73Data, _data73_);
#line 1140 "downloader.c"
	}
}


static void boxes_downloader_download_from_http_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesDownloaderDownloadFromHttpData* _data_;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_ = _user_data_;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_source_object_ = source_object;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_res_ = _res_;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_from_http_co (_data_);
#line 1155 "downloader.c"
}


static void __lambda57_ (Block73Data* _data73_) {
	BoxesDownloader * self;
	SoupMessage* _tmp0_;
	SoupMessageHeaders* _tmp1_;
	gint64 _tmp2_ = 0LL;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data73_->self;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = _data73_->msg;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _tmp0_->response_headers;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = soup_message_headers_get_content_length (_tmp1_);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data73_->total_num_bytes = _tmp2_;
#line 1174 "downloader.c"
}


static void ___lambda57__soup_message_got_headers (SoupMessage* _sender, gpointer self) {
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	__lambda57_ (self);
#line 1181 "downloader.c"
}


static void __lambda58_ (Block73Data* _data73_, SoupMessage* msg, SoupBuffer* chunk) {
	BoxesDownloader * self;
	gint64 _tmp0_;
	gint64 _tmp1_;
	SoupBuffer* _tmp2_;
	gsize _tmp3_;
	BoxesActivityProgress* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data73_->self;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (msg != NULL);
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (chunk != NULL);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = _data73_->total_num_bytes;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_tmp0_ <= ((gint64) 0)) {
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return;
#line 1206 "downloader.c"
	}
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _data73_->current_num_bytes;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = chunk;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _tmp2_->length;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data73_->current_num_bytes = _tmp1_ + _tmp3_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp4_ = _data73_->progress;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp5_ = _data73_->current_num_bytes;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp6_ = _data73_->total_num_bytes;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_activity_progress_set_progress (_tmp4_, ((gdouble) _tmp5_) / _tmp6_);
#line 1224 "downloader.c"
}


static void ___lambda58__soup_message_got_chunk (SoupMessage* _sender, SoupBuffer* chunk, gpointer self) {
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	__lambda58_ (self, _sender, chunk);
#line 1231 "downloader.c"
}


static void __lambda59_ (Block73Data* _data73_, SoupSession* session, SoupMessage* msg) {
	BoxesDownloader * self;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data73_->self;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (session != NULL);
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (msg != NULL);
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	boxes_downloader_download_from_http_co (_data73_->_async_data_);
#line 1245 "downloader.c"
}


static void ___lambda59__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self) {
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	__lambda59_ (self, session, msg);
#line 1252 "downloader.c"
}


static gboolean boxes_downloader_download_from_http_co (BoxesDownloaderDownloadFromHttpData* _data_) {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	switch (_data_->_state_) {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 0:
#line 1261 "downloader.c"
		goto _state_0;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 1265 "downloader.c"
		goto _state_1;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 2:
#line 1269 "downloader.c"
		goto _state_2;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 3:
#line 1273 "downloader.c"
		goto _state_3;
		default:
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 1278 "downloader.c"
	}
	_state_0:
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_ = g_slice_new0 (Block73Data);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->_ref_count_ = 1;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->self = g_object_ref (_data_->self);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->progress;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->_data73_->progress);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->progress = _data_->_tmp0_;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->_async_data_ = _data_;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = _data_->uri;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = soup_message_new ("GET", _data_->_tmp1_);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->msg = _data_->_tmp2_;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->_data73_->msg;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = NULL;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = soup_message_get_address (_data_->_tmp3_);
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->address = _data_->_tmp5_;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = _data_->address;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp7_ = soup_address_get_name (_data_->_tmp6_);
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = _data_->_tmp7_;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = _data_->address;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = soup_address_get_port (_data_->_tmp9_);
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp11_ = _data_->_tmp10_;
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = (GNetworkAddress*) g_network_address_new (_data_->_tmp8_, (guint16) _data_->_tmp11_);
#line 86 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->connectable = _data_->_tmp12_;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp13_ = NULL;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp13_ = g_network_monitor_get_default ();
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp14_ = _g_object_ref0 (_data_->_tmp13_);
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->network_monitor = _data_->_tmp14_;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp15_ = _data_->network_monitor;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp16_ = _data_->connectable;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_state_ = 1;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_network_monitor_can_reach_async (_data_->_tmp15_, (GSocketConnectable*) _data_->_tmp16_, NULL, boxes_downloader_download_from_http_ready, _data_);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1345 "downloader.c"
	_state_1:
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp17_ = FALSE;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp17_ = g_network_monitor_can_reach_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp18_ = _data_->_tmp17_;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_inner_error_ != NULL) {
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->network_monitor);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->connectable);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->address);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block73_data_unref (_data_->_data73_);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data73_ = NULL;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1373 "downloader.c"
		} else {
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1377 "downloader.c"
		}
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1383 "downloader.c"
	}
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (!_data_->_tmp18_) {
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp19_ = _data_->address;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp20_ = soup_address_get_name (_data_->_tmp19_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp21_ = _data_->_tmp20_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp22_ = _data_->address;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = soup_address_get_port (_data_->_tmp22_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp24_ = _data_->_tmp23_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp25_ = g_error_new (BOXES_ERROR, BOXES_ERROR_INVALID, "Failed to reach host '%s' on port '%d'", _data_->_tmp21_, _data_->_tmp24_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = _data_->_tmp25_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->network_monitor);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->connectable);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->address);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block73_data_unref (_data_->_data73_);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data73_ = NULL;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1421 "downloader.c"
		} else {
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1425 "downloader.c"
		}
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1431 "downloader.c"
	}
#line 91 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->total_num_bytes = (gint64) 0;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp26_ = _data_->_data73_->msg;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_connect_data (_data_->_tmp26_, "got-headers", (GCallback) ___lambda57__soup_message_got_headers, block73_data_ref (_data_->_data73_), (GClosureNotify) block73_data_unref, 0);
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_->current_num_bytes = (gint64) 0;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp27_ = _data_->_data73_->msg;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_connect_data (_data_->_tmp27_, "got-chunk", (GCallback) ___lambda58__soup_message_got_chunk, block73_data_ref (_data_->_data73_), (GClosureNotify) block73_data_unref, 0);
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp28_ = _data_->self->priv->session;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp29_ = _data_->_data73_->msg;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp30_ = _g_object_ref0 (_data_->_tmp29_);
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	soup_session_queue_message ((SoupSession*) _data_->_tmp28_, _data_->_tmp30_, ___lambda59__soup_session_callback, _data_->_data73_);
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_state_ = 2;
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1457 "downloader.c"
	_state_2:
	;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp31_ = _data_->_data73_->msg;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp32_ = 0U;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_get (_data_->_tmp31_, "status-code", &_data_->_tmp32_, NULL);
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp33_ = _data_->_tmp32_;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp33_ != ((guint) SOUP_STATUS_OK)) {
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp34_ = _data_->_data73_->msg;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp35_ = NULL;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_get (_data_->_tmp34_, "reason-phrase", &_data_->_tmp35_, NULL);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp36_ = _data_->_tmp35_;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp37_ = _data_->_tmp36_;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp38_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_INVALID, _data_->_tmp37_);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp39_ = _data_->_tmp38_;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->_tmp37_);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = _data_->_tmp39_;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->network_monitor);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->connectable);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->address);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block73_data_unref (_data_->_data73_);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data73_ = NULL;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1506 "downloader.c"
		} else {
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1510 "downloader.c"
		}
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1516 "downloader.c"
	}
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp40_ = _data_->cached_file;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp41_ = _data_->_data73_->msg;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp42_ = _data_->_tmp41_->response_body;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp43_ = _data_->_tmp42_->data;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp43__length1 = (gint) _data_->_tmp42_->length;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_state_ = 3;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_file_replace_contents_async (_data_->_tmp40_, _data_->_tmp43_, (gsize) _data_->_tmp43__length1, NULL, FALSE, 0, NULL, boxes_downloader_download_from_http_ready, _data_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1534 "downloader.c"
	_state_3:
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_file_replace_contents_finish (_data_->_tmp40_, _data_->_res_, NULL, &_data_->_inner_error_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_inner_error_ != NULL) {
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->network_monitor);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->connectable);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->address);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block73_data_unref (_data_->_data73_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data73_ = NULL;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1558 "downloader.c"
		} else {
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1562 "downloader.c"
		}
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1568 "downloader.c"
	}
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->network_monitor);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->connectable);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->address);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block73_data_unref (_data_->_data73_);
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data73_ = 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 1584 "downloader.c"
	} else {
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1588 "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 1594 "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 1607 "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 (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 1646 "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 1654 "downloader.c"
}


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


static gboolean boxes_downloader_fetch_os_logo_co (BoxesDownloaderFetchOsLogoData* _data_) {
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	switch (_data_->_state_) {
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 0:
#line 1677 "downloader.c"
		goto _state_0;
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 1681 "downloader.c"
		goto _state_1;
		default:
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 1686 "downloader.c"
	}
	_state_0:
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->os;
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = NULL;
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = boxes_downloader_fetch_os_logo_url (_data_->_tmp0_);
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->logo_url = _data_->_tmp1_;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = _data_->logo_url;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp2_ == NULL) {
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->logo_url);
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1707 "downloader.c"
		} else {
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1711 "downloader.c"
		}
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1717 "downloader.c"
	}
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->os;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = osinfo_product_get_name ((OsinfoProduct*) _data_->_tmp3_);
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp5_ = _data_->_tmp4_;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = _data_->logo_url;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:119: %s has logo '%s'.", _data_->_tmp5_, _data_->_tmp6_);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp7_ = _data_->logo_url;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = NULL;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = g_file_new_for_uri (_data_->_tmp7_);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->remote_file = _data_->_tmp8_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = _data_->remote_file;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = NULL;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp10_ = g_file_get_basename (_data_->_tmp9_);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp11_ = _data_->_tmp10_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = NULL;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp12_ = boxes_get_logo_cache (_data_->_tmp11_);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp13_ = _data_->_tmp12_;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->_tmp11_);
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->cached_path = _data_->_tmp13_;
#line 1755 "downloader.c"
	{
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp14_ = NULL;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp14_ = boxes_downloader_get_instance ();
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp15_ = _data_->_tmp14_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp16_ = _data_->remote_file;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp17_ = _data_->cached_path;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp18_ = boxes_activity_progress_new ();
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp19_ = _data_->_tmp18_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 1;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		boxes_downloader_download (_data_->_tmp15_, _data_->_tmp16_, _data_->_tmp17_, _data_->_tmp19_, boxes_downloader_fetch_os_logo_ready, _data_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1777 "downloader.c"
		_state_1:
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp20_ = NULL;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp20_ = boxes_downloader_download_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp21_ = _data_->_tmp20_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->_tmp19_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->_tmp15_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->cached_file = _data_->_tmp21_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 1793 "downloader.c"
			goto __catch104_g_error;
		}
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp22_ = _data_->cached_file;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = NULL;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp23_ = g_file_get_path (_data_->_tmp22_);
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp24_ = _data_->_tmp23_;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp25_ = _data_->size;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp26_ = _data_->size;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp27_ = gdk_pixbuf_new_from_file_at_size (_data_->_tmp24_, _data_->_tmp25_, _data_->_tmp26_, &_data_->_inner_error_);
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp28_ = _data_->_tmp27_;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->_tmp24_);
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->pixbuf = _data_->_tmp28_;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (_data_->cached_file);
#line 1820 "downloader.c"
			goto __catch104_g_error;
		}
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp29_ = _data_->image;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp30_ = _data_->pixbuf;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		gtk_image_set_from_pixbuf (_data_->_tmp29_, _data_->_tmp30_);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->pixbuf);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 1833 "downloader.c"
	}
	goto __finally104;
	__catch104_g_error:
	{
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = NULL;
#line 128 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp31_ = _data_->logo_url;
#line 128 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp32_ = _data_->_error_;
#line 128 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp33_ = _data_->_tmp32_->message;
#line 128 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_warning ("downloader.vala:128: Error loading logo file '%s': %s", _data_->_tmp31_, _data_->_tmp33_);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_error_free0 (_data_->_error_);
#line 1852 "downloader.c"
	}
	__finally104:
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_inner_error_ != NULL) {
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->cached_path);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->remote_file);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data_->logo_url);
#line 123 "/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 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_clear_error (&_data_->_inner_error_);
#line 123 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 1869 "downloader.c"
	}
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->cached_path);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->remote_file);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->logo_url);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1881 "downloader.c"
	} else {
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1885 "downloader.c"
	}
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 1891 "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 1906 "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 1945 "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 1956 "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 1966 "downloader.c"
}


static Block74Data* block74_data_ref (Block74Data* _data74_) {
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_atomic_int_inc (&_data74_->_ref_count_);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return _data74_;
#line 1975 "downloader.c"
}


static void block74_data_unref (void * _userdata_) {
	Block74Data* _data74_;
	_data74_ = (Block74Data*) _userdata_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_atomic_int_dec_and_test (&_data74_->_ref_count_)) {
#line 1984 "downloader.c"
		BoxesDownloader * self;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		self = _data74_->self;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		(_data74_->callback_target_destroy_notify == NULL) ? NULL : (_data74_->callback_target_destroy_notify (_data74_->callback_target), NULL);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data74_->callback = NULL;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data74_->callback_target = NULL;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data74_->callback_target_destroy_notify = NULL;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_error_free0 (_data74_->download_error);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data74_->downloaded_file);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_free0 (_data74_->uri);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (self);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_slice_free (Block74Data, _data74_);
#line 2006 "downloader.c"
	}
}


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


static void __lambda55_ (Block74Data* _data74_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file) {
	BoxesDownloader * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data74_->self;
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloader != NULL);
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloaded_uri != NULL);
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (file != NULL);
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = downloaded_uri;
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _data74_->uri;
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_strcmp0 (_tmp0_, _tmp1_) != 0) {
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return;
#line 2042 "downloader.c"
	}
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = file;
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data74_->downloaded_file);
#line 141 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data74_->downloaded_file = _tmp3_;
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data74_->callback (_data74_->callback_target);
#line 2054 "downloader.c"
}


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


static void __lambda56_ (Block74Data* _data74_, BoxesDownloader* downloader, const gchar* downloaded_uri, GFile* file, GError* _error_) {
	BoxesDownloader * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GError* _tmp2_;
	GError* _tmp3_;
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	self = _data74_->self;
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloader != NULL);
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (downloaded_uri != NULL);
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_return_if_fail (file != NULL);
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp0_ = downloaded_uri;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp1_ = _data74_->uri;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (g_strcmp0 (_tmp0_, _tmp1_) != 0) {
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return;
#line 2087 "downloader.c"
	}
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp2_ = _error_;
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_tmp3_ = _g_error_copy0 (_tmp2_);
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_error_free0 (_data74_->download_error);
#line 148 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data74_->download_error = _tmp3_;
#line 149 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data74_->callback (_data74_->callback_target);
#line 2099 "downloader.c"
}


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


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


static gboolean boxes_downloader_await_download_co (BoxesDownloaderAwaitDownloadData* _data_) {
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	switch (_data_->_state_) {
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 0:
#line 2129 "downloader.c"
		goto _state_0;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 1:
#line 2133 "downloader.c"
		goto _state_1;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		case 2:
#line 2137 "downloader.c"
		goto _state_2;
		default:
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_assert_not_reached ();
#line 2142 "downloader.c"
	}
	_state_0:
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_ = g_slice_new0 (Block74Data);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->_ref_count_ = 1;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->self = g_object_ref (_data_->self);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp0_ = _data_->uri;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->_data74_->uri);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->uri = _data_->_tmp0_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->_async_data_ = _data_;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->downloaded_file = NULL;
#line 134 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->download_error = NULL;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->callback = _boxes_downloader_await_download_co_gsource_func;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->callback_target = _data_;
#line 136 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_->callback_target_destroy_notify = NULL;
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = 0UL;
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp1_ = g_signal_connect_data (_data_->self, "downloaded", (GCallback) ___lambda55__boxes_downloader_downloaded, block74_data_ref (_data_->_data74_), (GClosureNotify) block74_data_unref, 0);
#line 137 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->downloaded_id = _data_->_tmp1_;
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = 0UL;
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp2_ = g_signal_connect_data (_data_->self, "download-failed", (GCallback) ___lambda56__boxes_downloader_download_failed, block74_data_ref (_data_->_data74_), (GClosureNotify) block74_data_unref, 0);
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->downloaded_failed_id = _data_->_tmp2_;
#line 152 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp3_ = _data_->_data74_->uri;
#line 152 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:152: '%s' already being downloaded. Waiting for downlo" \
"ad to complete..", _data_->_tmp3_);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_state_ = 1;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 2189 "downloader.c"
	_state_1:
	;
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp4_ = _data_->_data74_->uri;
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_debug ("downloader.vala:154: Finished waiting for '%s' to download.", _data_->_tmp4_);
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_handler_disconnect ((GObject*) _data_->self, _data_->downloaded_id);
#line 156 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_signal_handler_disconnect ((GObject*) _data_->self, _data_->downloaded_failed_id);
#line 158 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_data74_->download_error != NULL) {
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp5_ = _g_error_copy0 (_data_->_data74_->download_error);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_inner_error_ = _data_->_tmp5_;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_error_free (_data_->_inner_error_);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		block74_data_unref (_data_->_data74_);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_data74_ = NULL;
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_state_ == 0) {
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2218 "downloader.c"
		} else {
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 2222 "downloader.c"
		}
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_object_unref (_data_->_async_result);
#line 159 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 2228 "downloader.c"
	}
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = NULL;
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp6_ = g_file_get_path (_data_->_data74_->downloaded_file);
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp7_ = _data_->_tmp6_;
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp8_ = _data_->cached_path;
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_tmp9_ = g_strcmp0 (_data_->_tmp7_, _data_->_tmp8_) != 0;
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_free0 (_data_->_tmp7_);
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_tmp9_) {
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp10_ = _data_->cached_path;
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp11_ = NULL;
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp11_ = g_file_new_for_path (_data_->_tmp10_);
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 163 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->cached_file = _data_->_tmp11_;
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp12_ = _data_->cached_file;
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_state_ = 2;
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_file_copy_async (_data_->_data74_->downloaded_file, _data_->_tmp12_, G_FILE_COPY_OVERWRITE, G_PRIORITY_DEFAULT, NULL, NULL, NULL, boxes_downloader_await_download_ready, _data_);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		return FALSE;
#line 2262 "downloader.c"
		_state_2:
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_file_copy_finish (_data_->_data74_->downloaded_file, _data_->_res_, &_data_->_inner_error_);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		if (_data_->_inner_error_ != NULL) {
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_error_free (_data_->_inner_error_);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_g_object_unref0 (_data_->cached_file);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			block74_data_unref (_data_->_data74_);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			_data_->_data74_ = NULL;
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			if (_data_->_state_ == 0) {
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2282 "downloader.c"
			} else {
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 2286 "downloader.c"
			}
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			g_object_unref (_data_->_async_result);
#line 164 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
			return FALSE;
#line 2292 "downloader.c"
		}
	} else {
#line 166 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->_tmp13_ = _g_object_ref0 (_data_->_data74_->downloaded_file);
#line 166 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_g_object_unref0 (_data_->cached_file);
#line 166 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		_data_->cached_file = _data_->_tmp13_;
#line 2301 "downloader.c"
	}
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->result = _data_->cached_file;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block74_data_unref (_data_->_data74_);
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_ = NULL;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2313 "downloader.c"
	} else {
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 2317 "downloader.c"
	}
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_g_object_unref0 (_data_->cached_file);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	block74_data_unref (_data_->_data74_);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	_data_->_data74_ = NULL;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	if (_data_->_state_ == 0) {
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2333 "downloader.c"
	} else {
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 2337 "downloader.c"
	}
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	g_object_unref (_data_->_async_result);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/downloader.vala"
	return FALSE;
#line 2343 "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 2362 "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 2368 "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 2374 "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 2393 "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 2399 "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 2405 "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 2420 "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 2427 "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 2441 "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;
}



