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

/*
 Copyright (C) 2013 Christian Dywan <christian@twotoats.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 <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <sqlite3.h>


#define MIDORI_TYPE_HISTORY_ITEM (midori_history_item_get_type ())
#define MIDORI_HISTORY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItem))
#define MIDORI_HISTORY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItemClass))
#define MIDORI_IS_HISTORY_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_ITEM))
#define MIDORI_IS_HISTORY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_ITEM))
#define MIDORI_HISTORY_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItemClass))

typedef struct _MidoriHistoryItem MidoriHistoryItem;
typedef struct _MidoriHistoryItemClass MidoriHistoryItemClass;
typedef struct _MidoriHistoryItemPrivate MidoriHistoryItemPrivate;

#define MIDORI_TYPE_HISTORY_WEBSITE (midori_history_website_get_type ())
#define MIDORI_HISTORY_WEBSITE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsite))
#define MIDORI_HISTORY_WEBSITE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsiteClass))
#define MIDORI_IS_HISTORY_WEBSITE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_WEBSITE))
#define MIDORI_IS_HISTORY_WEBSITE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_WEBSITE))
#define MIDORI_HISTORY_WEBSITE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsiteClass))

typedef struct _MidoriHistoryWebsite MidoriHistoryWebsite;
typedef struct _MidoriHistoryWebsiteClass MidoriHistoryWebsiteClass;
typedef struct _MidoriHistoryWebsitePrivate MidoriHistoryWebsitePrivate;
enum  {
	MIDORI_HISTORY_WEBSITE_0_PROPERTY,
	MIDORI_HISTORY_WEBSITE_URI_PROPERTY,
	MIDORI_HISTORY_WEBSITE_NUM_PROPERTIES
};
static GParamSpec* midori_history_website_properties[MIDORI_HISTORY_WEBSITE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define MIDORI_TYPE_HISTORY_SEARCH (midori_history_search_get_type ())
#define MIDORI_HISTORY_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearch))
#define MIDORI_HISTORY_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearchClass))
#define MIDORI_IS_HISTORY_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_SEARCH))
#define MIDORI_IS_HISTORY_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_SEARCH))
#define MIDORI_HISTORY_SEARCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearchClass))

typedef struct _MidoriHistorySearch MidoriHistorySearch;
typedef struct _MidoriHistorySearchClass MidoriHistorySearchClass;
typedef struct _MidoriHistorySearchPrivate MidoriHistorySearchPrivate;
enum  {
	MIDORI_HISTORY_SEARCH_0_PROPERTY,
	MIDORI_HISTORY_SEARCH_URI_PROPERTY,
	MIDORI_HISTORY_SEARCH_KEYWORDS_PROPERTY,
	MIDORI_HISTORY_SEARCH_NUM_PROPERTIES
};
static GParamSpec* midori_history_search_properties[MIDORI_HISTORY_SEARCH_NUM_PROPERTIES];
enum  {
	MIDORI_HISTORY_ITEM_0_PROPERTY,
	MIDORI_HISTORY_ITEM_TITLE_PROPERTY,
	MIDORI_HISTORY_ITEM_DATE_PROPERTY,
	MIDORI_HISTORY_ITEM_NUM_PROPERTIES
};
static GParamSpec* midori_history_item_properties[MIDORI_HISTORY_ITEM_NUM_PROPERTIES];

#define MIDORI_TYPE_DATABASE (midori_database_get_type ())
#define MIDORI_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_DATABASE, MidoriDatabase))
#define MIDORI_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_DATABASE, MidoriDatabaseClass))
#define MIDORI_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_DATABASE))
#define MIDORI_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_DATABASE))
#define MIDORI_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_DATABASE, MidoriDatabaseClass))

typedef struct _MidoriDatabase MidoriDatabase;
typedef struct _MidoriDatabaseClass MidoriDatabaseClass;
typedef struct _MidoriDatabasePrivate MidoriDatabasePrivate;

#define MIDORI_TYPE_HISTORY_DATABASE (midori_history_database_get_type ())
#define MIDORI_HISTORY_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_HISTORY_DATABASE, MidoriHistoryDatabase))
#define MIDORI_HISTORY_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_HISTORY_DATABASE, MidoriHistoryDatabaseClass))
#define MIDORI_IS_HISTORY_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_HISTORY_DATABASE))
#define MIDORI_IS_HISTORY_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_HISTORY_DATABASE))
#define MIDORI_HISTORY_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_HISTORY_DATABASE, MidoriHistoryDatabaseClass))

typedef struct _MidoriHistoryDatabase MidoriHistoryDatabase;
typedef struct _MidoriHistoryDatabaseClass MidoriHistoryDatabaseClass;
typedef struct _MidoriHistoryDatabasePrivate MidoriHistoryDatabasePrivate;
enum  {
	MIDORI_HISTORY_DATABASE_0_PROPERTY,
	MIDORI_HISTORY_DATABASE_NUM_PROPERTIES
};
static GParamSpec* midori_history_database_properties[MIDORI_HISTORY_DATABASE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define MIDORI_TYPE_BOOKMARKS_DATABASE (midori_bookmarks_database_get_type ())
#define MIDORI_BOOKMARKS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_BOOKMARKS_DATABASE, MidoriBookmarksDatabase))
#define MIDORI_BOOKMARKS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_BOOKMARKS_DATABASE, MidoriBookmarksDatabaseClass))
#define MIDORI_IS_BOOKMARKS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_BOOKMARKS_DATABASE))
#define MIDORI_IS_BOOKMARKS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_BOOKMARKS_DATABASE))
#define MIDORI_BOOKMARKS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_BOOKMARKS_DATABASE, MidoriBookmarksDatabaseClass))

typedef struct _MidoriBookmarksDatabase MidoriBookmarksDatabase;
typedef struct _MidoriBookmarksDatabaseClass MidoriBookmarksDatabaseClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

#define MIDORI_TYPE_DATABASE_STATEMENT (midori_database_statement_get_type ())
#define MIDORI_DATABASE_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_DATABASE_STATEMENT, MidoriDatabaseStatement))
#define MIDORI_DATABASE_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDORI_TYPE_DATABASE_STATEMENT, MidoriDatabaseStatementClass))
#define MIDORI_IS_DATABASE_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_DATABASE_STATEMENT))
#define MIDORI_IS_DATABASE_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDORI_TYPE_DATABASE_STATEMENT))
#define MIDORI_DATABASE_STATEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDORI_TYPE_DATABASE_STATEMENT, MidoriDatabaseStatementClass))

typedef struct _MidoriDatabaseStatement MidoriDatabaseStatement;
typedef struct _MidoriDatabaseStatementClass MidoriDatabaseStatementClass;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _MidoriHistoryDatabaseQueryData MidoriHistoryDatabaseQueryData;
typedef struct _MidoriHistoryDatabaseListByCountWithBookmarksData MidoriHistoryDatabaseListByCountWithBookmarksData;

struct _MidoriHistoryItem {
	GObject parent_instance;
	MidoriHistoryItemPrivate * priv;
};

struct _MidoriHistoryItemClass {
	GObjectClass parent_class;
};

struct _MidoriHistoryWebsite {
	MidoriHistoryItem parent_instance;
	MidoriHistoryWebsitePrivate * priv;
};

struct _MidoriHistoryWebsiteClass {
	MidoriHistoryItemClass parent_class;
};

struct _MidoriHistoryWebsitePrivate {
	gchar* _uri;
};

struct _MidoriHistorySearch {
	MidoriHistoryItem parent_instance;
	MidoriHistorySearchPrivate * priv;
};

struct _MidoriHistorySearchClass {
	MidoriHistoryItemClass parent_class;
};

struct _MidoriHistorySearchPrivate {
	gchar* _uri;
	gchar* _keywords;
};

struct _MidoriHistoryItemPrivate {
	gchar* _title;
	gint64 _date;
};

typedef enum  {
	MIDORI_DATABASE_ERROR_OPEN,
	MIDORI_DATABASE_ERROR_NAMING,
	MIDORI_DATABASE_ERROR_FILENAME,
	MIDORI_DATABASE_ERROR_EXECUTE,
	MIDORI_DATABASE_ERROR_COMPILE,
	MIDORI_DATABASE_ERROR_TYPE
} MidoriDatabaseError;
#define MIDORI_DATABASE_ERROR midori_database_error_quark ()
struct _MidoriDatabase {
	GObject parent_instance;
	MidoriDatabasePrivate * priv;
	gboolean trace;
	sqlite3* _db;
};

struct _MidoriDatabaseClass {
	GObjectClass parent_class;
	gboolean (*init) (MidoriDatabase* self, GCancellable* cancellable, GError** error);
};

struct _MidoriHistoryDatabase {
	MidoriDatabase parent_instance;
	MidoriHistoryDatabasePrivate * priv;
};

struct _MidoriHistoryDatabaseClass {
	MidoriDatabaseClass parent_class;
};

struct _MidoriHistoryDatabaseQueryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	MidoriHistoryDatabase* self;
	gchar* sqlcmd;
	gchar* filter;
	gint64 day;
	gint64 max_items;
	GCancellable* cancellable;
	GList* result;
	sqlite3* _tmp0_;
	sqlite3* _tmp1_;
	MidoriDatabaseStatement* statement;
	gchar* real_filter;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	MidoriDatabaseStatement* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gint64 _tmp12_;
	MidoriDatabaseStatement* _tmp13_;
	MidoriDatabaseStatement* _tmp14_;
	GError* _error_;
	GError* _tmp15_;
	const gchar* _tmp16_;
	GList* items;
	gboolean _tmp17_;
	MidoriDatabaseStatement* _tmp18_;
	gboolean _tmp19_;
	gint64 type;
	MidoriDatabaseStatement* _tmp20_;
	gint64 _tmp21_;
	gint64 date;
	MidoriDatabaseStatement* _tmp22_;
	gint64 _tmp23_;
	gint64 _tmp24_;
	gchar* uri;
	MidoriDatabaseStatement* _tmp25_;
	gchar* _tmp26_;
	gchar* title;
	MidoriDatabaseStatement* _tmp27_;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	gint64 _tmp31_;
	MidoriHistoryWebsite* _tmp32_;
	gchar* _vala1_uri;
	MidoriDatabaseStatement* _tmp33_;
	gchar* _tmp34_;
	gchar* _vala1_title;
	MidoriDatabaseStatement* _tmp35_;
	gchar* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	gint64 _tmp39_;
	MidoriHistorySearch* _tmp40_;
	guint src;
	guint _tmp41_;
	guint _tmp42_;
	GCancellable* _tmp43_;
	gboolean _tmp44_;
	GError* _vala1__error_;
	GError* _tmp45_;
	const gchar* _tmp46_;
	GCancellable* _tmp47_;
	gboolean _tmp48_;
	GError * _inner_error_;
};

struct _MidoriHistoryDatabaseListByCountWithBookmarksData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	MidoriHistoryDatabase* self;
	gchar* filter;
	gint max_items;
	GCancellable* cancellable;
	GList* result;
	const gchar* sqlcmd;
	const gchar* _tmp0_;
	gint _tmp1_;
	GCancellable* _tmp2_;
	GList* _tmp3_;
};


static gpointer midori_history_website_parent_class = NULL;
static gpointer midori_history_search_parent_class = NULL;
static gpointer midori_history_item_parent_class = NULL;
static gpointer midori_history_database_parent_class = NULL;

GType midori_history_item_get_type (void) G_GNUC_CONST;
GType midori_history_website_get_type (void) G_GNUC_CONST;
#define MIDORI_HISTORY_WEBSITE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsitePrivate))
MidoriHistoryWebsite* midori_history_website_new (const gchar* uri, const gchar* title, gint64 date);
MidoriHistoryWebsite* midori_history_website_construct (GType object_type, const gchar* uri, const gchar* title, gint64 date);
const gchar* midori_history_website_get_uri (MidoriHistoryWebsite* self);
void midori_history_website_set_uri (MidoriHistoryWebsite* self, const gchar* value);
static void midori_history_website_finalize (GObject * obj);
static void _vala_midori_history_website_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_midori_history_website_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType midori_history_search_get_type (void) G_GNUC_CONST;
#define MIDORI_HISTORY_SEARCH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearchPrivate))
MidoriHistorySearch* midori_history_search_new (const gchar* uri, const gchar* keywords, gint64 date);
MidoriHistorySearch* midori_history_search_construct (GType object_type, const gchar* uri, const gchar* keywords, gint64 date);
const gchar* midori_history_search_get_uri (MidoriHistorySearch* self);
void midori_history_search_set_uri (MidoriHistorySearch* self, const gchar* value);
const gchar* midori_history_search_get_keywords (MidoriHistorySearch* self);
void midori_history_search_set_keywords (MidoriHistorySearch* self, const gchar* value);
static void midori_history_search_finalize (GObject * obj);
static void _vala_midori_history_search_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_midori_history_search_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
#define MIDORI_HISTORY_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItemPrivate))
MidoriHistoryItem* midori_history_item_new (void);
MidoriHistoryItem* midori_history_item_construct (GType object_type);
const gchar* midori_history_item_get_title (MidoriHistoryItem* self);
void midori_history_item_set_title (MidoriHistoryItem* self, const gchar* value);
gint64 midori_history_item_get_date (MidoriHistoryItem* self);
void midori_history_item_set_date (MidoriHistoryItem* self, gint64 value);
static void midori_history_item_finalize (GObject * obj);
static void _vala_midori_history_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_midori_history_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType midori_database_get_type (void) G_GNUC_CONST;
GQuark midori_database_error_quark (void);
GType midori_history_database_get_type (void) G_GNUC_CONST;
MidoriHistoryDatabase* midori_history_database_new (GObject* app, GError** error);
MidoriHistoryDatabase* midori_history_database_construct (GType object_type, GObject* app, GError** error);
gboolean midori_database_init (MidoriDatabase* self, GCancellable* cancellable, GError** error);
GType midori_bookmarks_database_get_type (void) G_GNUC_CONST;
MidoriBookmarksDatabase* midori_bookmarks_database_new (GError** error);
MidoriBookmarksDatabase* midori_bookmarks_database_construct (GType object_type, GError** error);
gboolean midori_database_attach (MidoriDatabase* self, const gchar* path, const gchar* alias, GError** error);
const gchar* midori_database_get_path (MidoriDatabase* self);
gboolean midori_database_exec (MidoriDatabase* self, const gchar* query, GError** error);
gboolean midori_database_exec_script (MidoriDatabase* self, const gchar* filename, GError** error);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void midori_history_database_query_data_free (gpointer _data);
static void midori_history_database_query_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
void midori_history_database_query (MidoriHistoryDatabase* self, const gchar* sqlcmd, const gchar* filter, gint64 day, gint64 max_items, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
GList* midori_history_database_query_finish (MidoriHistoryDatabase* self, GAsyncResult* _res_);
static gboolean midori_history_database_query_co (MidoriHistoryDatabaseQueryData* _data_);
sqlite3* midori_database_get_db (MidoriDatabase* self);
GType midori_database_statement_get_type (void) G_GNUC_CONST;
MidoriDatabaseStatement* midori_database_prepare (MidoriDatabase* self, const gchar* query, GError** error, ...);
gboolean midori_database_statement_step (MidoriDatabaseStatement* self, GError** error);
gint64 midori_database_statement_get_int64 (MidoriDatabaseStatement* self, const gchar* name, GError** error);
gchar* midori_database_statement_get_string (MidoriDatabaseStatement* self, const gchar* name, GError** error);
static gboolean _midori_history_database_query_co_gsource_func (gpointer self);
static void midori_history_database_list_by_count_with_bookmarks_data_free (gpointer _data);
static void midori_history_database_list_by_count_with_bookmarks_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data);
void midori_history_database_list_by_count_with_bookmarks (MidoriHistoryDatabase* self, const gchar* filter, gint max_items, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
GList* midori_history_database_list_by_count_with_bookmarks_finish (MidoriHistoryDatabase* self, GAsyncResult* _res_);
static gboolean midori_history_database_list_by_count_with_bookmarks_co (MidoriHistoryDatabaseListByCountWithBookmarksData* _data_);
static void midori_history_database_list_by_count_with_bookmarks_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
gboolean midori_history_database_insert (MidoriHistoryDatabase* self, const gchar* uri, const gchar* title, gint64 date, gint64 day, GError** error);
gboolean midori_database_statement_exec (MidoriDatabaseStatement* self, GError** error);
gboolean midori_history_database_clear (MidoriHistoryDatabase* self, gint64 maximum_age, GError** error);


MidoriHistoryWebsite* midori_history_website_construct (GType object_type, const gchar* uri, const gchar* title, gint64 date) {
	MidoriHistoryWebsite * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint64 _tmp2_;
#line 15 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (uri != NULL, NULL);
#line 16 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = uri;
#line 16 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = title;
#line 16 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = date;
#line 16 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = (MidoriHistoryWebsite*) g_object_new (object_type, "uri", _tmp0_, "title", _tmp1_, "date", _tmp2_, NULL);
#line 15 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return self;
#line 392 "midori-historydatabase.c"
}


MidoriHistoryWebsite* midori_history_website_new (const gchar* uri, const gchar* title, gint64 date) {
#line 15 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return midori_history_website_construct (MIDORI_TYPE_HISTORY_WEBSITE, uri, title, date);
#line 399 "midori-historydatabase.c"
}


const gchar* midori_history_website_get_uri (MidoriHistoryWebsite* self) {
	const gchar* result;
	const gchar* _tmp0_;
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = self->priv->_uri;
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp0_;
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 414 "midori-historydatabase.c"
}


void midori_history_website_set_uri (MidoriHistoryWebsite* self, const gchar* value) {
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_if_fail (self != NULL);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (g_strcmp0 (value, midori_history_website_get_uri (self)) != 0) {
#line 423 "midori-historydatabase.c"
		const gchar* _tmp0_;
		gchar* _tmp1_;
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp0_ = value;
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp1_ = g_strdup (_tmp0_);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (self->priv->_uri);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		self->priv->_uri = _tmp1_;
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_notify_by_pspec ((GObject *) self, midori_history_website_properties[MIDORI_HISTORY_WEBSITE_URI_PROPERTY]);
#line 436 "midori-historydatabase.c"
	}
}


static void midori_history_website_class_init (MidoriHistoryWebsiteClass * klass) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_website_parent_class = g_type_class_peek_parent (klass);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_type_class_add_private (klass, sizeof (MidoriHistoryWebsitePrivate));
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_midori_history_website_get_property;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_midori_history_website_set_property;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->finalize = midori_history_website_finalize;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MIDORI_HISTORY_WEBSITE_URI_PROPERTY, midori_history_website_properties[MIDORI_HISTORY_WEBSITE_URI_PROPERTY] = g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 454 "midori-historydatabase.c"
}


static void midori_history_website_instance_init (MidoriHistoryWebsite * self) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self->priv = MIDORI_HISTORY_WEBSITE_GET_PRIVATE (self);
#line 461 "midori-historydatabase.c"
}


static void midori_history_website_finalize (GObject * obj) {
	MidoriHistoryWebsite * self;
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsite);
#line 14 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (self->priv->_uri);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (midori_history_website_parent_class)->finalize (obj);
#line 473 "midori-historydatabase.c"
}


GType midori_history_website_get_type (void) {
	static volatile gsize midori_history_website_type_id__volatile = 0;
	if (g_once_init_enter (&midori_history_website_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriHistoryWebsiteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_history_website_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriHistoryWebsite), 0, (GInstanceInitFunc) midori_history_website_instance_init, NULL };
		GType midori_history_website_type_id;
		midori_history_website_type_id = g_type_register_static (MIDORI_TYPE_HISTORY_ITEM, "MidoriHistoryWebsite", &g_define_type_info, 0);
		g_once_init_leave (&midori_history_website_type_id__volatile, midori_history_website_type_id);
	}
	return midori_history_website_type_id__volatile;
}


static void _vala_midori_history_website_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	MidoriHistoryWebsite * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsite);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (property_id) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_WEBSITE_URI_PROPERTY:
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_value_set_string (value, midori_history_website_get_uri (self));
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 500 "midori-historydatabase.c"
		default:
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 506 "midori-historydatabase.c"
	}
}


static void _vala_midori_history_website_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	MidoriHistoryWebsite * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MIDORI_TYPE_HISTORY_WEBSITE, MidoriHistoryWebsite);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (property_id) {
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_WEBSITE_URI_PROPERTY:
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_history_website_set_uri (self, g_value_get_string (value));
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 522 "midori-historydatabase.c"
		default:
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 13 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 528 "midori-historydatabase.c"
	}
}


MidoriHistorySearch* midori_history_search_construct (GType object_type, const gchar* uri, const gchar* keywords, gint64 date) {
	MidoriHistorySearch * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gint64 _tmp5_;
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (uri != NULL, NULL);
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (keywords != NULL, NULL);
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = uri;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = keywords;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = keywords;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp3_ = g_strdup_printf (_ ("Search for %s"), _tmp2_);
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp4_ = _tmp3_;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp5_ = date;
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = (MidoriHistorySearch*) g_object_new (object_type, "uri", _tmp0_, "keywords", _tmp1_, "title", _tmp4_, "date", _tmp5_, NULL);
#line 26 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_tmp4_);
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return self;
#line 563 "midori-historydatabase.c"
}


MidoriHistorySearch* midori_history_search_new (const gchar* uri, const gchar* keywords, gint64 date) {
#line 25 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return midori_history_search_construct (MIDORI_TYPE_HISTORY_SEARCH, uri, keywords, date);
#line 570 "midori-historydatabase.c"
}


const gchar* midori_history_search_get_uri (MidoriHistorySearch* self) {
	const gchar* result;
	const gchar* _tmp0_;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = self->priv->_uri;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp0_;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 585 "midori-historydatabase.c"
}


void midori_history_search_set_uri (MidoriHistorySearch* self, const gchar* value) {
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_if_fail (self != NULL);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (g_strcmp0 (value, midori_history_search_get_uri (self)) != 0) {
#line 594 "midori-historydatabase.c"
		const gchar* _tmp0_;
		gchar* _tmp1_;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp0_ = value;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp1_ = g_strdup (_tmp0_);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (self->priv->_uri);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		self->priv->_uri = _tmp1_;
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_notify_by_pspec ((GObject *) self, midori_history_search_properties[MIDORI_HISTORY_SEARCH_URI_PROPERTY]);
#line 607 "midori-historydatabase.c"
	}
}


const gchar* midori_history_search_get_keywords (MidoriHistorySearch* self) {
	const gchar* result;
	const gchar* _tmp0_;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = self->priv->_keywords;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp0_;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 623 "midori-historydatabase.c"
}


void midori_history_search_set_keywords (MidoriHistorySearch* self, const gchar* value) {
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_if_fail (self != NULL);
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (g_strcmp0 (value, midori_history_search_get_keywords (self)) != 0) {
#line 632 "midori-historydatabase.c"
		const gchar* _tmp0_;
		gchar* _tmp1_;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp0_ = value;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp1_ = g_strdup (_tmp0_);
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (self->priv->_keywords);
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		self->priv->_keywords = _tmp1_;
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_notify_by_pspec ((GObject *) self, midori_history_search_properties[MIDORI_HISTORY_SEARCH_KEYWORDS_PROPERTY]);
#line 645 "midori-historydatabase.c"
	}
}


static void midori_history_search_class_init (MidoriHistorySearchClass * klass) {
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_search_parent_class = g_type_class_peek_parent (klass);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_type_class_add_private (klass, sizeof (MidoriHistorySearchPrivate));
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_midori_history_search_get_property;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_midori_history_search_set_property;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->finalize = midori_history_search_finalize;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MIDORI_HISTORY_SEARCH_URI_PROPERTY, midori_history_search_properties[MIDORI_HISTORY_SEARCH_URI_PROPERTY] = g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MIDORI_HISTORY_SEARCH_KEYWORDS_PROPERTY, midori_history_search_properties[MIDORI_HISTORY_SEARCH_KEYWORDS_PROPERTY] = g_param_spec_string ("keywords", "keywords", "keywords", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 665 "midori-historydatabase.c"
}


static void midori_history_search_instance_init (MidoriHistorySearch * self) {
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self->priv = MIDORI_HISTORY_SEARCH_GET_PRIVATE (self);
#line 672 "midori-historydatabase.c"
}


static void midori_history_search_finalize (GObject * obj) {
	MidoriHistorySearch * self;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearch);
#line 23 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (self->priv->_uri);
#line 24 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (self->priv->_keywords);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (midori_history_search_parent_class)->finalize (obj);
#line 686 "midori-historydatabase.c"
}


GType midori_history_search_get_type (void) {
	static volatile gsize midori_history_search_type_id__volatile = 0;
	if (g_once_init_enter (&midori_history_search_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriHistorySearchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_history_search_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriHistorySearch), 0, (GInstanceInitFunc) midori_history_search_instance_init, NULL };
		GType midori_history_search_type_id;
		midori_history_search_type_id = g_type_register_static (MIDORI_TYPE_HISTORY_ITEM, "MidoriHistorySearch", &g_define_type_info, 0);
		g_once_init_leave (&midori_history_search_type_id__volatile, midori_history_search_type_id);
	}
	return midori_history_search_type_id__volatile;
}


static void _vala_midori_history_search_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	MidoriHistorySearch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearch);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (property_id) {
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_SEARCH_URI_PROPERTY:
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_value_set_string (value, midori_history_search_get_uri (self));
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_SEARCH_KEYWORDS_PROPERTY:
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_value_set_string (value, midori_history_search_get_keywords (self));
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 719 "midori-historydatabase.c"
		default:
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 725 "midori-historydatabase.c"
	}
}


static void _vala_midori_history_search_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	MidoriHistorySearch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MIDORI_TYPE_HISTORY_SEARCH, MidoriHistorySearch);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (property_id) {
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_SEARCH_URI_PROPERTY:
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_history_search_set_uri (self, g_value_get_string (value));
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_SEARCH_KEYWORDS_PROPERTY:
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_history_search_set_keywords (self, g_value_get_string (value));
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 747 "midori-historydatabase.c"
		default:
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 22 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 753 "midori-historydatabase.c"
	}
}


MidoriHistoryItem* midori_history_item_construct (GType object_type) {
	MidoriHistoryItem * self = NULL;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = (MidoriHistoryItem*) g_object_new (object_type, NULL);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return self;
#line 764 "midori-historydatabase.c"
}


MidoriHistoryItem* midori_history_item_new (void) {
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return midori_history_item_construct (MIDORI_TYPE_HISTORY_ITEM);
#line 771 "midori-historydatabase.c"
}


const gchar* midori_history_item_get_title (MidoriHistoryItem* self) {
	const gchar* result;
	const gchar* _tmp0_;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = self->priv->_title;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp0_;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 786 "midori-historydatabase.c"
}


void midori_history_item_set_title (MidoriHistoryItem* self, const gchar* value) {
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_if_fail (self != NULL);
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (g_strcmp0 (value, midori_history_item_get_title (self)) != 0) {
#line 795 "midori-historydatabase.c"
		const gchar* _tmp0_;
		gchar* _tmp1_;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp0_ = value;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp1_ = g_strdup (_tmp0_);
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (self->priv->_title);
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		self->priv->_title = _tmp1_;
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_notify_by_pspec ((GObject *) self, midori_history_item_properties[MIDORI_HISTORY_ITEM_TITLE_PROPERTY]);
#line 808 "midori-historydatabase.c"
	}
}


gint64 midori_history_item_get_date (MidoriHistoryItem* self) {
	gint64 result;
	gint64 _tmp0_;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, 0LL);
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = self->priv->_date;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp0_;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 824 "midori-historydatabase.c"
}


void midori_history_item_set_date (MidoriHistoryItem* self, gint64 value) {
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_if_fail (self != NULL);
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (midori_history_item_get_date (self) != value) {
#line 833 "midori-historydatabase.c"
		gint64 _tmp0_;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_tmp0_ = value;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		self->priv->_date = _tmp0_;
#line 35 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_notify_by_pspec ((GObject *) self, midori_history_item_properties[MIDORI_HISTORY_ITEM_DATE_PROPERTY]);
#line 841 "midori-historydatabase.c"
	}
}


static void midori_history_item_class_init (MidoriHistoryItemClass * klass) {
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_item_parent_class = g_type_class_peek_parent (klass);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_type_class_add_private (klass, sizeof (MidoriHistoryItemPrivate));
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_midori_history_item_get_property;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_midori_history_item_set_property;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (klass)->finalize = midori_history_item_finalize;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MIDORI_HISTORY_ITEM_TITLE_PROPERTY, midori_history_item_properties[MIDORI_HISTORY_ITEM_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), MIDORI_HISTORY_ITEM_DATE_PROPERTY, midori_history_item_properties[MIDORI_HISTORY_ITEM_DATE_PROPERTY] = g_param_spec_int64 ("date", "date", "date", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 861 "midori-historydatabase.c"
}


static void midori_history_item_instance_init (MidoriHistoryItem * self) {
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self->priv = MIDORI_HISTORY_ITEM_GET_PRIVATE (self);
#line 868 "midori-historydatabase.c"
}


static void midori_history_item_finalize (GObject * obj) {
	MidoriHistoryItem * self;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItem);
#line 34 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (self->priv->_title);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	G_OBJECT_CLASS (midori_history_item_parent_class)->finalize (obj);
#line 880 "midori-historydatabase.c"
}


GType midori_history_item_get_type (void) {
	static volatile gsize midori_history_item_type_id__volatile = 0;
	if (g_once_init_enter (&midori_history_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriHistoryItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_history_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriHistoryItem), 0, (GInstanceInitFunc) midori_history_item_instance_init, NULL };
		GType midori_history_item_type_id;
		midori_history_item_type_id = g_type_register_static (G_TYPE_OBJECT, "MidoriHistoryItem", &g_define_type_info, 0);
		g_once_init_leave (&midori_history_item_type_id__volatile, midori_history_item_type_id);
	}
	return midori_history_item_type_id__volatile;
}


static void _vala_midori_history_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	MidoriHistoryItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItem);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (property_id) {
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_ITEM_TITLE_PROPERTY:
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_value_set_string (value, midori_history_item_get_title (self));
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_ITEM_DATE_PROPERTY:
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_value_set_int64 (value, midori_history_item_get_date (self));
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 913 "midori-historydatabase.c"
		default:
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 919 "midori-historydatabase.c"
	}
}


static void _vala_midori_history_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	MidoriHistoryItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MIDORI_TYPE_HISTORY_ITEM, MidoriHistoryItem);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (property_id) {
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_ITEM_TITLE_PROPERTY:
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_history_item_set_title (self, g_value_get_string (value));
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case MIDORI_HISTORY_ITEM_DATE_PROPERTY:
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_history_item_set_date (self, g_value_get_int64 (value));
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 941 "midori-historydatabase.c"
		default:
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 33 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		break;
#line 947 "midori-historydatabase.c"
	}
}


MidoriHistoryDatabase* midori_history_database_construct (GType object_type, GObject* app, GError** error) {
	MidoriHistoryDatabase * self = NULL;
	MidoriBookmarksDatabase* bookmarks_database = NULL;
	MidoriBookmarksDatabase* _tmp0_;
	MidoriBookmarksDatabase* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GError * _inner_error_ = NULL;
#line 40 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	self = (MidoriHistoryDatabase*) g_object_new (object_type, "path", "history.db", NULL);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_database_init ((MidoriDatabase*) self, NULL, &_inner_error_);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (self);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 974 "midori-historydatabase.c"
		} else {
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 41 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 982 "midori-historydatabase.c"
		}
	}
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = midori_bookmarks_database_new (&_inner_error_);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	bookmarks_database = _tmp0_;
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (self);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 999 "midori-historydatabase.c"
		} else {
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 42 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 1007 "midori-historydatabase.c"
		}
	}
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = bookmarks_database;
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = midori_database_get_path ((MidoriDatabase*) _tmp1_);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp3_ = _tmp2_;
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_database_attach ((MidoriDatabase*) self, _tmp3_, "bookmarks", &_inner_error_);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (bookmarks_database);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (self);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 1030 "midori-historydatabase.c"
		} else {
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (bookmarks_database);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 43 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 1040 "midori-historydatabase.c"
		}
	}
	{
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_database_exec ((MidoriDatabase*) self, "SELECT day FROM history LIMIT 1", &_inner_error_);
#line 46 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1048 "midori-historydatabase.c"
			goto __catch21_g_error;
		}
	}
	goto __finally21;
	__catch21_g_error:
	{
		GError* _error_ = NULL;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_error_ = _inner_error_;
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_inner_error_ = NULL;
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		midori_database_exec_script ((MidoriDatabase*) self, "Day", &_inner_error_);
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 48 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_error_free0 (_error_);
#line 1066 "midori-historydatabase.c"
			goto __finally21;
		}
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_error_free0 (_error_);
#line 1071 "midori-historydatabase.c"
	}
	__finally21:
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (bookmarks_database);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (self);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 1086 "midori-historydatabase.c"
		} else {
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (bookmarks_database);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 45 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return NULL;
#line 1096 "midori-historydatabase.c"
		}
	}
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (bookmarks_database);
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return self;
#line 1103 "midori-historydatabase.c"
}


MidoriHistoryDatabase* midori_history_database_new (GObject* app, GError** error) {
#line 39 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return midori_history_database_construct (MIDORI_TYPE_HISTORY_DATABASE, app, error);
#line 1110 "midori-historydatabase.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 1117 "midori-historydatabase.c"
}


static inline void _g_list_free__g_object_unref0_ (GList* self) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 1124 "midori-historydatabase.c"
}


static void midori_history_database_query_data_free (gpointer _data) {
	MidoriHistoryDatabaseQueryData* _data_;
	_data_ = _data;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_data_->sqlcmd);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_data_->filter);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->cancellable);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	__g_list_free__g_object_unref0_0 (_data_->result);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->self);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_slice_free (MidoriHistoryDatabaseQueryData, _data_);
#line 1143 "midori-historydatabase.c"
}


static void midori_history_database_query_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	MidoriHistoryDatabaseQueryData* _task_data_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_task_data_->_callback_ != NULL) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1155 "midori-historydatabase.c"
	}
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1159 "midori-historydatabase.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return self ? g_object_ref (self) : NULL;
#line 1166 "midori-historydatabase.c"
}


void midori_history_database_query (MidoriHistoryDatabase* self, const gchar* sqlcmd, const gchar* filter, gint64 day, gint64 max_items, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MidoriHistoryDatabaseQueryData* _data_;
	MidoriHistoryDatabase* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	GCancellable* _tmp7_;
	GCancellable* _tmp8_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_ = g_slice_new0 (MidoriHistoryDatabaseQueryData);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_callback_ = _callback_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, midori_history_database_query_async_ready_wrapper, _user_data_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_callback_ == NULL) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_task_complete_ = TRUE;
#line 1191 "midori-historydatabase.c"
	}
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_task_set_task_data (_data_->_async_result, _data_, midori_history_database_query_data_free);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->self = _tmp0_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = sqlcmd;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_data_->sqlcmd);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->sqlcmd = _tmp2_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp3_ = filter;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_data_->filter);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->filter = _tmp4_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp5_ = day;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->day = _tmp5_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp6_ = max_items;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->max_items = _tmp6_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp7_ = cancellable;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp8_ = _g_object_ref0 (_tmp7_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->cancellable);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->cancellable = _tmp8_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_database_query_co (_data_);
#line 1233 "midori-historydatabase.c"
}


GList* midori_history_database_query_finish (MidoriHistoryDatabase* self, GAsyncResult* _res_) {
	GList* result;
	MidoriHistoryDatabaseQueryData* _data_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (NULL == _data_) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		return NULL;
#line 1246 "midori-historydatabase.c"
	}
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _data_->result;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->result = NULL;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 1254 "midori-historydatabase.c"
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1415 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1415 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1415 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if ((*((gchar*) self)) == '\0') {
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 1273 "midori-historydatabase.c"
	} else {
		const gchar* _tmp2_;
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp2_ = old;
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp1_ = (*((gchar*) _tmp2_)) == '\0';
#line 1280 "midori-historydatabase.c"
	}
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp1_) {
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp0_ = TRUE;
#line 1286 "midori-historydatabase.c"
	} else {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp3_ = old;
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = replacement;
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp0_ = g_strcmp0 (_tmp3_, _tmp4_) == 0;
#line 1296 "midori-historydatabase.c"
	}
#line 1416 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 1300 "midori-historydatabase.c"
		gchar* _tmp5_;
#line 1417 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp5_ = g_strdup (self);
#line 1417 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = _tmp5_;
#line 1417 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1308 "midori-historydatabase.c"
	}
	{
		GRegex* regex = NULL;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GRegex* _tmp9_;
		GRegex* _tmp10_;
		gchar* _tmp11_ = NULL;
		GRegex* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp6_ = old;
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp7_ = g_regex_escape_string (_tmp6_, -1);
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp7_;
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp9_ = g_regex_new (_tmp8_, 0, 0, &_inner_error_);
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp10_ = _tmp9_;
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_free0 (_tmp8_);
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		regex = _tmp10_;
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 1340 "midori-historydatabase.c"
				goto __catch23_g_regex_error;
			}
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1420 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			return NULL;
#line 1349 "midori-historydatabase.c"
		}
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp12_ = regex;
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp13_ = replacement;
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp14_ = g_regex_replace_literal (_tmp12_, self, (gssize) -1, 0, _tmp13_, 0, &_inner_error_);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp11_ = _tmp14_;
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 1365 "midori-historydatabase.c"
				goto __catch23_g_regex_error;
			}
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
			return NULL;
#line 1376 "midori-historydatabase.c"
		}
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp15_ = _tmp11_;
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp11_ = NULL;
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		result = _tmp15_;
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_free0 (_tmp11_);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1421 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 1390 "midori-historydatabase.c"
	}
	goto __finally23;
	__catch23_g_regex_error:
	{
		GError* e = NULL;
#line 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1423 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 1404 "midori-historydatabase.c"
	}
	__finally23:
#line 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		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 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1419 "/usr/share/vala-0.38/vapi/glib-2.0.vapi"
		return NULL;
#line 1415 "midori-historydatabase.c"
	}
}


static gboolean _midori_history_database_query_co_gsource_func (gpointer self) {
	gboolean result;
	result = midori_history_database_query_co (self);
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 1425 "midori-historydatabase.c"
}


static gboolean midori_history_database_query_co (MidoriHistoryDatabaseQueryData* _data_) {
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (_data_->_state_) {
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case 0:
#line 1434 "midori-historydatabase.c"
		goto _state_0;
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case 1:
#line 1438 "midori-historydatabase.c"
		goto _state_1;
		default:
#line 52 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_assert_not_reached ();
#line 1443 "midori-historydatabase.c"
	}
	_state_0:
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp0_ = midori_database_get_db ((MidoriDatabase*) _data_->self);
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp1_ = _data_->_tmp0_;
#line 53 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (_data_->_tmp1_ != NULL, NULL);
#line 1452 "midori-historydatabase.c"
	{
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp2_ = _data_->filter;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp3_ = string_replace (_data_->_tmp2_, " ", "%");
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp4_ = _data_->_tmp3_;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp5_ = g_strconcat ("%", _data_->_tmp4_, NULL);
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp6_ = _data_->_tmp5_;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp7_ = g_strconcat (_data_->_tmp6_, "%", NULL);
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp8_ = _data_->_tmp7_;
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (_data_->_tmp6_);
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (_data_->_tmp4_);
#line 58 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->real_filter = _data_->_tmp8_;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp10_ = _data_->sqlcmd;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp11_ = _data_->real_filter;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp12_ = _data_->max_items;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp13_ = midori_database_prepare ((MidoriDatabase*) _data_->self, _data_->_tmp10_, &_data_->_inner_error_, ":filter", G_TYPE_STRING, _data_->_tmp11_, ":limit", G_TYPE_INT64, _data_->_tmp12_, NULL);
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp9_ = _data_->_tmp13_;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_free0 (_data_->real_filter);
#line 1488 "midori-historydatabase.c"
			goto __catch22_g_error;
		}
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp14_ = _data_->_tmp9_;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp9_ = NULL;
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_object_unref0 (_data_->statement);
#line 59 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->statement = _data_->_tmp14_;
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_object_unref0 (_data_->_tmp9_);
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_free0 (_data_->real_filter);
#line 1503 "midori-historydatabase.c"
	}
	goto __finally22;
	__catch22_g_error:
	{
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_inner_error_ = NULL;
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp15_ = _data_->_error_;
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp16_ = _data_->_tmp15_->message;
#line 63 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_critical (_ ("Failed to select from history: %s"), _data_->_tmp16_);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->result = NULL;
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_error_free0 (_data_->_error_);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_object_unref0 (_data_->statement);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_data_->_state_ != 0) {
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1532 "midori-historydatabase.c"
			}
		}
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_unref (_data_->_async_result);
#line 64 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		return FALSE;
#line 1539 "midori-historydatabase.c"
	}
	__finally22:
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_object_unref0 (_data_->statement);
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_clear_error (&_data_->_inner_error_);
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_unref (_data_->_async_result);
#line 57 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		return FALSE;
#line 1554 "midori-historydatabase.c"
	}
#line 67 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->items = NULL;
#line 1558 "midori-historydatabase.c"
	{
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		while (TRUE) {
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp18_ = _data_->statement;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp19_ = midori_database_statement_step (_data_->_tmp18_, &_data_->_inner_error_);
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp17_ = _data_->_tmp19_;
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1570 "midori-historydatabase.c"
				goto __catch24_g_error;
			}
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			if (!_data_->_tmp17_) {
#line 69 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				break;
#line 1577 "midori-historydatabase.c"
			}
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp20_ = _data_->statement;
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp21_ = midori_database_statement_get_int64 (_data_->_tmp20_, "type", &_data_->_inner_error_);
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->type = _data_->_tmp21_;
#line 70 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1587 "midori-historydatabase.c"
				goto __catch24_g_error;
			}
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp22_ = _data_->statement;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp23_ = midori_database_statement_get_int64 (_data_->_tmp22_, "date", &_data_->_inner_error_);
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->date = _data_->_tmp23_;
#line 71 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1598 "midori-historydatabase.c"
				goto __catch24_g_error;
			}
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp24_ = _data_->type;
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			switch (_data_->_tmp24_) {
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				case 1:
#line 1607 "midori-historydatabase.c"
				{
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp25_ = _data_->statement;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp26_ = midori_database_statement_get_string (_data_->_tmp25_, "uri", &_data_->_inner_error_);
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->uri = _data_->_tmp26_;
#line 74 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1617 "midori-historydatabase.c"
						goto __catch24_g_error;
					}
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp27_ = _data_->statement;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp28_ = midori_database_statement_get_string (_data_->_tmp27_, "title", &_data_->_inner_error_);
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->title = _data_->_tmp28_;
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 75 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
						_g_free0 (_data_->uri);
#line 1630 "midori-historydatabase.c"
						goto __catch24_g_error;
					}
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp29_ = _data_->uri;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp30_ = _data_->title;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp31_ = _data_->date;
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp32_ = midori_history_website_new (_data_->_tmp29_, _data_->_tmp30_, _data_->_tmp31_);
#line 76 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->items = g_list_append (_data_->items, (MidoriHistoryItem*) _data_->_tmp32_);
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_g_free0 (_data_->title);
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_g_free0 (_data_->uri);
#line 77 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					break;
#line 1649 "midori-historydatabase.c"
				}
#line 72 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				case 2:
#line 1653 "midori-historydatabase.c"
				{
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp33_ = _data_->statement;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp34_ = midori_database_statement_get_string (_data_->_tmp33_, "uri", &_data_->_inner_error_);
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_vala1_uri = _data_->_tmp34_;
#line 79 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1663 "midori-historydatabase.c"
						goto __catch24_g_error;
					}
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp35_ = _data_->statement;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp36_ = midori_database_statement_get_string (_data_->_tmp35_, "title", &_data_->_inner_error_);
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_vala1_title = _data_->_tmp36_;
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 80 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
						_g_free0 (_data_->_vala1_uri);
#line 1676 "midori-historydatabase.c"
						goto __catch24_g_error;
					}
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp37_ = _data_->_vala1_uri;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp38_ = _data_->_vala1_title;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp39_ = _data_->date;
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->_tmp40_ = midori_history_search_new (_data_->_tmp37_, _data_->_tmp38_, _data_->_tmp39_);
#line 81 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_data_->items = g_list_append (_data_->items, (MidoriHistoryItem*) _data_->_tmp40_);
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_g_free0 (_data_->_vala1_title);
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					_g_free0 (_data_->_vala1_uri);
#line 82 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					break;
#line 1695 "midori-historydatabase.c"
				}
				default:
				{
#line 84 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					g_warn_if_reached ();
#line 85 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					break;
#line 1703 "midori-historydatabase.c"
				}
			}
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp41_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _midori_history_database_query_co_gsource_func, _data_, NULL);
#line 88 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->src = _data_->_tmp41_;
#line 89 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_state_ = 1;
#line 89 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return FALSE;
#line 1714 "midori-historydatabase.c"
			_state_1:
			;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp42_ = _data_->src;
#line 90 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_source_remove (_data_->_tmp42_);
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp43_ = _data_->cancellable;
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_data_->_tmp44_ = g_cancellable_is_cancelled (_data_->_tmp43_);
#line 92 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			if (_data_->_tmp44_) {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				_data_->result = NULL;
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				__g_list_free__g_object_unref0_0 (_data_->items);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				_g_object_unref0 (_data_->statement);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				if (_data_->_state_ != 0) {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
					while (_data_->_task_complete_ != TRUE) {
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1741 "midori-historydatabase.c"
					}
				}
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				g_object_unref (_data_->_async_result);
#line 93 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				return FALSE;
#line 1748 "midori-historydatabase.c"
			}
		}
	}
	goto __finally24;
	__catch24_g_error:
	{
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_vala1__error_ = _data_->_inner_error_;
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_inner_error_ = NULL;
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp45_ = _data_->_vala1__error_;
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_tmp46_ = _data_->_tmp45_->message;
#line 96 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_critical (_ ("Failed to select from history: %s"), _data_->_tmp46_);
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_error_free0 (_data_->_vala1__error_);
#line 1767 "midori-historydatabase.c"
	}
	__finally24:
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		__g_list_free__g_object_unref0_0 (_data_->items);
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_object_unref0 (_data_->statement);
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_clear_error (&_data_->_inner_error_);
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_unref (_data_->_async_result);
#line 68 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		return FALSE;
#line 1784 "midori-historydatabase.c"
	}
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp47_ = _data_->cancellable;
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp48_ = g_cancellable_is_cancelled (_data_->_tmp47_);
#line 99 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_data_->_tmp48_) {
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->result = NULL;
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		__g_list_free__g_object_unref0_0 (_data_->items);
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_g_object_unref0 (_data_->statement);
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_data_->_state_ != 0) {
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1806 "midori-historydatabase.c"
			}
		}
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_object_unref (_data_->_async_result);
#line 100 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		return FALSE;
#line 1813 "midori-historydatabase.c"
	}
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->result = _data_->items;
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->statement);
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_data_->_state_ != 0) {
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1827 "midori-historydatabase.c"
		}
	}
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_unref (_data_->_async_result);
#line 101 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return FALSE;
#line 1834 "midori-historydatabase.c"
}


static void midori_history_database_list_by_count_with_bookmarks_data_free (gpointer _data) {
	MidoriHistoryDatabaseListByCountWithBookmarksData* _data_;
	_data_ = _data;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_data_->filter);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->cancellable);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	__g_list_free__g_object_unref0_0 (_data_->result);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->self);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_slice_free (MidoriHistoryDatabaseListByCountWithBookmarksData, _data_);
#line 1851 "midori-historydatabase.c"
}


static void midori_history_database_list_by_count_with_bookmarks_async_ready_wrapper (GObject *source_object, GAsyncResult *res, void *user_data) {
	MidoriHistoryDatabaseListByCountWithBookmarksData* _task_data_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_task_data_->_callback_ != NULL) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1863 "midori-historydatabase.c"
	}
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1867 "midori-historydatabase.c"
}


void midori_history_database_list_by_count_with_bookmarks (MidoriHistoryDatabase* self, const gchar* filter, gint max_items, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MidoriHistoryDatabaseListByCountWithBookmarksData* _data_;
	MidoriHistoryDatabase* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	GCancellable* _tmp4_;
	GCancellable* _tmp5_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_ = g_slice_new0 (MidoriHistoryDatabaseListByCountWithBookmarksData);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_callback_ = _callback_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, midori_history_database_list_by_count_with_bookmarks_async_ready_wrapper, _user_data_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_callback_ == NULL) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		_data_->_task_complete_ = TRUE;
#line 1889 "midori-historydatabase.c"
	}
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_task_set_task_data (_data_->_async_result, _data_, midori_history_database_list_by_count_with_bookmarks_data_free);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->self = _tmp0_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = filter;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_free0 (_data_->filter);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->filter = _tmp2_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp3_ = max_items;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->max_items = _tmp3_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp4_ = cancellable;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp5_ = _g_object_ref0 (_tmp4_);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (_data_->cancellable);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->cancellable = _tmp5_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_database_list_by_count_with_bookmarks_co (_data_);
#line 1919 "midori-historydatabase.c"
}


GList* midori_history_database_list_by_count_with_bookmarks_finish (MidoriHistoryDatabase* self, GAsyncResult* _res_) {
	GList* result;
	MidoriHistoryDatabaseListByCountWithBookmarksData* _data_;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (NULL == _data_) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		return NULL;
#line 1932 "midori-historydatabase.c"
	}
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _data_->result;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->result = NULL;
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 1940 "midori-historydatabase.c"
}


static void midori_history_database_list_by_count_with_bookmarks_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	MidoriHistoryDatabaseListByCountWithBookmarksData* _data_;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_ = _user_data_;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_source_object_ = source_object;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_res_ = _res_;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_task_complete_ = TRUE;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_database_list_by_count_with_bookmarks_co (_data_);
#line 1956 "midori-historydatabase.c"
}


static gboolean midori_history_database_list_by_count_with_bookmarks_co (MidoriHistoryDatabaseListByCountWithBookmarksData* _data_) {
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	switch (_data_->_state_) {
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case 0:
#line 1965 "midori-historydatabase.c"
		goto _state_0;
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		case 1:
#line 1969 "midori-historydatabase.c"
		goto _state_1;
		default:
#line 104 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		g_assert_not_reached ();
#line 1974 "midori-historydatabase.c"
	}
	_state_0:
#line 105 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->sqlcmd = "\n" \
"                SELECT type, date, uri, title FROM (\n" \
"                SELECT 1 AS type, date, uri, title, count() AS ct FROM" \
" history\n" \
"                WHERE uri LIKE :filter OR title LIKE :filter GROUP BY " \
"uri\n" \
"                UNION ALL\n" \
"                SELECT 2 AS type, day AS date, replace(uri, '%s', keyw" \
"ords) AS uri,\n" \
"                       keywords AS title, count() AS ct FROM search\n" \
"                WHERE uri LIKE :filter OR title LIKE :filter GROUP BY " \
"uri\n" \
"                UNION ALL\n" \
"                SELECT 1 AS type, last_visit AS date, uri, title, 50 A" \
"S ct FROM bookmarks\n" \
"                WHERE title LIKE :filter OR uri LIKE :filter AND uri !" \
"='' AND uri NOT LIKE 'javascript:%'\n" \
"                ) GROUP BY uri ORDER BY ct DESC LIMIT :limit\n" \
"                ";
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp0_ = _data_->filter;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp1_ = _data_->max_items;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp2_ = _data_->cancellable;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_state_ = 1;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_database_query (_data_->self, _data_->sqlcmd, _data_->_tmp0_, (gint64) 0, (gint64) _data_->_tmp1_, _data_->_tmp2_, midori_history_database_list_by_count_with_bookmarks_ready, _data_);
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return FALSE;
#line 1991 "midori-historydatabase.c"
	_state_1:
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->_tmp3_ = midori_history_database_query_finish (_data_->self, _data_->_res_);
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_data_->result = _data_->_tmp3_;
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (_data_->_state_ != 0) {
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 2005 "midori-historydatabase.c"
		}
	}
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_object_unref (_data_->_async_result);
#line 118 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return FALSE;
#line 2012 "midori-historydatabase.c"
}


gboolean midori_history_database_insert (MidoriHistoryDatabase* self, const gchar* uri, const gchar* title, gint64 date, gint64 day, GError** error) {
	gboolean result = FALSE;
	const gchar* sqlcmd = NULL;
	MidoriDatabaseStatement* statement = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint64 _tmp3_;
	gint64 _tmp4_;
	MidoriDatabaseStatement* _tmp5_;
	gboolean _tmp8_ = FALSE;
	MidoriDatabaseStatement* _tmp9_;
	gboolean _tmp10_;
	GError * _inner_error_ = NULL;
#line 121 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 121 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (uri != NULL, FALSE);
#line 121 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (title != NULL, FALSE);
#line 122 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	sqlcmd = "INSERT INTO history (uri, title, date, day) VALUES (:uri, :title, :dat" \
"e, :day)";
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = sqlcmd;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = uri;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = title;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp3_ = date;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp4_ = day;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp5_ = midori_database_prepare ((MidoriDatabase*) self, _tmp0_, &_inner_error_, ":uri", G_TYPE_STRING, _tmp1_, ":title", G_TYPE_STRING, _tmp2_, ":date", G_TYPE_INT64, _tmp3_, ":day", G_TYPE_INT64, _tmp4_, NULL);
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	statement = _tmp5_;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 2056 "midori-historydatabase.c"
			gboolean _tmp6_ = FALSE;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp6_;
#line 2062 "midori-historydatabase.c"
		} else {
			gboolean _tmp7_ = FALSE;
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 123 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp7_;
#line 2071 "midori-historydatabase.c"
		}
	}
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp9_ = statement;
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp10_ = midori_database_statement_exec (_tmp9_, &_inner_error_);
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp8_ = _tmp10_;
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 2084 "midori-historydatabase.c"
			gboolean _tmp11_ = FALSE;
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (statement);
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp11_;
#line 2092 "midori-historydatabase.c"
		} else {
			gboolean _tmp12_ = FALSE;
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (statement);
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp12_;
#line 2103 "midori-historydatabase.c"
		}
	}
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp8_;
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (statement);
#line 128 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 2112 "midori-historydatabase.c"
}


gboolean midori_history_database_clear (MidoriHistoryDatabase* self, gint64 maximum_age, GError** error) {
	gboolean result = FALSE;
	const gchar* sqlcmd = NULL;
	MidoriDatabaseStatement* statement = NULL;
	const gchar* _tmp0_;
	gint64 _tmp1_;
	MidoriDatabaseStatement* _tmp2_;
	gboolean _tmp5_ = FALSE;
	MidoriDatabaseStatement* _tmp6_;
	gboolean _tmp7_;
	GError * _inner_error_ = NULL;
#line 131 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 132 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	sqlcmd = "\n" \
"                DELETE FROM history WHERE\n" \
"                (julianday(date('now')) - julianday(date(date,'unixepo" \
"ch')))\n" \
"                >= :maximum_age;\n" \
"                DELETE FROM search WHERE\n" \
"                (julianday(date('now')) - julianday(date(date,'unixepo" \
"ch')))\n" \
"                >= :maximum_age;\n" \
"                ";
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp0_ = sqlcmd;
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp1_ = maximum_age;
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp2_ = midori_database_prepare ((MidoriDatabase*) self, _tmp0_, &_inner_error_, ":maximum_age", G_TYPE_INT64, _tmp1_, NULL);
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	statement = _tmp2_;
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 2143 "midori-historydatabase.c"
			gboolean _tmp3_ = FALSE;
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp3_;
#line 2149 "midori-historydatabase.c"
		} else {
			gboolean _tmp4_ = FALSE;
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 140 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp4_;
#line 2158 "midori-historydatabase.c"
		}
	}
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp6_ = statement;
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp7_ = midori_database_statement_exec (_tmp6_, &_inner_error_);
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_tmp5_ = _tmp7_;
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 2171 "midori-historydatabase.c"
			gboolean _tmp8_ = FALSE;
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (statement);
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp8_;
#line 2179 "midori-historydatabase.c"
		} else {
			gboolean _tmp9_ = FALSE;
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			_g_object_unref0 (statement);
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.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 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			g_clear_error (&_inner_error_);
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
			return _tmp9_;
#line 2190 "midori-historydatabase.c"
		}
	}
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	result = _tmp5_;
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	_g_object_unref0 (statement);
#line 142 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	return result;
#line 2199 "midori-historydatabase.c"
}


static void midori_history_database_class_init (MidoriHistoryDatabaseClass * klass) {
#line 38 "/usr/src/ports/midori/midori-0.5.11-2.i686/src/midori-0.5.11/midori/midori-historydatabase.vala"
	midori_history_database_parent_class = g_type_class_peek_parent (klass);
#line 2206 "midori-historydatabase.c"
}


static void midori_history_database_instance_init (MidoriHistoryDatabase * self) {
}


GType midori_history_database_get_type (void) {
	static volatile gsize midori_history_database_type_id__volatile = 0;
	if (g_once_init_enter (&midori_history_database_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriHistoryDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_history_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriHistoryDatabase), 0, (GInstanceInitFunc) midori_history_database_instance_init, NULL };
		GType midori_history_database_type_id;
		midori_history_database_type_id = g_type_register_static (MIDORI_TYPE_DATABASE, "MidoriHistoryDatabase", &g_define_type_info, 0);
		g_once_init_leave (&midori_history_database_type_id__volatile, midori_history_database_type_id);
	}
	return midori_history_database_type_id__volatile;
}



