/* midori-download.c generated by valac 0.38.8, the Vala compiler
 * generated from midori-download.vala, do not modify */

/*
 Copyright (C) 2012-2013 Christian Dywan <christian@twotoasts.de>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include "webkit/webkit.h"
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <glib/gstdio.h>
#include <unistd.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define MIDORI_TYPE_TAB (midori_tab_get_type ())
#define MIDORI_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_TAB, MidoriTab))
#define MIDORI_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_TAB, MidoriTabClass))
#define MIDORI_IS_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_TAB))
#define MIDORI_IS_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_TAB))
#define MIDORI_TAB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_TAB, MidoriTabClass))

typedef struct _MidoriTab MidoriTab;
typedef struct _MidoriTabClass MidoriTabClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))



gboolean sokoke_message_dialog (GtkMessageType type, const gchar* _short_, const gchar* detailed, gboolean modal);
gboolean midori_download_is_finished (WebKitDownload* download);
gint midori_download_get_type (WebKitDownload* download);
void midori_download_set_type (WebKitDownload* download, gint type);
gdouble midori_download_get_progress (WebKitDownload* download);
gchar* midori_download_calculate_tooltip (WebKitDownload* download);
gchar* midori_download_get_basename_for_display (const gchar* uri);
static guint64* _uint64_dup (guint64* self);
static gboolean _uint64_equal (const guint64 * s1, const guint64 * s2);
gchar* midori_download_get_content_type (WebKitDownload* download, const gchar* mime_type);
gboolean midori_download_has_wrong_checksum (WebKitDownload* download);
GChecksumType midori_uri_get_fingerprint (const gchar* uri, gchar* * checksum, gchar* * label);
gboolean midori_download_action_clear (WebKitDownload* download, GtkWidget* widget, GError** error);
gboolean midori_download_open (WebKitDownload* download, GtkWidget* widget, GError** error);
gchar* midori_download_action_stock_id (WebKitDownload* download);
GType midori_tab_get_type (void) G_GNUC_CONST;
const gchar* midori_download_fallback_extension (const gchar* extension, const gchar* mime_type);
gchar* midori_download_clean_filename (const gchar* filename);
gchar* midori_download_get_suggested_filename (WebKitDownload* download);
gchar* midori_download_get_filename_suggestion_for_uri (const gchar* mime_type, const gchar* uri);
gboolean midori_uri_is_location (const gchar* uri);
gchar* midori_download_get_extension_for_uri (const gchar* uri, gchar* * basename);
gchar* midori_download_get_unique_filename (const gchar* filename);
gchar* midori_download_prepare_destination_uri (WebKitDownload* download, const gchar* folder);
const gchar* midori_paths_get_tmp_dir (void);
gchar* katze_mkdir_with_parents (const gchar* pathname, gint mode);
gboolean midori_download_has_enough_space (WebKitDownload* download, const gchar* destination_uri, gboolean quiet);


gboolean midori_download_is_finished (WebKitDownload* download) {
	gboolean result = FALSE;
	WebKitDownload* _tmp0_;
	WebKitDownloadStatus _tmp1_;
	WebKitDownloadStatus _tmp2_;
#line 18 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, FALSE);
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_status (_tmp0_);
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	switch (_tmp2_) {
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_FINISHED:
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_CANCELLED:
#line 20 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_ERROR:
#line 95 "midori-download.c"
		{
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = TRUE;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 101 "midori-download.c"
		}
		default:
		{
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = FALSE;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 109 "midori-download.c"
		}
	}
}


gint midori_download_get_type (WebKitDownload* download) {
	gint result = 0;
	WebKitDownload* _tmp0_;
	gconstpointer _tmp1_;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, 0);
#line 36 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 36 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "midori-download-type");
#line 36 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = (gint) ((gintptr) _tmp1_);
#line 36 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 129 "midori-download.c"
}


void midori_download_set_type (WebKitDownload* download, gint type) {
	WebKitDownload* _tmp0_;
	gint _tmp1_;
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_if_fail (download != NULL);
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = type;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_object_set_data_full ((GObject*) _tmp0_, "midori-download-type", (gpointer) ((gintptr) _tmp1_), NULL);
#line 144 "midori-download.c"
}


gdouble midori_download_get_progress (WebKitDownload* download) {
	gdouble result = 0.0;
	WebKitDownload* _tmp0_;
	WebKitDownloadStatus _tmp1_;
	WebKitDownloadStatus _tmp2_;
	WebKitDownload* _tmp3_;
	gdouble _tmp4_;
	gdouble _tmp5_;
#line 51 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, 0.0);
#line 54 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 54 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_status (_tmp0_);
#line 54 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 54 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp2_ == WEBKIT_DOWNLOAD_STATUS_CREATED) {
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = 0.0;
#line 55 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 170 "midori-download.c"
	}
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = download;
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = webkit_download_get_progress (_tmp3_);
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp5_ = _tmp4_;
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp5_;
#line 56 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 182 "midori-download.c"
}


static guint64* _uint64_dup (guint64* self) {
	guint64* dup;
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	dup = g_new0 (guint64, 1);
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	memcpy (dup, self, sizeof (guint64));
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return dup;
#line 194 "midori-download.c"
}


static gpointer __uint64_dup0 (gpointer self) {
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return self ? _uint64_dup (self) : NULL;
#line 201 "midori-download.c"
}


static gboolean _uint64_equal (const guint64 * s1, const guint64 * s2) {
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (s1 == s2) {
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return TRUE;
#line 210 "midori-download.c"
	}
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (s1 == NULL) {
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return FALSE;
#line 216 "midori-download.c"
	}
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (s2 == NULL) {
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return FALSE;
#line 222 "midori-download.c"
	}
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return (*s1) == (*s2);
#line 226 "midori-download.c"
}


gchar* midori_download_calculate_tooltip (WebKitDownload* download) {
	gchar* result = NULL;
	gchar* filename = NULL;
	WebKitDownload* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* size = NULL;
	WebKitDownload* _tmp4_;
	guint64 _tmp5_;
	guint64 _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	WebKitDownload* _tmp9_;
	guint64 _tmp10_;
	guint64 _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gboolean _tmp16_ = FALSE;
	WebKitDownload* _tmp17_;
	gboolean _tmp18_;
	guint64 total_size = 0ULL;
	WebKitDownload* _tmp25_;
	guint64 _tmp26_;
	guint64 _tmp27_;
	guint64 current_size = 0ULL;
	WebKitDownload* _tmp28_;
	guint64 _tmp29_;
	guint64 _tmp30_;
	gdouble elapsed = 0.0;
	WebKitDownload* _tmp31_;
	gdouble _tmp32_;
	gdouble diff = 0.0;
	gdouble _tmp33_;
	guint64 _tmp34_;
	gdouble estimated = 0.0;
	guint64 _tmp35_;
	guint64 _tmp36_;
	gdouble _tmp37_;
	gint hour = 0;
	gint minute = 0;
	gint hours = 0;
	gdouble _tmp38_;
	gint _tmp39_;
	gint minutes = 0;
	gdouble _tmp40_;
	gint _tmp41_;
	gint _tmp42_;
	gint _tmp43_;
	gint seconds = 0;
	gdouble _tmp44_;
	gint _tmp45_;
	gint _tmp46_;
	gint _tmp47_;
	gint _tmp48_;
	gchar* hours_ = NULL;
	gint _tmp49_;
	gint _tmp50_;
	gchar* _tmp51_;
	gchar* minutes_ = NULL;
	gint _tmp52_;
	gint _tmp53_;
	gchar* _tmp54_;
	gchar* seconds_ = NULL;
	gint _tmp55_;
	gint _tmp56_;
	gchar* _tmp57_;
	gdouble last_time = 0.0;
	WebKitDownload* _tmp58_;
	gconstpointer _tmp59_;
	gchar* eta = NULL;
	gchar* _tmp60_;
	gdouble _tmp61_;
	gchar* speed = NULL;
	gchar* _tmp85_;
	guint64* last_size = NULL;
	WebKitDownload* _tmp86_;
	gconstpointer _tmp87_;
	guint64* _tmp88_;
	gboolean _tmp89_ = FALSE;
	guint64* _tmp90_;
	const gchar* _tmp107_;
	gchar* _tmp108_;
	gdouble _tmp109_;
	gdouble _tmp110_;
	const gchar* _tmp116_;
	const gchar* _tmp117_;
	const gchar* _tmp118_;
	const gchar* _tmp119_;
	gchar* _tmp120_;
#line 62 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, NULL);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_destination_uri (_tmp0_);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = midori_download_get_basename_for_display (_tmp2_);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	filename = _tmp3_;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = download;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp5_ = webkit_download_get_current_size (_tmp4_);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp6_ = _tmp5_;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp7_ = g_format_size_full (_tmp6_, G_FORMAT_SIZE_DEFAULT);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp8_ = _tmp7_;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp9_ = download;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp10_ = webkit_download_get_total_size (_tmp9_);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp11_ = _tmp10_;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp12_ = g_format_size_full (_tmp11_, G_FORMAT_SIZE_DEFAULT);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp13_ = _tmp12_;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp14_ = g_strdup_printf (_ ("%s of %s"), _tmp8_, _tmp13_);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp15_ = _tmp14_;
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (_tmp13_);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (_tmp8_);
#line 66 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	size = _tmp15_;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp17_ = download;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp18_ = midori_download_is_finished (_tmp17_);
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp18_) {
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp16_ = TRUE;
#line 372 "midori-download.c"
	} else {
		WebKitDownload* _tmp19_;
		WebKitDownloadStatus _tmp20_;
		WebKitDownloadStatus _tmp21_;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp19_ = download;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp20_ = webkit_download_get_status (_tmp19_);
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp21_ = _tmp20_;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp16_ = _tmp21_ == WEBKIT_DOWNLOAD_STATUS_CREATED;
#line 385 "midori-download.c"
	}
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp16_) {
#line 389 "midori-download.c"
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		gchar* _tmp24_;
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp22_ = filename;
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp23_ = size;
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp24_ = g_strdup_printf ("%s\n%s", _tmp22_, _tmp23_);
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = _tmp24_;
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (size);
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (filename);
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 407 "midori-download.c"
	}
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp25_ = download;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp26_ = webkit_download_get_total_size (_tmp25_);
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp27_ = _tmp26_;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	total_size = _tmp27_;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp28_ = download;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp29_ = webkit_download_get_current_size (_tmp28_);
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp30_ = _tmp29_;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	current_size = _tmp30_;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp31_ = download;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp32_ = webkit_download_get_elapsed_time (_tmp31_);
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	elapsed = _tmp32_;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp33_ = elapsed;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp34_ = current_size;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	diff = _tmp33_ / _tmp34_;
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp35_ = total_size;
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp36_ = current_size;
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp37_ = diff;
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	estimated = (_tmp35_ - _tmp36_) * _tmp37_;
#line 78 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	hour = 3600;
#line 78 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	minute = 60;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp38_ = estimated;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp39_ = hour;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	hours = (gint) (_tmp38_ / _tmp39_);
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp40_ = estimated;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp41_ = hours;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp42_ = hour;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp43_ = minute;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	minutes = (gint) ((_tmp40_ - (_tmp41_ * _tmp42_)) / _tmp43_);
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp44_ = estimated;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp45_ = hours;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp46_ = hour;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp47_ = minutes;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp48_ = minute;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	seconds = (gint) ((_tmp44_ - (_tmp45_ * _tmp46_)) - (_tmp47_ * _tmp48_));
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp49_ = hours;
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp50_ = hours;
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp51_ = g_strdup_printf (ngettext ("%d hour", "%d hours", (gulong) _tmp49_), _tmp50_);
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	hours_ = _tmp51_;
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp52_ = minutes;
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp53_ = minutes;
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp54_ = g_strdup_printf (ngettext ("%d minute", "%d minutes", (gulong) _tmp52_), _tmp53_);
#line 83 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	minutes_ = _tmp54_;
#line 84 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp55_ = seconds;
#line 84 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp56_ = seconds;
#line 84 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp57_ = g_strdup_printf (ngettext ("%d second", "%d seconds", (gulong) _tmp55_), _tmp56_);
#line 84 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	seconds_ = _tmp57_;
#line 85 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp58_ = download;
#line 85 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp59_ = g_object_get_data ((GObject*) _tmp58_, "last-time");
#line 85 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	last_time = (gdouble) ((gint) ((gintptr) _tmp59_));
#line 87 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp60_ = g_strdup ("");
#line 87 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	eta = _tmp60_;
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp61_ = estimated;
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp61_ > ((gdouble) 0)) {
#line 515 "midori-download.c"
		gint _tmp62_;
		const gchar* _tmp82_;
#line 89 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp62_ = hours;
#line 89 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp62_ > 0) {
#line 522 "midori-download.c"
			const gchar* _tmp63_;
			gchar* _tmp64_;
			gchar* _tmp65_;
			const gchar* _tmp66_;
			gchar* _tmp67_;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp63_ = hours_;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp64_ = g_strconcat (_tmp63_, ", ", NULL);
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp65_ = _tmp64_;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp66_ = minutes_;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp67_ = g_strconcat (_tmp65_, _tmp66_, NULL);
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (eta);
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			eta = _tmp67_;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (_tmp65_);
#line 544 "midori-download.c"
		} else {
			gint _tmp68_;
#line 91 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp68_ = minutes;
#line 91 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			if (_tmp68_ >= 10) {
#line 551 "midori-download.c"
				const gchar* _tmp69_;
				gchar* _tmp70_;
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp69_ = minutes_;
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp70_ = g_strdup (_tmp69_);
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (eta);
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				eta = _tmp70_;
#line 562 "midori-download.c"
			} else {
				gboolean _tmp71_ = FALSE;
				gint _tmp72_;
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp72_ = minutes;
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (_tmp72_ < 10) {
#line 570 "midori-download.c"
					gint _tmp73_;
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp73_ = minutes;
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp71_ = _tmp73_ > 0;
#line 576 "midori-download.c"
				} else {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp71_ = FALSE;
#line 580 "midori-download.c"
				}
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (_tmp71_) {
#line 584 "midori-download.c"
					const gchar* _tmp74_;
					gchar* _tmp75_;
					gchar* _tmp76_;
					const gchar* _tmp77_;
					gchar* _tmp78_;
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp74_ = minutes_;
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp75_ = g_strconcat (_tmp74_, ", ", NULL);
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp76_ = _tmp75_;
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp77_ = seconds_;
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp78_ = g_strconcat (_tmp76_, _tmp77_, NULL);
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_g_free0 (eta);
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					eta = _tmp78_;
#line 94 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_g_free0 (_tmp76_);
#line 606 "midori-download.c"
				} else {
					gint _tmp79_;
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp79_ = seconds;
#line 95 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					if (_tmp79_ > 0) {
#line 613 "midori-download.c"
						const gchar* _tmp80_;
						gchar* _tmp81_;
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
						_tmp80_ = seconds_;
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
						_tmp81_ = g_strdup (_tmp80_);
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
						_g_free0 (eta);
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
						eta = _tmp81_;
#line 624 "midori-download.c"
					}
				}
			}
		}
#line 97 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp82_ = eta;
#line 97 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (g_strcmp0 (_tmp82_, "") != 0) {
#line 633 "midori-download.c"
			const gchar* _tmp83_;
			gchar* _tmp84_;
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp83_ = eta;
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp84_ = g_strdup_printf (_ (" - %s remaining"), _tmp83_);
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (eta);
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			eta = _tmp84_;
#line 644 "midori-download.c"
		}
	}
#line 102 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp85_ = g_strdup ("");
#line 102 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	speed = _tmp85_;
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp86_ = download;
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp87_ = g_object_get_data ((GObject*) _tmp86_, "last-size");
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp88_ = __uint64_dup0 ((guint64*) _tmp87_);
#line 103 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	last_size = _tmp88_;
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp90_ = last_size;
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp90_ != NULL) {
#line 663 "midori-download.c"
		gdouble _tmp91_;
		gdouble _tmp92_;
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp91_ = elapsed;
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp92_ = last_time;
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp89_ = _tmp91_ != _tmp92_;
#line 672 "midori-download.c"
	} else {
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp89_ = FALSE;
#line 676 "midori-download.c"
	}
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp89_) {
#line 680 "midori-download.c"
		guint64 _tmp93_;
		guint64* _tmp94_;
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp93_ = current_size;
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp94_ = last_size;
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_uint64_equal (&_tmp93_, _tmp94_) != TRUE) {
#line 689 "midori-download.c"
			guint64 _tmp95_;
			guint64* _tmp96_;
			gdouble _tmp97_;
			gdouble _tmp98_;
			gchar* _tmp99_;
			WebKitDownload* _tmp100_;
			const gchar* _tmp101_;
			gchar* _tmp102_;
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp95_ = current_size;
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp96_ = last_size;
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp97_ = elapsed;
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp98_ = last_time;
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp99_ = g_format_size_full ((guint64) ((_tmp95_ - (*_tmp96_)) / (_tmp97_ - _tmp98_)), G_FORMAT_SIZE_DEFAULT);
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (speed);
#line 106 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			speed = _tmp99_;
#line 108 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp100_ = download;
#line 108 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp101_ = speed;
#line 108 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp102_ = g_strdup (_tmp101_);
#line 108 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			g_object_set_data_full ((GObject*) _tmp100_, "last-speed", _tmp102_, g_free);
#line 720 "midori-download.c"
		} else {
			WebKitDownload* _tmp103_;
			gconstpointer _tmp104_;
			gchar* _tmp105_;
#line 111 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp103_ = download;
#line 111 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp104_ = g_object_get_data ((GObject*) _tmp103_, "last-speed");
#line 111 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp105_ = g_strdup ((const gchar*) _tmp104_);
#line 111 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (speed);
#line 111 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			speed = _tmp105_;
#line 735 "midori-download.c"
		}
	} else {
		gchar* _tmp106_;
#line 116 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp106_ = g_strdup (_ ("?B"));
#line 116 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (speed);
#line 116 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		speed = _tmp106_;
#line 745 "midori-download.c"
	}
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp107_ = speed;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp108_ = g_strdup_printf (_ (" (%s/s)"), _tmp107_);
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (speed);
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	speed = _tmp108_;
#line 120 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp109_ = elapsed;
#line 120 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp110_ = last_time;
#line 120 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if ((_tmp109_ - _tmp110_) > 0.0) {
#line 761 "midori-download.c"
		WebKitDownload* _tmp111_;
		gdouble _tmp112_;
		WebKitDownload* _tmp113_;
		guint64 _tmp114_;
		guint64* _tmp115_;
#line 121 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp111_ = download;
#line 121 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp112_ = elapsed;
#line 121 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_object_set_data_full ((GObject*) _tmp111_, "last-time", (gpointer) ((gintptr) ((gint) _tmp112_)), NULL);
#line 122 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp113_ = download;
#line 122 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp114_ = current_size;
#line 122 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp115_ = __uint64_dup0 (&_tmp114_);
#line 122 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_object_set_data_full ((GObject*) _tmp113_, "last-size", _tmp115_, g_free);
#line 781 "midori-download.c"
	}
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp116_ = filename;
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp117_ = size;
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp118_ = speed;
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp119_ = eta;
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp120_ = g_strdup_printf ("%s\n%s %s%s", _tmp116_, _tmp117_, _tmp118_, _tmp119_);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp120_;
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (last_size);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (speed);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (eta);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (seconds_);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (minutes_);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (hours_);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (size);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (filename);
#line 125 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 813 "midori-download.c"
}


gchar* midori_download_get_content_type (WebKitDownload* download, const gchar* mime_type) {
	gchar* result = NULL;
	gchar* content_type = NULL;
	WebKitDownload* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, NULL);
#line 146 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 146 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_suggested_filename (_tmp0_);
#line 146 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 146 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = g_content_type_guess (_tmp2_, NULL, (gsize) 0, NULL);
#line 146 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	content_type = _tmp3_;
#line 148 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = content_type;
#line 148 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp4_ == NULL) {
#line 841 "midori-download.c"
		const gchar* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
#line 149 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp5_ = mime_type;
#line 149 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp6_ = g_content_type_from_mime_type (_tmp5_);
#line 149 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (content_type);
#line 149 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		content_type = _tmp6_;
#line 150 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp7_ = content_type;
#line 150 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp7_ == NULL) {
#line 857 "midori-download.c"
			gchar* _tmp8_;
#line 151 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp8_ = g_content_type_from_mime_type ("application/octet-stream");
#line 151 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (content_type);
#line 151 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			content_type = _tmp8_;
#line 865 "midori-download.c"
		}
	}
#line 153 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = content_type;
#line 153 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 872 "midori-download.c"
}


gboolean midori_download_has_wrong_checksum (WebKitDownload* download) {
	gboolean result = FALSE;
	gint status = 0;
	WebKitDownload* _tmp0_;
	gconstpointer _tmp1_;
	gint _tmp2_;
	gint _tmp36_;
	GError * _inner_error_ = NULL;
#line 156 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, FALSE);
#line 157 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 157 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "checksum-status");
#line 157 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	status = (gint) ((gintptr) _tmp1_);
#line 158 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = status;
#line 158 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp2_ == 0) {
#line 896 "midori-download.c"
		gchar* original_uri = NULL;
		WebKitDownload* _tmp3_;
		WebKitNetworkRequest* _tmp4_;
		WebKitNetworkRequest* _tmp5_;
		gconstpointer _tmp6_;
		gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* fingerprint = NULL;
		GChecksumType checksum_type = 0;
		const gchar* _tmp12_;
		gchar* _tmp13_ = NULL;
		GChecksumType _tmp14_;
		const gchar* _tmp15_;
		WebKitDownload* _tmp34_;
		gint _tmp35_;
#line 163 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp3_ = download;
#line 163 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp4_ = webkit_download_get_network_request (_tmp3_);
#line 163 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp5_ = _tmp4_;
#line 163 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp6_ = g_object_get_data ((GObject*) _tmp5_, "midori-original-uri");
#line 163 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp7_ = g_strdup ((const gchar*) _tmp6_);
#line 163 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		original_uri = _tmp7_;
#line 164 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp8_ = original_uri;
#line 164 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp8_ == NULL) {
#line 928 "midori-download.c"
			WebKitDownload* _tmp9_;
			const gchar* _tmp10_;
			gchar* _tmp11_;
#line 165 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp9_ = download;
#line 165 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp10_ = webkit_download_get_uri (_tmp9_);
#line 165 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp11_ = g_strdup (_tmp10_);
#line 165 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (original_uri);
#line 165 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			original_uri = _tmp11_;
#line 942 "midori-download.c"
		}
#line 168 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp12_ = original_uri;
#line 168 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp14_ = midori_uri_get_fingerprint (_tmp12_, &_tmp13_, NULL);
#line 168 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (fingerprint);
#line 168 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		fingerprint = _tmp13_;
#line 168 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		checksum_type = _tmp14_;
#line 170 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		status = 2;
#line 171 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp15_ = fingerprint;
#line 171 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp15_ != NULL) {
#line 960 "midori-download.c"
			{
				gchar* filename = NULL;
				WebKitDownload* _tmp16_;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* contents = NULL;
				gsize length = 0UL;
				gboolean y = FALSE;
				const gchar* _tmp20_;
				gchar* _tmp21_ = NULL;
				gsize _tmp22_ = 0UL;
				gboolean _tmp23_;
				gchar* checksum = NULL;
				GChecksumType _tmp24_;
				const gchar* _tmp25_;
				gsize _tmp26_;
				gchar* _tmp27_;
				gboolean _tmp28_ = FALSE;
				gboolean _tmp29_;
#line 176 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp16_ = download;
#line 176 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp17_ = webkit_download_get_destination_uri (_tmp16_);
#line 176 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp18_ = _tmp17_;
#line 176 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp19_ = g_filename_from_uri (_tmp18_, NULL, &_inner_error_);
#line 176 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				filename = _tmp19_;
#line 176 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 993 "midori-download.c"
					goto __catch16_g_error;
				}
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp20_ = filename;
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp23_ = g_file_get_contents (_tmp20_, &_tmp21_, &_tmp22_, &_inner_error_);
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (contents);
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				contents = _tmp21_;
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				length = _tmp22_;
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				y = _tmp23_;
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_g_free0 (contents);
#line 180 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_g_free0 (filename);
#line 1014 "midori-download.c"
					goto __catch16_g_error;
				}
#line 181 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp24_ = checksum_type;
#line 181 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp25_ = contents;
#line 181 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp26_ = length;
#line 181 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp27_ = g_compute_checksum_for_string (_tmp24_, _tmp25_, _tmp26_);
#line 181 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				checksum = _tmp27_;
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp29_ = y;
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (!_tmp29_) {
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp28_ = TRUE;
#line 1033 "midori-download.c"
				} else {
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					gint _tmp32_;
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp30_ = fingerprint;
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp31_ = checksum;
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp32_ = g_ascii_strcasecmp (_tmp30_, _tmp31_);
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp28_ = _tmp32_ != 0;
#line 1046 "midori-download.c"
				}
#line 183 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (_tmp28_) {
#line 184 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					status = 1;
#line 1052 "midori-download.c"
				}
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (checksum);
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (contents);
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (filename);
#line 1060 "midori-download.c"
			}
			goto __finally16;
			__catch16_g_error:
			{
				GError* _error_ = NULL;
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_error_ = _inner_error_;
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_inner_error_ = NULL;
#line 187 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				status = 1;
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_error_free0 (_error_);
#line 1074 "midori-download.c"
			}
			__finally16:
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1079 "midori-download.c"
				gboolean _tmp33_ = FALSE;
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (fingerprint);
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (original_uri);
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				g_clear_error (&_inner_error_);
#line 172 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				return _tmp33_;
#line 1091 "midori-download.c"
			}
		}
#line 190 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp34_ = download;
#line 190 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp35_ = status;
#line 190 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_object_set_data_full ((GObject*) _tmp34_, "checksum-status", (gpointer) ((gintptr) _tmp35_), NULL);
#line 158 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (fingerprint);
#line 158 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (original_uri);
#line 1104 "midori-download.c"
	}
#line 192 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp36_ = status;
#line 192 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp36_ == 1;
#line 192 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1112 "midori-download.c"
}


gboolean midori_download_action_clear (WebKitDownload* download, GtkWidget* widget, GError** error) {
	gboolean result = FALSE;
	WebKitDownload* _tmp0_;
	WebKitDownloadStatus _tmp1_;
	WebKitDownloadStatus _tmp2_;
	GError * _inner_error_ = NULL;
#line 196 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, FALSE);
#line 196 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (widget != NULL, FALSE);
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_status (_tmp0_);
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	switch (_tmp2_) {
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_CREATED:
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_STARTED:
#line 1138 "midori-download.c"
		{
			WebKitDownload* _tmp3_;
#line 201 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp3_ = download;
#line 201 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			webkit_download_cancel (_tmp3_);
#line 202 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			break;
#line 1147 "midori-download.c"
		}
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_FINISHED:
#line 1151 "midori-download.c"
		{
			gboolean _tmp4_ = FALSE;
			WebKitDownload* _tmp5_;
			GtkWidget* _tmp6_;
			gboolean _tmp7_;
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp5_ = download;
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp6_ = widget;
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp7_ = midori_download_open (_tmp5_, _tmp6_, &_inner_error_);
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp4_ = _tmp7_;
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1167 "midori-download.c"
				gboolean _tmp8_ = FALSE;
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				g_propagate_error (error, _inner_error_);
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				return _tmp8_;
#line 1173 "midori-download.c"
			}
#line 204 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			if (_tmp4_) {
#line 205 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				result = TRUE;
#line 205 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				return result;
#line 1181 "midori-download.c"
			}
#line 206 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			break;
#line 1185 "midori-download.c"
		}
#line 198 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_CANCELLED:
#line 1189 "midori-download.c"
		{
#line 208 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = TRUE;
#line 208 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1195 "midori-download.c"
		}
		default:
		{
			WebKitDownload* _tmp9_;
			WebKitDownloadStatus _tmp10_;
			WebKitDownloadStatus _tmp11_;
#line 210 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp9_ = download;
#line 210 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp10_ = webkit_download_get_status (_tmp9_);
#line 210 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp11_ = _tmp10_;
#line 210 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			g_critical ("midori-download.vala:210: action_clear: %d", (gint) _tmp11_);
#line 211 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			g_warn_if_reached ();
#line 212 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			break;
#line 1214 "midori-download.c"
		}
	}
#line 223 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = FALSE;
#line 223 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1221 "midori-download.c"
}


gchar* midori_download_action_stock_id (WebKitDownload* download) {
	gchar* result = NULL;
	WebKitDownload* _tmp0_;
	WebKitDownloadStatus _tmp1_;
	WebKitDownloadStatus _tmp2_;
#line 226 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, NULL);
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_status (_tmp0_);
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	switch (_tmp2_) {
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_CREATED:
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_STARTED:
#line 1244 "midori-download.c"
		{
			gchar* _tmp3_;
#line 231 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp3_ = g_strdup (GTK_STOCK_CANCEL);
#line 231 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp3_;
#line 231 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1253 "midori-download.c"
		}
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_FINISHED:
#line 1257 "midori-download.c"
		{
			WebKitDownload* _tmp4_;
			gboolean _tmp5_;
			gchar* _tmp7_;
#line 233 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp4_ = download;
#line 233 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp5_ = midori_download_has_wrong_checksum (_tmp4_);
#line 233 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			if (_tmp5_) {
#line 1268 "midori-download.c"
				gchar* _tmp6_;
#line 234 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp6_ = g_strdup (GTK_STOCK_DIALOG_WARNING);
#line 234 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				result = _tmp6_;
#line 234 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				return result;
#line 1276 "midori-download.c"
			}
#line 235 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp7_ = g_strdup (GTK_STOCK_OPEN);
#line 235 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp7_;
#line 235 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1284 "midori-download.c"
		}
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_CANCELLED:
#line 1288 "midori-download.c"
		{
			gchar* _tmp8_;
#line 237 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp8_ = g_strdup (GTK_STOCK_CLEAR);
#line 237 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp8_;
#line 237 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1297 "midori-download.c"
		}
#line 228 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		case WEBKIT_DOWNLOAD_STATUS_ERROR:
#line 1301 "midori-download.c"
		{
			gchar* _tmp9_;
#line 239 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp9_ = g_strdup (GTK_STOCK_DIALOG_ERROR);
#line 239 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp9_;
#line 239 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1310 "midori-download.c"
		}
		default:
		{
			WebKitDownload* _tmp10_;
			WebKitDownloadStatus _tmp11_;
			WebKitDownloadStatus _tmp12_;
			gchar* _tmp13_;
#line 241 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp10_ = download;
#line 241 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp11_ = webkit_download_get_status (_tmp10_);
#line 241 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp12_ = _tmp11_;
#line 241 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			g_critical ("midori-download.vala:241: action_stock_id: %d", (gint) _tmp12_);
#line 242 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			g_warn_if_reached ();
#line 243 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp13_ = g_strdup (GTK_STOCK_MISSING_IMAGE);
#line 243 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp13_;
#line 243 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1334 "midori-download.c"
		}
	}
}


static gpointer _g_object_ref0 (gpointer self) {
#line 264 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return self ? g_object_ref (self) : NULL;
#line 1343 "midori-download.c"
}


gboolean midori_download_open (WebKitDownload* download, GtkWidget* widget, GError** error) {
	gboolean result = FALSE;
	WebKitDownload* _tmp0_;
	gboolean _tmp1_;
#line 256 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, FALSE);
#line 256 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (widget != NULL, FALSE);
#line 257 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 257 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = midori_download_has_wrong_checksum (_tmp0_);
#line 257 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp1_) {
#line 258 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		sokoke_message_dialog (GTK_MESSAGE_WARNING, _ ("The downloaded file is erroneous."), _ ("The checksum provided with the link did not match. This means the file" \
" is probably incomplete or was modified afterwards."), TRUE);
#line 262 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = TRUE;
#line 262 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1367 "midori-download.c"
	} else {
		GtkWidget* browser = NULL;
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		MidoriTab* tab = NULL;
		GtkWidget* _tmp5_;
		MidoriTab* _tmp6_;
#line 264 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp2_ = widget;
#line 264 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp3_ = gtk_widget_get_toplevel (_tmp2_);
#line 264 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp4_ = _g_object_ref0 (_tmp3_);
#line 264 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		browser = _tmp4_;
#line 265 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		tab = NULL;
#line 266 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp5_ = browser;
#line 266 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_object_get ((GObject*) _tmp5_, "tab", &tab, NULL);
#line 267 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp6_ = tab;
#line 267 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp6_ != NULL) {
#line 1394 "midori-download.c"
			MidoriTab* _tmp7_;
			WebKitDownload* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gboolean _tmp11_ = FALSE;
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp7_ = tab;
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp8_ = download;
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp9_ = webkit_download_get_destination_uri (_tmp8_);
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp10_ = _tmp9_;
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			g_signal_emit_by_name (_tmp7_, "open-uri", _tmp10_, &_tmp11_);
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp11_;
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_object_unref0 (tab);
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_object_unref0 (browser);
#line 271 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 1418 "midori-download.c"
		}
#line 257 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (tab);
#line 257 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (browser);
#line 1424 "midori-download.c"
	}
#line 274 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = FALSE;
#line 274 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1430 "midori-download.c"
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_;
	gchar _tmp1_;
#line 1118 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, '\0');
#line 1119 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = index;
#line 1119 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = ((gchar*) self)[_tmp0_];
#line 1119 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 1119 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 1448 "midori-download.c"
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gchar* _tmp1_;
#line 1411 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1411 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = needle;
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp1_ != NULL;
#line 1412 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 1468 "midori-download.c"
}


const gchar* midori_download_fallback_extension (const gchar* extension, const gchar* mime_type) {
	const gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp7_;
	gboolean _tmp8_;
	const gchar* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gboolean _tmp12_;
#line 277 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (mime_type != NULL, NULL);
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = extension;
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp1_ != NULL) {
#line 1490 "midori-download.c"
		const gchar* _tmp2_;
		gchar _tmp3_;
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp2_ = extension;
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp3_ = string_get (_tmp2_, (glong) 0);
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp0_ = _tmp3_ != '\0';
#line 1499 "midori-download.c"
	} else {
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp0_ = FALSE;
#line 1503 "midori-download.c"
	}
#line 278 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp0_) {
#line 1507 "midori-download.c"
		const gchar* _tmp4_;
#line 279 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp4_ = extension;
#line 279 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = _tmp4_;
#line 279 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1515 "midori-download.c"
	}
#line 280 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp5_ = mime_type;
#line 280 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp6_ = string_contains (_tmp5_, "css");
#line 280 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp6_) {
#line 281 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = ".css";
#line 281 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1527 "midori-download.c"
	}
#line 282 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp7_ = mime_type;
#line 282 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp8_ = string_contains (_tmp7_, "javascript");
#line 282 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp8_) {
#line 283 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = ".js";
#line 283 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1539 "midori-download.c"
	}
#line 284 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp9_ = mime_type;
#line 284 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp10_ = string_contains (_tmp9_, "html");
#line 284 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp10_) {
#line 285 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = ".htm";
#line 285 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1551 "midori-download.c"
	}
#line 286 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp11_ = mime_type;
#line 286 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp12_ = string_contains (_tmp11_, "plain");
#line 286 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp12_) {
#line 287 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = ".txt";
#line 287 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1563 "midori-download.c"
	}
#line 288 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = "";
#line 288 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1569 "midori-download.c"
}


static gchar* string_delimit (const gchar* self, const gchar* delimiters, gchar new_delimiter) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar _tmp3_;
#line 1250 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1250 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (delimiters != NULL, NULL);
#line 1251 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1251 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1252 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1252 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp2_ = delimiters;
#line 1252 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp3_ = new_delimiter;
#line 1252 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_strdelimit (_tmp1_, _tmp2_, _tmp3_);
#line 1253 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _result_;
#line 1253 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 1600 "midori-download.c"
}


gchar* midori_download_clean_filename (const gchar* filename) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
#line 291 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 295 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = filename;
#line 295 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = string_delimit (_tmp0_, "/ ", '_');
#line 295 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp1_;
#line 295 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1618 "midori-download.c"
}


gchar* midori_download_get_suggested_filename (WebKitDownload* download) {
	gchar* result = NULL;
	WebKitDownload* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
#line 299 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, NULL);
#line 303 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 303 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = webkit_download_get_suggested_filename (_tmp0_);
#line 303 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = midori_download_clean_filename (_tmp1_);
#line 303 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp2_;
#line 303 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1639 "midori-download.c"
}


/**
         * Returns a filename of the form "name.ext" to use as a suggested name for
         * a download of the given uri
         */
static gint string_index_of_char (const gchar* self, gunichar c, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_;
	gunichar _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1039 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1040 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1040 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = c;
#line 1040 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp2_ = g_utf8_strchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_);
#line 1040 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1042 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1042 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1668 "midori-download.c"
		gchar* _tmp4_;
#line 1043 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1043 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1043 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1676 "midori-download.c"
	} else {
#line 1045 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = -1;
#line 1045 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1682 "midori-download.c"
	}
}


gchar* midori_download_get_filename_suggestion_for_uri (const gchar* mime_type, const gchar* uri) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp2_;
	gchar* filename = NULL;
	const gchar* _tmp3_;
	GFile* _tmp4_;
	GFile* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gint _tmp9_;
#line 316 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (mime_type != NULL, NULL);
#line 316 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (uri != NULL, NULL);
#line 317 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = uri;
#line 317 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = midori_uri_is_location (_tmp0_);
#line 317 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = uri;
#line 317 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (_tmp1_, _tmp2_);
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = uri;
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = g_file_new_for_uri (_tmp3_);
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp5_ = _tmp4_;
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp6_ = g_file_get_basename (_tmp5_);
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp7_ = _tmp6_;
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_object_unref0 (_tmp5_);
#line 318 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	filename = _tmp7_;
#line 319 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp8_ = uri;
#line 319 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp9_ = string_index_of_char (_tmp8_, (gunichar) '.', 0);
#line 319 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp9_ == -1) {
#line 1732 "midori-download.c"
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp10_ = filename;
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp11_ = mime_type;
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp12_ = midori_download_fallback_extension (NULL, _tmp11_);
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp13_ = g_build_filename (_tmp10_, _tmp12_, NULL);
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = _tmp13_;
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (filename);
#line 320 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 1751 "midori-download.c"
	}
#line 321 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = filename;
#line 321 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 1757 "midori-download.c"
}


static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_;
	gunichar _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1049 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1050 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1050 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = c;
#line 1050 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_);
#line 1050 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1052 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1052 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1782 "midori-download.c"
		gchar* _tmp4_;
#line 1053 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1053 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1053 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1790 "midori-download.c"
	} else {
#line 1055 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = -1;
#line 1055 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1796 "midori-download.c"
	}
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_;
	glong _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1330 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 1330 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = maxlen;
#line 1330 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
#line 1330 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	end = _tmp2_;
#line 1331 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp3_ = end;
#line 1331 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp3_ == NULL) {
#line 1820 "midori-download.c"
		glong _tmp4_;
#line 1332 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = maxlen;
#line 1332 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = _tmp4_;
#line 1332 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1828 "midori-download.c"
	} else {
		gchar* _tmp5_;
		gchar* _tmp6_;
#line 1334 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp5_ = end;
#line 1334 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp6_ = str;
#line 1334 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = (glong) (_tmp5_ - _tmp6_);
#line 1334 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1840 "midori-download.c"
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_;
	glong _tmp8_;
	glong _tmp14_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	glong _tmp21_;
	gchar* _tmp22_;
#line 1341 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1343 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = offset;
#line 1343 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp1_ >= ((glong) 0)) {
#line 1864 "midori-download.c"
		glong _tmp2_;
#line 1343 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp2_ = len;
#line 1343 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp0_ = _tmp2_ >= ((glong) 0);
#line 1870 "midori-download.c"
	} else {
#line 1343 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 1874 "midori-download.c"
	}
#line 1343 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 1878 "midori-download.c"
		glong _tmp3_;
		glong _tmp4_;
		glong _tmp5_;
#line 1345 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp3_ = offset;
#line 1345 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = len;
#line 1345 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
#line 1345 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		string_length = _tmp5_;
#line 1890 "midori-download.c"
	} else {
		gint _tmp6_;
		gint _tmp7_;
#line 1347 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp6_ = strlen (self);
#line 1347 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp6_;
#line 1347 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp7_;
#line 1900 "midori-download.c"
	}
#line 1350 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp8_ = offset;
#line 1350 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp8_ < ((glong) 0)) {
#line 1906 "midori-download.c"
		glong _tmp9_;
		glong _tmp10_;
		glong _tmp11_;
#line 1351 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp9_ = string_length;
#line 1351 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp10_ = offset;
#line 1351 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		offset = _tmp9_ + _tmp10_;
#line 1352 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp11_ = offset;
#line 1352 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
#line 1920 "midori-download.c"
	} else {
		glong _tmp12_;
		glong _tmp13_;
#line 1354 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp12_ = offset;
#line 1354 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp13_ = string_length;
#line 1354 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
#line 1930 "midori-download.c"
	}
#line 1356 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp14_ = len;
#line 1356 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp14_ < ((glong) 0)) {
#line 1936 "midori-download.c"
		glong _tmp15_;
		glong _tmp16_;
#line 1357 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1357 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp16_ = offset;
#line 1357 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		len = _tmp15_ - _tmp16_;
#line 1945 "midori-download.c"
	}
#line 1359 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp17_ = offset;
#line 1359 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp18_ = len;
#line 1359 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp19_ = string_length;
#line 1359 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
#line 1360 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp20_ = offset;
#line 1360 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp21_ = len;
#line 1360 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
#line 1360 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp22_;
#line 1360 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 1965 "midori-download.c"
}


gchar* midori_download_get_extension_for_uri (const gchar* uri, gchar* * basename) {
	gchar* _vala_basename = NULL;
	gchar* result = NULL;
	gint last_slash = 0;
	const gchar* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint period = 0;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gint query = 0;
	const gchar* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gchar* extension = NULL;
	const gchar* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	gint _tmp16_;
	gchar* _tmp17_;
#line 324 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (uri != NULL, NULL);
#line 325 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (_vala_basename);
#line 325 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_vala_basename = NULL;
#line 327 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = uri;
#line 327 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = string_last_index_of_char (_tmp0_, (gunichar) '/', 0);
#line 327 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	last_slash = _tmp1_;
#line 329 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = last_slash;
#line 329 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp2_ == -1) {
#line 330 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = NULL;
#line 330 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (basename) {
#line 330 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			*basename = _vala_basename;
#line 2016 "midori-download.c"
		} else {
#line 330 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (_vala_basename);
#line 2020 "midori-download.c"
		}
#line 330 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 2024 "midori-download.c"
	}
#line 331 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = uri;
#line 331 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = last_slash;
#line 331 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp5_ = string_last_index_of_char (_tmp3_, (gunichar) '.', _tmp4_);
#line 331 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	period = _tmp5_;
#line 332 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp6_ = period;
#line 332 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp6_ == -1) {
#line 333 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = NULL;
#line 333 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (basename) {
#line 333 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			*basename = _vala_basename;
#line 2044 "midori-download.c"
		} else {
#line 333 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (_vala_basename);
#line 2048 "midori-download.c"
		}
#line 333 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 2052 "midori-download.c"
	}
#line 335 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp7_ = uri;
#line 335 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp8_ = period;
#line 335 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp9_ = string_last_index_of_char (_tmp7_, (gunichar) '?', _tmp8_);
#line 335 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	query = _tmp9_;
#line 337 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp10_ = uri;
#line 337 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp11_ = period;
#line 337 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp12_ = query;
#line 337 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp13_ = period;
#line 337 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp14_ = string_substring (_tmp10_, (glong) _tmp11_, (glong) (_tmp12_ - _tmp13_));
#line 337 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	extension = _tmp14_;
#line 338 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp15_ = uri;
#line 338 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp16_ = period;
#line 338 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp17_ = string_substring (_tmp15_, (glong) 0, (glong) _tmp16_);
#line 338 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (_vala_basename);
#line 338 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_vala_basename = _tmp17_;
#line 339 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = extension;
#line 339 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (basename) {
#line 339 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		*basename = _vala_basename;
#line 2090 "midori-download.c"
	} else {
#line 339 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (_vala_basename);
#line 2094 "midori-download.c"
	}
#line 339 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 2098 "midori-download.c"
}


gchar* midori_download_get_unique_filename (const gchar* filename) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gint _tmp1_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
#line 343 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 344 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = filename;
#line 344 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = access (_tmp0_, F_OK);
#line 344 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp1_ == 0) {
#line 2116 "midori-download.c"
		gchar* basename = NULL;
		gchar* extension = NULL;
		const gchar* _tmp2_;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_;
		gchar* new_filename = NULL;
		gint i = 0;
#line 346 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp2_ = filename;
#line 346 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp4_ = midori_download_get_extension_for_uri (_tmp2_, &_tmp3_);
#line 346 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (basename);
#line 346 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		basename = _tmp3_;
#line 346 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		extension = _tmp4_;
#line 347 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		new_filename = NULL;
#line 348 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		i = 0;
#line 2138 "midori-download.c"
		{
			gboolean _tmp5_ = FALSE;
#line 349 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp5_ = TRUE;
#line 349 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			while (TRUE) {
#line 2145 "midori-download.c"
				const gchar* _tmp8_ = NULL;
				const gchar* _tmp9_;
				const gchar* _tmp10_;
				gint _tmp11_;
				gchar* _tmp12_;
#line 349 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (!_tmp5_) {
#line 2153 "midori-download.c"
					const gchar* _tmp6_;
					gint _tmp7_;
#line 351 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp6_ = new_filename;
#line 351 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp7_ = access (_tmp6_, F_OK);
#line 351 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					if (!(_tmp7_ == 0)) {
#line 351 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
						break;
#line 2164 "midori-download.c"
					}
				}
#line 349 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp5_ = FALSE;
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp9_ = extension;
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp8_ = _tmp9_;
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				if (_tmp8_ == NULL) {
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
					_tmp8_ = "";
#line 2177 "midori-download.c"
				}
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp10_ = basename;
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp11_ = i;
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				i = _tmp11_ + 1;
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp12_ = g_strdup_printf ("%s-%d%s", _tmp10_, _tmp11_, _tmp8_);
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (new_filename);
#line 350 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				new_filename = _tmp12_;
#line 2191 "midori-download.c"
			}
		}
#line 352 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = new_filename;
#line 352 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (extension);
#line 352 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (basename);
#line 352 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 2202 "midori-download.c"
	}
#line 354 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp13_ = filename;
#line 354 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp14_ = g_strdup (_tmp13_);
#line 354 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp14_;
#line 354 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 2212 "midori-download.c"
}


/**
         * Returns a string showing a file:// URI's intended filename on
         * disk, suited for displaying to a user.
         * 
         * The string returned is the basename (final path segment) of the
         * filename of the uri. If the uri is invalid, not file://, or has no
         * basename, the uri itself is returned.
         * 
         * Since: 0.5.7
         **/
gchar* midori_download_get_basename_for_display (const gchar* uri) {
	gchar* result = NULL;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	GError * _inner_error_ = NULL;
#line 367 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (uri != NULL, NULL);
#line 2233 "midori-download.c"
	{
		gchar* filename = NULL;
		const gchar* _tmp0_;
		gchar* _tmp1_;
		gboolean _tmp2_ = FALSE;
		const gchar* _tmp3_;
#line 369 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp0_ = uri;
#line 369 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp1_ = g_filename_from_uri (_tmp0_, NULL, &_inner_error_);
#line 369 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		filename = _tmp1_;
#line 369 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2248 "midori-download.c"
			goto __catch17_g_error;
		}
#line 370 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp3_ = filename;
#line 370 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp3_ != NULL) {
#line 2255 "midori-download.c"
			const gchar* _tmp4_;
#line 370 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp4_ = filename;
#line 370 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp2_ = g_strcmp0 (_tmp4_, "") != 0;
#line 2261 "midori-download.c"
		} else {
#line 370 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp2_ = FALSE;
#line 2265 "midori-download.c"
		}
#line 370 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (_tmp2_) {
#line 2269 "midori-download.c"
			const gchar* _tmp5_;
			gchar* _tmp6_;
#line 371 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp5_ = filename;
#line 371 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp6_ = g_path_get_basename (_tmp5_);
#line 371 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			result = _tmp6_;
#line 371 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (filename);
#line 371 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			return result;
#line 2282 "midori-download.c"
		}
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (filename);
#line 2286 "midori-download.c"
	}
	goto __finally17;
	__catch17_g_error:
	{
		GError* _error_ = NULL;
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_error_ = _inner_error_;
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_inner_error_ = NULL;
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_error_free0 (_error_);
#line 2298 "midori-download.c"
	}
	__finally17:
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_clear_error (&_inner_error_);
#line 368 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return NULL;
#line 2309 "midori-download.c"
	}
#line 373 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp7_ = uri;
#line 373 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp8_ = g_strdup (_tmp7_);
#line 373 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = _tmp8_;
#line 373 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 2319 "midori-download.c"
}


gchar* midori_download_prepare_destination_uri (WebKitDownload* download, const gchar* folder) {
	gchar* result = NULL;
	gchar* suggested_filename = NULL;
	WebKitDownload* _tmp0_;
	gchar* _tmp1_;
	gchar* basename = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* download_dir = NULL;
	const gchar* _tmp4_;
	gchar* destination_filename = NULL;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	GError * _inner_error_ = NULL;
#line 376 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, NULL);
#line 377 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = download;
#line 377 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = midori_download_get_suggested_filename (_tmp0_);
#line 377 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	suggested_filename = _tmp1_;
#line 378 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = suggested_filename;
#line 378 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = g_path_get_basename (_tmp2_);
#line 378 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	basename = _tmp3_;
#line 380 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = folder;
#line 380 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp4_ == NULL) {
#line 2356 "midori-download.c"
		const gchar* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
#line 381 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp5_ = midori_paths_get_tmp_dir ();
#line 381 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp6_ = g_strdup (_tmp5_);
#line 381 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (download_dir);
#line 381 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		download_dir = _tmp6_;
#line 382 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp7_ = download_dir;
#line 382 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp8_ = katze_mkdir_with_parents (_tmp7_, 0700);
#line 382 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp9_ = _tmp8_;
#line 382 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (_tmp9_);
#line 2378 "midori-download.c"
	} else {
		const gchar* _tmp10_;
		gchar* _tmp11_;
#line 385 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp10_ = folder;
#line 385 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp11_ = g_strdup (_tmp10_);
#line 385 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (download_dir);
#line 385 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		download_dir = _tmp11_;
#line 2390 "midori-download.c"
	}
#line 386 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp12_ = download_dir;
#line 386 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp13_ = basename;
#line 386 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp14_ = g_build_filename (_tmp12_, _tmp13_, NULL);
#line 386 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	destination_filename = _tmp14_;
#line 2400 "midori-download.c"
	{
		gchar* _tmp15_ = NULL;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp16_ = midori_download_get_unique_filename (destination_filename);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp17_ = _tmp16_;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp18_ = g_filename_to_uri (_tmp17_, NULL, &_inner_error_);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp19_ = _tmp18_;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (_tmp17_);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp15_ = _tmp19_;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2422 "midori-download.c"
			goto __catch18_g_error;
		}
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp20_ = _tmp15_;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp15_ = NULL;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = _tmp20_;
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (_tmp15_);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (destination_filename);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (download_dir);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (basename);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (suggested_filename);
#line 388 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 2443 "midori-download.c"
	}
	goto __finally18;
	__catch18_g_error:
	{
		GError* _error_ = NULL;
		gchar* _tmp21_;
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_error_ = _inner_error_;
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_inner_error_ = NULL;
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp21_ = g_strconcat ("file://", destination_filename, NULL);
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = _tmp21_;
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_error_free0 (_error_);
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (destination_filename);
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (download_dir);
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (basename);
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (suggested_filename);
#line 391 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 2470 "midori-download.c"
	}
	__finally18:
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (destination_filename);
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (download_dir);
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (basename);
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_free0 (suggested_filename);
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_clear_error (&_inner_error_);
#line 387 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return NULL;
#line 2487 "midori-download.c"
}


/**
         * Returns whether it seems possible to save @download to the path specified by
         * @destination_uri, considering space on disk and permissions
         */
gboolean midori_download_has_enough_space (WebKitDownload* download, const gchar* destination_uri, gboolean quiet) {
	gboolean result = FALSE;
	GFile* folder = NULL;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	gboolean can_write = FALSE;
	guint64 free_space = 0ULL;
	gboolean _tmp16_ = FALSE;
	guint64 _tmp17_;
	WebKitDownload* _tmp18_;
	guint64 _tmp19_;
	guint64 _tmp20_;
	GError * _inner_error_ = NULL;
#line 399 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (download != NULL, FALSE);
#line 399 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	g_return_val_if_fail (destination_uri != NULL, FALSE);
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp0_ = destination_uri;
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp1_ = g_file_new_for_uri (_tmp0_);
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp2_ = _tmp1_;
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp3_ = g_file_get_parent (_tmp2_);
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp4_ = _tmp3_;
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_object_unref0 (_tmp2_);
#line 401 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	folder = _tmp4_;
#line 2529 "midori-download.c"
	{
		GFileInfo* info = NULL;
		GFile* _tmp5_;
		GFileInfo* _tmp6_;
		GFileInfo* _tmp7_;
		guint64 _tmp8_;
		GFileInfo* _tmp9_ = NULL;
		GFile* _tmp10_;
		GFileInfo* _tmp11_;
		GFileInfo* _tmp12_;
		GFileInfo* _tmp13_;
		gboolean _tmp14_;
#line 405 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp5_ = folder;
#line 405 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp6_ = g_file_query_filesystem_info (_tmp5_, "filesystem::free", NULL, &_inner_error_);
#line 405 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		info = _tmp6_;
#line 405 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2550 "midori-download.c"
			goto __catch19_g_error;
		}
#line 406 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp7_ = info;
#line 406 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp8_ = g_file_info_get_attribute_uint64 (_tmp7_, "filesystem::free");
#line 406 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		free_space = _tmp8_;
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp10_ = folder;
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp11_ = g_file_query_info (_tmp10_, "access::can-write", 0, NULL, &_inner_error_);
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp9_ = _tmp11_;
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_object_unref0 (info);
#line 2569 "midori-download.c"
			goto __catch19_g_error;
		}
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp12_ = _tmp9_;
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp9_ = NULL;
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (info);
#line 407 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		info = _tmp12_;
#line 408 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp13_ = info;
#line 408 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp14_ = g_file_info_get_attribute_boolean (_tmp13_, "access::can-write");
#line 408 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		can_write = _tmp14_;
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (_tmp9_);
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (info);
#line 2590 "midori-download.c"
	}
	goto __finally19;
	__catch19_g_error:
	{
		GError* _error_ = NULL;
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_error_ = _inner_error_;
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_inner_error_ = NULL;
#line 411 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		can_write = FALSE;
#line 412 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		free_space = (guint64) 0;
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_error_free0 (_error_);
#line 2606 "midori-download.c"
	}
	__finally19:
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2611 "midori-download.c"
		gboolean _tmp15_ = FALSE;
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (folder);
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		g_clear_error (&_inner_error_);
#line 404 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return _tmp15_;
#line 2621 "midori-download.c"
	}
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp17_ = free_space;
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp18_ = download;
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp19_ = webkit_download_get_total_size (_tmp18_);
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_tmp20_ = _tmp19_;
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp17_ < _tmp20_) {
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp16_ = TRUE;
#line 2635 "midori-download.c"
	} else {
		gboolean _tmp21_;
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp21_ = can_write;
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp16_ = !_tmp21_;
#line 2642 "midori-download.c"
	}
#line 415 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	if (_tmp16_) {
#line 2646 "midori-download.c"
		gchar* message = NULL;
		gchar* detailed_message = NULL;
		gboolean _tmp22_;
		gboolean _tmp45_;
#line 418 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp22_ = can_write;
#line 418 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (!_tmp22_) {
#line 2655 "midori-download.c"
			const gchar* _tmp23_;
			gchar* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp23_ = destination_uri;
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp24_ = midori_download_get_basename_for_display (_tmp23_);
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp25_ = _tmp24_;
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp26_ = g_strdup_printf (_ ("The file \"%s\" can't be saved in this folder."), _tmp25_);
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (message);
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			message = _tmp26_;
#line 419 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (_tmp25_);
#line 421 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp27_ = g_strdup (_ ("You don't have permission to write in this location."));
#line 421 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_g_free0 (detailed_message);
#line 421 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			detailed_message = _tmp27_;
#line 2681 "midori-download.c"
		} else {
			guint64 _tmp28_;
			WebKitDownload* _tmp29_;
			guint64 _tmp30_;
			guint64 _tmp31_;
#line 423 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp28_ = free_space;
#line 423 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp29_ = download;
#line 423 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp30_ = webkit_download_get_total_size (_tmp29_);
#line 423 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp31_ = _tmp30_;
#line 423 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			if (_tmp28_ < _tmp31_) {
#line 2697 "midori-download.c"
				const gchar* _tmp32_;
				gchar* _tmp33_;
				gchar* _tmp34_;
				gchar* _tmp35_;
				WebKitDownload* _tmp36_;
				guint64 _tmp37_;
				guint64 _tmp38_;
				gchar* _tmp39_;
				gchar* _tmp40_;
				guint64 _tmp41_;
				gchar* _tmp42_;
				gchar* _tmp43_;
				gchar* _tmp44_;
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp32_ = destination_uri;
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp33_ = midori_download_get_basename_for_display (_tmp32_);
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp34_ = _tmp33_;
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp35_ = g_strdup_printf (_ ("There is not enough free space to download \"%s\"."), _tmp34_);
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (message);
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				message = _tmp35_;
#line 424 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (_tmp34_);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp36_ = download;
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp37_ = webkit_download_get_total_size (_tmp36_);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp38_ = _tmp37_;
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp39_ = g_format_size_full (_tmp38_, G_FORMAT_SIZE_DEFAULT);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp40_ = _tmp39_;
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp41_ = free_space;
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp42_ = g_format_size_full (_tmp41_, G_FORMAT_SIZE_DEFAULT);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp43_ = _tmp42_;
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_tmp44_ = g_strdup_printf (_ ("The file needs %s but only %s are left."), _tmp40_, _tmp43_);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (detailed_message);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				detailed_message = _tmp44_;
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (_tmp43_);
#line 426 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				_g_free0 (_tmp40_);
#line 2751 "midori-download.c"
			} else {
#line 430 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
				g_assert_not_reached ();
#line 2755 "midori-download.c"
			}
		}
#line 431 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_tmp45_ = quiet;
#line 431 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		if (!_tmp45_) {
#line 2762 "midori-download.c"
			const gchar* _tmp46_;
			const gchar* _tmp47_;
#line 432 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp46_ = message;
#line 432 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			_tmp47_ = detailed_message;
#line 432 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
			sokoke_message_dialog (GTK_MESSAGE_ERROR, _tmp46_, _tmp47_, FALSE);
#line 2771 "midori-download.c"
		}
#line 433 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		result = FALSE;
#line 433 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (detailed_message);
#line 433 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_free0 (message);
#line 433 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		_g_object_unref0 (folder);
#line 433 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
		return result;
#line 2783 "midori-download.c"
	}
#line 436 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	result = TRUE;
#line 436 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	_g_object_unref0 (folder);
#line 436 "/usr/src/ports/midori/midori-0.5.11-2.x86_64/src/midori-0.5.11/midori/midori-download.vala"
	return result;
#line 2791 "midori-download.c"
}



