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

/*
 Copyright (C) 2013 Andre Auzi <aauzi@free.fr>
 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 <gio/gio.h>
#include <sqlite3.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <glib/gstdio.h>


#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_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;
typedef struct _MidoriBookmarksDatabasePrivate MidoriBookmarksDatabasePrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _sqlite3_close0(var) ((var == NULL) ? NULL : (var = (sqlite3_close (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

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 _MidoriBookmarksDatabase {
	MidoriDatabase parent_instance;
	MidoriBookmarksDatabasePrivate * priv;
};

struct _MidoriBookmarksDatabaseClass {
	MidoriDatabaseClass parent_class;
};


static gpointer midori_bookmarks_database_parent_class = NULL;

GType midori_database_get_type (void) G_GNUC_CONST;
GQuark midori_database_error_quark (void);
GType midori_bookmarks_database_get_type (void) G_GNUC_CONST;
enum  {
	MIDORI_BOOKMARKS_DATABASE_DUMMY_PROPERTY
};
MidoriBookmarksDatabase* midori_bookmarks_database_new (GError** error);
MidoriBookmarksDatabase* midori_bookmarks_database_construct (GType object_type, GError** error);
void midori_bookmarks_database_preinit (MidoriBookmarksDatabase* self, GError** error);
gboolean midori_database_init (MidoriDatabase* self, GCancellable* cancellable, GError** error);
gboolean midori_database_exec (MidoriDatabase* self, const gchar* query, GError** error);
gchar* midori_paths_get_config_filename_for_writing (const gchar* filename);
const gchar* midori_database_get_path (MidoriDatabase* self);
gchar* midori_paths_get_config_filename_for_reading (const gchar* filename);
sqlite3* midori_database_get_db (MidoriDatabase* self);
gboolean midori_database_exec_script (MidoriDatabase* self, const gchar* filename, GError** error);
gboolean midori_database_attach (MidoriDatabase* self, const gchar* path, const gchar* alias, GError** error);


MidoriBookmarksDatabase* midori_bookmarks_database_construct (GType object_type, GError** error) {
	MidoriBookmarksDatabase * self = NULL;
	GError * _inner_error_ = NULL;
#line 16 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	self = (MidoriBookmarksDatabase*) g_object_new (object_type, "path", "bookmarks.db", NULL);
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	midori_bookmarks_database_preinit (self, &_inner_error_);
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_g_object_unref0 (self);
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			return NULL;
#line 123 "midori-bookmarksdatabase.c"
		} else {
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_clear_error (&_inner_error_);
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			return NULL;
#line 131 "midori-bookmarksdatabase.c"
		}
	}
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	midori_database_init ((MidoriDatabase*) self, NULL, &_inner_error_);
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_g_object_unref0 (self);
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			return NULL;
#line 146 "midori-bookmarksdatabase.c"
		} else {
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_clear_error (&_inner_error_);
#line 18 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			return NULL;
#line 154 "midori-bookmarksdatabase.c"
		}
	}
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	midori_database_exec ((MidoriDatabase*) self, "PRAGMA foreign_keys = ON;", &_inner_error_);
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_propagate_error (error, _inner_error_);
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_g_object_unref0 (self);
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			return NULL;
#line 169 "midori-bookmarksdatabase.c"
		} else {
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_clear_error (&_inner_error_);
#line 19 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			return NULL;
#line 177 "midori-bookmarksdatabase.c"
		}
	}
#line 15 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	return self;
#line 182 "midori-bookmarksdatabase.c"
}


MidoriBookmarksDatabase* midori_bookmarks_database_new (GError** error) {
#line 15 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	return midori_bookmarks_database_construct (MIDORI_TYPE_BOOKMARKS_DATABASE, error);
#line 189 "midori-bookmarksdatabase.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 85 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	return self ? g_error_copy (self) : NULL;
#line 196 "midori-bookmarksdatabase.c"
}


void midori_bookmarks_database_preinit (MidoriBookmarksDatabase* self, GError** error) {
	gchar* dbfile = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* olddbfile = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* dbfile_v2 = NULL;
	gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	GError * _inner_error_ = NULL;
#line 22 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	g_return_if_fail (self != NULL);
#line 23 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp0_ = midori_database_get_path ((MidoriDatabase*) self);
#line 23 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp1_ = _tmp0_;
#line 23 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp2_ = midori_paths_get_config_filename_for_writing (_tmp1_);
#line 23 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	dbfile = _tmp2_;
#line 24 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp3_ = dbfile;
#line 24 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp4_ = g_strconcat (_tmp3_, ".old", NULL);
#line 24 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	olddbfile = _tmp4_;
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp5_ = midori_paths_get_config_filename_for_reading ("bookmarks_v2.db");
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	dbfile_v2 = _tmp5_;
#line 27 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp6_ = dbfile_v2;
#line 27 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_tmp7_ = access (_tmp6_, F_OK);
#line 27 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	if (_tmp7_ == 0) {
#line 239 "midori-bookmarksdatabase.c"
		const gchar* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		const gchar* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		sqlite3* _tmp18_ = NULL;
		gint _tmp19_ = 0;
		sqlite3_stmt* stmt = NULL;
		sqlite3* _tmp26_ = NULL;
		sqlite3* _tmp27_ = NULL;
		sqlite3_stmt* _tmp28_ = NULL;
		gint _tmp29_ = 0;
		sqlite3_stmt* _tmp37_ = NULL;
		gint _tmp38_ = 0;
		gint64 user_version = 0LL;
		sqlite3_stmt* _tmp46_ = NULL;
		gint64 _tmp47_ = 0LL;
		gint64 _tmp48_ = 0LL;
#line 28 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp8_ = dbfile;
#line 28 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp9_ = access (_tmp8_, F_OK);
#line 28 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_tmp9_ == 0) {
#line 264 "midori-bookmarksdatabase.c"
			const gchar* _tmp10_ = NULL;
			gint _tmp11_ = 0;
			const gchar* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp10_ = olddbfile;
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp11_ = access (_tmp10_, F_OK);
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_tmp11_ == 0) {
#line 275 "midori-bookmarksdatabase.c"
				const gchar* _tmp12_ = NULL;
#line 30 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp12_ = olddbfile;
#line 30 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				unlink (_tmp12_);
#line 281 "midori-bookmarksdatabase.c"
			}
#line 31 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp13_ = dbfile;
#line 31 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp14_ = olddbfile;
#line 31 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			g_rename (_tmp13_, _tmp14_);
#line 289 "midori-bookmarksdatabase.c"
		}
#line 34 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp15_ = dbfile_v2;
#line 34 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp16_ = dbfile;
#line 34 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		g_rename (_tmp15_, _tmp16_);
#line 36 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp17_ = dbfile;
#line 36 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp19_ = sqlite3_open_v2 (_tmp17_, &_tmp18_, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
#line 36 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_sqlite3_close0 (((MidoriDatabase*) self)->_db);
#line 36 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		((MidoriDatabase*) self)->_db = _tmp18_;
#line 36 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_tmp19_ != SQLITE_OK) {
#line 307 "midori-bookmarksdatabase.c"
			const gchar* _tmp20_ = NULL;
			const gchar* _tmp21_ = NULL;
			gchar* _tmp22_ = NULL;
			gchar* _tmp23_ = NULL;
			GError* _tmp24_ = NULL;
			GError* _tmp25_ = NULL;
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp20_ = midori_database_get_path ((MidoriDatabase*) self);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp21_ = _tmp20_;
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp22_ = g_strdup_printf ("Failed to open database %s", _tmp21_);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp23_ = _tmp22_;
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp24_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_OPEN, _tmp23_);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp25_ = _tmp24_;
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_g_free0 (_tmp23_);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_inner_error_ = _tmp25_;
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_propagate_error (error, _inner_error_);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile_v2);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (olddbfile);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				return;
#line 342 "midori-bookmarksdatabase.c"
			} else {
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile_v2);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (olddbfile);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_clear_error (&_inner_error_);
#line 37 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				return;
#line 356 "midori-bookmarksdatabase.c"
			}
		}
#line 40 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp26_ = midori_database_get_db ((MidoriDatabase*) self);
#line 40 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp27_ = _tmp26_;
#line 40 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp29_ = sqlite3_prepare_v2 (_tmp27_, "PRAGMA user_version;", -1, &_tmp28_, NULL);
#line 40 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_sqlite3_finalize0 (stmt);
#line 40 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		stmt = _tmp28_;
#line 40 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_tmp29_ != SQLITE_OK) {
#line 371 "midori-bookmarksdatabase.c"
			sqlite3* _tmp30_ = NULL;
			sqlite3* _tmp31_ = NULL;
			const gchar* _tmp32_ = NULL;
			gchar* _tmp33_ = NULL;
			gchar* _tmp34_ = NULL;
			GError* _tmp35_ = NULL;
			GError* _tmp36_ = NULL;
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp30_ = midori_database_get_db ((MidoriDatabase*) self);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp31_ = _tmp30_;
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp32_ = sqlite3_errmsg (_tmp31_);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp33_ = g_strdup_printf ("Failed to compile statement %s", _tmp32_);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp34_ = _tmp33_;
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp35_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_EXECUTE, _tmp34_);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp36_ = _tmp35_;
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_g_free0 (_tmp34_);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_inner_error_ = _tmp36_;
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_propagate_error (error, _inner_error_);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_sqlite3_finalize0 (stmt);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile_v2);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (olddbfile);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				return;
#line 411 "midori-bookmarksdatabase.c"
			} else {
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_sqlite3_finalize0 (stmt);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile_v2);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (olddbfile);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_clear_error (&_inner_error_);
#line 41 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				return;
#line 427 "midori-bookmarksdatabase.c"
			}
		}
#line 42 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp37_ = stmt;
#line 42 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp38_ = sqlite3_step (_tmp37_);
#line 42 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_tmp38_ != SQLITE_ROW) {
#line 436 "midori-bookmarksdatabase.c"
			sqlite3* _tmp39_ = NULL;
			sqlite3* _tmp40_ = NULL;
			const gchar* _tmp41_ = NULL;
			gchar* _tmp42_ = NULL;
			gchar* _tmp43_ = NULL;
			GError* _tmp44_ = NULL;
			GError* _tmp45_ = NULL;
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp39_ = midori_database_get_db ((MidoriDatabase*) self);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp40_ = _tmp39_;
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp41_ = sqlite3_errmsg (_tmp40_);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp42_ = g_strdup_printf ("Failed to get row %s", _tmp41_);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp43_ = _tmp42_;
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp44_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_EXECUTE, _tmp43_);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp45_ = _tmp44_;
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_g_free0 (_tmp43_);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_inner_error_ = _tmp45_;
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_propagate_error (error, _inner_error_);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_sqlite3_finalize0 (stmt);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile_v2);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (olddbfile);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				return;
#line 476 "midori-bookmarksdatabase.c"
			} else {
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_sqlite3_finalize0 (stmt);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile_v2);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (olddbfile);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (dbfile);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_clear_error (&_inner_error_);
#line 43 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				return;
#line 492 "midori-bookmarksdatabase.c"
			}
		}
#line 44 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp46_ = stmt;
#line 44 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp47_ = sqlite3_column_int64 (_tmp46_, 0);
#line 44 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		user_version = _tmp47_;
#line 46 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp48_ = user_version;
#line 46 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_tmp48_ == ((gint64) 0)) {
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			midori_database_exec ((MidoriDatabase*) self, "PRAGMA user_version = 1;", &_inner_error_);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_propagate_error (error, _inner_error_);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_sqlite3_finalize0 (stmt);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 523 "midori-bookmarksdatabase.c"
				} else {
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_sqlite3_finalize0 (stmt);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_clear_error (&_inner_error_);
#line 47 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 539 "midori-bookmarksdatabase.c"
				}
			}
		}
#line 50 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_sqlite3_close0 (((MidoriDatabase*) self)->_db);
#line 50 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		((MidoriDatabase*) self)->_db = NULL;
#line 27 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_sqlite3_finalize0 (stmt);
#line 549 "midori-bookmarksdatabase.c"
	} else {
		const gchar* _tmp49_ = NULL;
		gint _tmp50_ = 0;
#line 51 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp49_ = dbfile;
#line 51 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		_tmp50_ = access (_tmp49_, F_OK);
#line 51 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
		if (_tmp50_ == 0) {
#line 559 "midori-bookmarksdatabase.c"
			const gchar* _tmp51_ = NULL;
			sqlite3* _tmp52_ = NULL;
			gint _tmp53_ = 0;
			sqlite3_stmt* stmt = NULL;
			sqlite3* _tmp60_ = NULL;
			sqlite3* _tmp61_ = NULL;
			sqlite3_stmt* _tmp62_ = NULL;
			gint _tmp63_ = 0;
			sqlite3_stmt* _tmp71_ = NULL;
			gint _tmp72_ = 0;
			gint64 user_version = 0LL;
			sqlite3_stmt* _tmp80_ = NULL;
			gint64 _tmp81_ = 0LL;
			gint64 _tmp82_ = 0LL;
#line 53 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp51_ = dbfile;
#line 53 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp53_ = sqlite3_open_v2 (_tmp51_, &_tmp52_, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
#line 53 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_sqlite3_close0 (((MidoriDatabase*) self)->_db);
#line 53 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			((MidoriDatabase*) self)->_db = _tmp52_;
#line 53 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_tmp53_ != SQLITE_OK) {
#line 584 "midori-bookmarksdatabase.c"
				const gchar* _tmp54_ = NULL;
				const gchar* _tmp55_ = NULL;
				gchar* _tmp56_ = NULL;
				gchar* _tmp57_ = NULL;
				GError* _tmp58_ = NULL;
				GError* _tmp59_ = NULL;
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp54_ = midori_database_get_path ((MidoriDatabase*) self);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp55_ = _tmp54_;
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp56_ = g_strdup_printf ("Failed to open database %s", _tmp55_);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp57_ = _tmp56_;
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp58_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_OPEN, _tmp57_);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp59_ = _tmp58_;
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (_tmp57_);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_inner_error_ = _tmp59_;
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_propagate_error (error, _inner_error_);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 619 "midori-bookmarksdatabase.c"
				} else {
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_clear_error (&_inner_error_);
#line 54 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 633 "midori-bookmarksdatabase.c"
				}
			}
#line 57 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp60_ = midori_database_get_db ((MidoriDatabase*) self);
#line 57 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp61_ = _tmp60_;
#line 57 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp63_ = sqlite3_prepare_v2 (_tmp61_, "PRAGMA user_version;", -1, &_tmp62_, NULL);
#line 57 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_sqlite3_finalize0 (stmt);
#line 57 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			stmt = _tmp62_;
#line 57 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_tmp63_ != SQLITE_OK) {
#line 648 "midori-bookmarksdatabase.c"
				sqlite3* _tmp64_ = NULL;
				sqlite3* _tmp65_ = NULL;
				const gchar* _tmp66_ = NULL;
				gchar* _tmp67_ = NULL;
				gchar* _tmp68_ = NULL;
				GError* _tmp69_ = NULL;
				GError* _tmp70_ = NULL;
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp64_ = midori_database_get_db ((MidoriDatabase*) self);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp65_ = _tmp64_;
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp66_ = sqlite3_errmsg (_tmp65_);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp67_ = g_strdup_printf ("Failed to compile statement %s", _tmp66_);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp68_ = _tmp67_;
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp69_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_EXECUTE, _tmp68_);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp70_ = _tmp69_;
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (_tmp68_);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_inner_error_ = _tmp70_;
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_propagate_error (error, _inner_error_);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_sqlite3_finalize0 (stmt);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 688 "midori-bookmarksdatabase.c"
				} else {
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_sqlite3_finalize0 (stmt);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_clear_error (&_inner_error_);
#line 58 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 704 "midori-bookmarksdatabase.c"
				}
			}
#line 59 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp71_ = stmt;
#line 59 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp72_ = sqlite3_step (_tmp71_);
#line 59 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_tmp72_ != SQLITE_ROW) {
#line 713 "midori-bookmarksdatabase.c"
				sqlite3* _tmp73_ = NULL;
				sqlite3* _tmp74_ = NULL;
				const gchar* _tmp75_ = NULL;
				gchar* _tmp76_ = NULL;
				gchar* _tmp77_ = NULL;
				GError* _tmp78_ = NULL;
				GError* _tmp79_ = NULL;
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp73_ = midori_database_get_db ((MidoriDatabase*) self);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp74_ = _tmp73_;
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp75_ = sqlite3_errmsg (_tmp74_);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp76_ = g_strdup_printf ("Failed to get row %s", _tmp75_);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp77_ = _tmp76_;
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp78_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_EXECUTE, _tmp77_);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp79_ = _tmp78_;
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_g_free0 (_tmp77_);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_inner_error_ = _tmp79_;
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_propagate_error (error, _inner_error_);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_sqlite3_finalize0 (stmt);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 753 "midori-bookmarksdatabase.c"
				} else {
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_sqlite3_finalize0 (stmt);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile_v2);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (olddbfile);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (dbfile);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					g_clear_error (&_inner_error_);
#line 60 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					return;
#line 769 "midori-bookmarksdatabase.c"
				}
			}
#line 61 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp80_ = stmt;
#line 61 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp81_ = sqlite3_column_int64 (_tmp80_, 0);
#line 61 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			user_version = _tmp81_;
#line 63 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_sqlite3_close0 (((MidoriDatabase*) self)->_db);
#line 63 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			((MidoriDatabase*) self)->_db = NULL;
#line 65 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_tmp82_ = user_version;
#line 65 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			if (_tmp82_ == ((gint64) 0)) {
#line 786 "midori-bookmarksdatabase.c"
				const gchar* _tmp83_ = NULL;
				gint _tmp84_ = 0;
				const gchar* _tmp86_ = NULL;
				const gchar* _tmp87_ = NULL;
				const gchar* _tmp88_ = NULL;
				sqlite3* _tmp89_ = NULL;
				gint _tmp90_ = 0;
				const gchar* _tmp97_ = NULL;
				gboolean failure = FALSE;
				gboolean _tmp101_ = FALSE;
#line 66 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp83_ = olddbfile;
#line 66 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp84_ = access (_tmp83_, F_OK);
#line 66 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_tmp84_ == 0) {
#line 803 "midori-bookmarksdatabase.c"
					const gchar* _tmp85_ = NULL;
#line 67 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp85_ = olddbfile;
#line 67 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					unlink (_tmp85_);
#line 809 "midori-bookmarksdatabase.c"
				}
#line 69 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp86_ = dbfile;
#line 69 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp87_ = olddbfile;
#line 69 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				g_rename (_tmp86_, _tmp87_);
#line 71 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp88_ = dbfile;
#line 71 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp90_ = sqlite3_open_v2 (_tmp88_, &_tmp89_, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
#line 71 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_sqlite3_close0 (((MidoriDatabase*) self)->_db);
#line 71 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				((MidoriDatabase*) self)->_db = _tmp89_;
#line 71 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_tmp90_ != SQLITE_OK) {
#line 827 "midori-bookmarksdatabase.c"
					const gchar* _tmp91_ = NULL;
					const gchar* _tmp92_ = NULL;
					gchar* _tmp93_ = NULL;
					gchar* _tmp94_ = NULL;
					GError* _tmp95_ = NULL;
					GError* _tmp96_ = NULL;
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp91_ = midori_database_get_path ((MidoriDatabase*) self);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp92_ = _tmp91_;
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp93_ = g_strdup_printf ("Failed to open database %s", _tmp92_);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp94_ = _tmp93_;
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp95_ = g_error_new_literal (MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_OPEN, _tmp94_);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp96_ = _tmp95_;
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_free0 (_tmp94_);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_inner_error_ = _tmp96_;
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_propagate_error (error, _inner_error_);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 864 "midori-bookmarksdatabase.c"
					} else {
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 72 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 880 "midori-bookmarksdatabase.c"
					}
				}
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				midori_database_exec_script ((MidoriDatabase*) self, "Create", &_inner_error_);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_propagate_error (error, _inner_error_);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 901 "midori-bookmarksdatabase.c"
					} else {
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 74 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 917 "midori-bookmarksdatabase.c"
					}
				}
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp97_ = olddbfile;
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				midori_database_attach ((MidoriDatabase*) self, _tmp97_, "old_db", &_inner_error_);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_propagate_error (error, _inner_error_);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 940 "midori-bookmarksdatabase.c"
					} else {
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 76 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 956 "midori-bookmarksdatabase.c"
					}
				}
#line 78 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				failure = FALSE;
#line 961 "midori-bookmarksdatabase.c"
				{
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					midori_database_exec_script ((MidoriDatabase*) self, "Import_old_db_bookmarks", &_inner_error_);
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 969 "midori-bookmarksdatabase.c"
							goto __catch11_midori_database_error;
						}
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						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 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 80 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 986 "midori-bookmarksdatabase.c"
					}
				}
				goto __finally11;
				__catch11_midori_database_error:
				{
					GError* _error_ = NULL;
					GError* _tmp98_ = NULL;
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_error_ = _inner_error_;
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_inner_error_ = NULL;
#line 82 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_tmp98_ = _error_;
#line 82 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (g_error_matches (_tmp98_, MIDORI_DATABASE_ERROR, MIDORI_DATABASE_ERROR_EXECUTE)) {
#line 83 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						failure = TRUE;
#line 1004 "midori-bookmarksdatabase.c"
					} else {
						GError* _tmp99_ = NULL;
						GError* _tmp100_ = NULL;
#line 85 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_tmp99_ = _error_;
#line 85 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_tmp100_ = _g_error_copy0 (_tmp99_);
#line 85 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_inner_error_ = _tmp100_;
#line 85 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_error_free0 (_error_);
#line 1016 "midori-bookmarksdatabase.c"
						goto __finally11;
					}
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					_g_error_free0 (_error_);
#line 1021 "midori-bookmarksdatabase.c"
				}
				__finally11:
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_propagate_error (error, _inner_error_);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 1040 "midori-bookmarksdatabase.c"
					} else {
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 79 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 1056 "midori-bookmarksdatabase.c"
					}
				}
#line 89 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_tmp101_ = failure;
#line 89 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (_tmp101_) {
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					midori_database_exec ((MidoriDatabase*) self, "ROLLBACK TRANSACTION;", &_inner_error_);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							g_propagate_error (error, _inner_error_);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_sqlite3_finalize0 (stmt);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_g_free0 (dbfile_v2);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_g_free0 (olddbfile);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_g_free0 (dbfile);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							return;
#line 1081 "midori-bookmarksdatabase.c"
						} else {
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_sqlite3_finalize0 (stmt);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_g_free0 (dbfile_v2);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_g_free0 (olddbfile);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							_g_free0 (dbfile);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							g_clear_error (&_inner_error_);
#line 90 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
							return;
#line 1097 "midori-bookmarksdatabase.c"
						}
					}
				}
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				midori_database_exec ((MidoriDatabase*) self, "DETACH DATABASE old_db;", &_inner_error_);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_propagate_error (error, _inner_error_);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 1119 "midori-bookmarksdatabase.c"
					} else {
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 92 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 1135 "midori-bookmarksdatabase.c"
					}
				}
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				midori_database_exec ((MidoriDatabase*) self, "PRAGMA user_version = 1;", &_inner_error_);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
					if (_inner_error_->domain == MIDORI_DATABASE_ERROR) {
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_propagate_error (error, _inner_error_);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 1156 "midori-bookmarksdatabase.c"
					} else {
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_sqlite3_finalize0 (stmt);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile_v2);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (olddbfile);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						_g_free0 (dbfile);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.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 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						g_clear_error (&_inner_error_);
#line 93 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
						return;
#line 1172 "midori-bookmarksdatabase.c"
					}
				}
#line 95 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				_sqlite3_close0 (((MidoriDatabase*) self)->_db);
#line 95 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
				((MidoriDatabase*) self)->_db = NULL;
#line 1179 "midori-bookmarksdatabase.c"
			}
#line 51 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
			_sqlite3_finalize0 (stmt);
#line 1183 "midori-bookmarksdatabase.c"
		}
	}
#line 22 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_g_free0 (dbfile_v2);
#line 22 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_g_free0 (olddbfile);
#line 22 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	_g_free0 (dbfile);
#line 1192 "midori-bookmarksdatabase.c"
}


static void midori_bookmarks_database_class_init (MidoriBookmarksDatabaseClass * klass) {
#line 14 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/midori/midori-bookmarksdatabase.vala"
	midori_bookmarks_database_parent_class = g_type_class_peek_parent (klass);
#line 1199 "midori-bookmarksdatabase.c"
}


static void midori_bookmarks_database_instance_init (MidoriBookmarksDatabase * self) {
}


GType midori_bookmarks_database_get_type (void) {
	static volatile gsize midori_bookmarks_database_type_id__volatile = 0;
	if (g_once_init_enter (&midori_bookmarks_database_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MidoriBookmarksDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) midori_bookmarks_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MidoriBookmarksDatabase), 0, (GInstanceInitFunc) midori_bookmarks_database_instance_init, NULL };
		GType midori_bookmarks_database_type_id;
		midori_bookmarks_database_type_id = g_type_register_static (MIDORI_TYPE_DATABASE, "MidoriBookmarksDatabase", &g_define_type_info, 0);
		g_once_init_leave (&midori_bookmarks_database_type_id__volatile, midori_bookmarks_database_type_id);
	}
	return midori_bookmarks_database_type_id__volatile;
}



