diff options
Diffstat (limited to 'src/db/Db.c')
| -rw-r--r-- | src/db/Db.c | 497 | 
1 files changed, 192 insertions, 305 deletions
| diff --git a/src/db/Db.c b/src/db/Db.c index b5200cf..cafe2e4 100644 --- a/src/db/Db.c +++ b/src/db/Db.c @@ -1,4 +1,4 @@ -/* Db.c generated by valac 0.36.6, the Vala compiler +/* Db.c generated by valac 0.40.4, the Vala compiler   * generated from Db.vala, do not modify */  /* Copyright 2016 Software Freedom Conservancy Inc. @@ -7,6 +7,7 @@   * (version 2.1 or later).  See the COPYING file in this distribution.   */ +  #include <glib.h>  #include <glib-object.h>  #include <stdlib.h> @@ -71,84 +72,108 @@ void database_table_init (const gchar* filename);  void db_terminate (void);  void database_table_terminate (void);  GType db_verify_result_get_type (void) G_GNUC_CONST; -DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version); +DbVerifyResult db_verify_database (gchar* * app_version, +                                   gint* schema_version);  gpointer database_table_ref (gpointer instance);  void database_table_unref (gpointer instance); -GParamSpec* param_spec_database_table (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); -void value_set_database_table (GValue* value, gpointer v_object); -void value_take_database_table (GValue* value, gpointer v_object); +GParamSpec* param_spec_database_table (const gchar* name, +                                       const gchar* nick, +                                       const gchar* blurb, +                                       GType object_type, +                                       GParamFlags flags); +void value_set_database_table (GValue* value, +                               gpointer v_object); +void value_take_database_table (GValue* value, +                                gpointer v_object);  gpointer value_get_database_table (const GValue* value);  GType database_table_get_type (void) G_GNUC_CONST;  GType version_table_get_type (void) G_GNUC_CONST;  VersionTable* version_table_get_instance (void); -gint version_table_get_version (VersionTable* self, gchar* * app_version); +gint version_table_get_version (VersionTable* self, +                                gchar* * app_version);  #define DATABASE_TABLE_SCHEMA_VERSION 20  #define RESOURCES_APP_VERSION _VERSION -void version_table_set_version (VersionTable* self, gint version, const gchar* app_version, const gchar* user_data); +void version_table_set_version (VersionTable* self, +                                gint version, +                                const gchar* app_version, +                                const gchar* user_data);  DbVerifyResult db_upgrade_database (gint input_version); -gboolean database_table_has_column (const gchar* table_name, const gchar* column_name); -gboolean database_table_add_column (const gchar* table_name, const gchar* column_name, const gchar* column_constraints); +gboolean database_table_has_column (const gchar* table_name, +                                    const gchar* column_name); +gboolean database_table_add_column (const gchar* table_name, +                                    const gchar* column_name, +                                    const gchar* column_constraints);  gboolean database_table_has_table (const gchar* table_name); -gboolean database_table_ensure_column (const gchar* table_name, const gchar* column_name, const gchar* column_constraints, const gchar* upgrade_msg); +gboolean database_table_ensure_column (const gchar* table_name, +                                       const gchar* column_name, +                                       const gchar* column_constraints, +                                       const gchar* upgrade_msg);  void tag_table_upgrade_for_htags (void);  void gsettings_configuration_engine_run_gsettings_migrator (void);  gpointer application_ref (gpointer instance);  void application_unref (gpointer instance); -GParamSpec* param_spec_application (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); -void value_set_application (GValue* value, gpointer v_object); -void value_take_application (GValue* value, gpointer v_object); +GParamSpec* param_spec_application (const gchar* name, +                                    const gchar* nick, +                                    const gchar* blurb, +                                    GType object_type, +                                    GParamFlags flags); +void value_set_application (GValue* value, +                            gpointer v_object); +void value_take_application (GValue* value, +                             gpointer v_object);  gpointer value_get_application (const GValue* value);  GType application_get_type (void) G_GNUC_CONST;  Application* application_get_instance (void); -void application_set_raw_thumbs_fix_required (Application* self, gboolean should_fixup); -void version_table_update_version (VersionTable* self, gint version, const gchar* app_version); +void application_set_raw_thumbs_fix_required (Application* self, +                                              gboolean should_fixup); +void version_table_update_version (VersionTable* self, +                                   gint version, +                                   const gchar* app_version); -void db_preconfigure (GFile* db_file) { +void +db_preconfigure (GFile* db_file) +{  	gchar* _tmp0_ = NULL; -	GFile* _tmp1_; -	gchar* _tmp5_; +	gchar* _tmp3_;  #line 14 "/home/jens/Source/shotwell/src/db/Db.vala"  	g_return_if_fail ((db_file == NULL) || G_IS_FILE (db_file));  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp1_ = db_file; -#line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp1_ != NULL) { -#line 118 "Db.c" -		GFile* _tmp2_; -		gchar* _tmp3_; +	if (db_file != NULL) { +#line 144 "Db.c" +		gchar* _tmp1_;  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp2_ = db_file; -#line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp3_ = g_file_get_path (_tmp2_); +		_tmp1_ = g_file_get_path (db_file);  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala"  		_g_free0 (_tmp0_);  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp0_ = _tmp3_; -#line 129 "Db.c" +		_tmp0_ = _tmp1_; +#line 152 "Db.c"  	} else { -		gchar* _tmp4_; +		gchar* _tmp2_;  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp4_ = g_strdup (DB_IN_MEMORY_NAME); +		_tmp2_ = g_strdup (DB_IN_MEMORY_NAME);  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala"  		_g_free0 (_tmp0_);  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp0_ = _tmp4_; -#line 138 "Db.c" +		_tmp0_ = _tmp2_; +#line 161 "Db.c"  	}  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp5_ = g_strdup (_tmp0_); +	_tmp3_ = g_strdup (_tmp0_);  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala"  	_g_free0 (db_filename);  #line 15 "/home/jens/Source/shotwell/src/db/Db.vala" -	db_filename = _tmp5_; +	db_filename = _tmp3_;  #line 14 "/home/jens/Source/shotwell/src/db/Db.vala"  	_g_free0 (_tmp0_); -#line 148 "Db.c" +#line 171 "Db.c"  } -void db_init (GError** error) { +void +db_init (GError** error) +{  	const gchar* _tmp0_;  	const gchar* _tmp1_;  #line 19 "/home/jens/Source/shotwell/src/db/Db.vala" @@ -159,18 +184,22 @@ void db_init (GError** error) {  	_tmp1_ = db_filename;  #line 21 "/home/jens/Source/shotwell/src/db/Db.vala"  	database_table_init (_tmp1_); -#line 163 "Db.c" +#line 188 "Db.c"  } -void db_terminate (void) { +void +db_terminate (void) +{  #line 25 "/home/jens/Source/shotwell/src/db/Db.vala"  	database_table_terminate (); -#line 170 "Db.c" +#line 197 "Db.c"  } -GType db_verify_result_get_type (void) { +GType +db_verify_result_get_type (void) +{  	static volatile gsize db_verify_result_type_id__volatile = 0;  	if (g_once_init_enter (&db_verify_result_type_id__volatile)) {  		static const GEnumValue values[] = {{DB_VERIFY_RESULT_OK, "DB_VERIFY_RESULT_OK", "ok"}, {DB_VERIFY_RESULT_FUTURE_VERSION, "DB_VERIFY_RESULT_FUTURE_VERSION", "future-version"}, {DB_VERIFY_RESULT_UPGRADE_ERROR, "DB_VERIFY_RESULT_UPGRADE_ERROR", "upgrade-error"}, {DB_VERIFY_RESULT_NO_UPGRADE_AVAILABLE, "DB_VERIFY_RESULT_NO_UPGRADE_AVAILABLE", "no-upgrade-available"}, {0, NULL, NULL}}; @@ -182,7 +211,10 @@ GType db_verify_result_get_type (void) {  } -DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) { +DbVerifyResult +db_verify_database (gchar* * app_version, +                    gint* schema_version) +{  	gchar* _vala_app_version = NULL;  	gint _vala_schema_version = 0;  	DbVerifyResult result = 0; @@ -211,7 +243,7 @@ DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) {  	_tmp4_ = _vala_schema_version;  #line 39 "/home/jens/Source/shotwell/src/db/Db.vala"  	if (_tmp4_ >= 0) { -#line 215 "Db.c" +#line 247 "Db.c"  		gint _tmp5_;  		const gchar* _tmp6_;  #line 40 "/home/jens/Source/shotwell/src/db/Db.vala" @@ -220,13 +252,13 @@ DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) {  		_tmp6_ = _vala_app_version;  #line 40 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_debug ("Db.vala:40: Database schema version %d created by app version %s", _tmp5_, _tmp6_); -#line 224 "Db.c" +#line 256 "Db.c"  	}  #line 42 "/home/jens/Source/shotwell/src/db/Db.vala"  	_tmp7_ = _vala_schema_version;  #line 42 "/home/jens/Source/shotwell/src/db/Db.vala"  	if (_tmp7_ == -1) { -#line 230 "Db.c" +#line 262 "Db.c"  		VersionTable* _tmp8_;  		gchar* _tmp9_;  #line 44 "/home/jens/Source/shotwell/src/db/Db.vala" @@ -243,7 +275,7 @@ DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) {  		_vala_app_version = _tmp9_;  #line 48 "/home/jens/Source/shotwell/src/db/Db.vala"  		_vala_schema_version = DATABASE_TABLE_SCHEMA_VERSION; -#line 247 "Db.c" +#line 279 "Db.c"  	} else {  		gint _tmp10_;  #line 49 "/home/jens/Source/shotwell/src/db/Db.vala" @@ -258,42 +290,39 @@ DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) {  			if (app_version) {  #line 51 "/home/jens/Source/shotwell/src/db/Db.vala"  				*app_version = _vala_app_version; -#line 262 "Db.c" +#line 294 "Db.c"  			} else {  #line 51 "/home/jens/Source/shotwell/src/db/Db.vala"  				_g_free0 (_vala_app_version); -#line 266 "Db.c" +#line 298 "Db.c"  			}  #line 51 "/home/jens/Source/shotwell/src/db/Db.vala"  			if (schema_version) {  #line 51 "/home/jens/Source/shotwell/src/db/Db.vala"  				*schema_version = _vala_schema_version; -#line 272 "Db.c" +#line 304 "Db.c"  			}  #line 51 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 276 "Db.c" +#line 308 "Db.c"  		} else {  			gint _tmp11_;  #line 52 "/home/jens/Source/shotwell/src/db/Db.vala"  			_tmp11_ = _vala_schema_version;  #line 52 "/home/jens/Source/shotwell/src/db/Db.vala"  			if (_tmp11_ < DATABASE_TABLE_SCHEMA_VERSION) { -#line 283 "Db.c" +#line 315 "Db.c"  				DbVerifyResult _result_ = 0;  				gint _tmp12_;  				DbVerifyResult _tmp13_; -				DbVerifyResult _tmp14_;  #line 54 "/home/jens/Source/shotwell/src/db/Db.vala"  				_tmp12_ = _vala_schema_version;  #line 54 "/home/jens/Source/shotwell/src/db/Db.vala" -				_tmp13_ = db_upgrade_database (_tmp12_); -#line 54 "/home/jens/Source/shotwell/src/db/Db.vala" -				_result_ = _tmp13_; +				_result_ = db_upgrade_database (_tmp12_);  #line 55 "/home/jens/Source/shotwell/src/db/Db.vala" -				_tmp14_ = _result_; +				_tmp13_ = _result_;  #line 55 "/home/jens/Source/shotwell/src/db/Db.vala" -				if (_tmp14_ != DB_VERIFY_RESULT_OK) { +				if (_tmp13_ != DB_VERIFY_RESULT_OK) {  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala"  					result = _result_;  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala" @@ -302,21 +331,21 @@ DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) {  					if (app_version) {  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala"  						*app_version = _vala_app_version; -#line 306 "Db.c" +#line 335 "Db.c"  					} else {  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala"  						_g_free0 (_vala_app_version); -#line 310 "Db.c" +#line 339 "Db.c"  					}  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala"  					if (schema_version) {  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala"  						*schema_version = _vala_schema_version; -#line 316 "Db.c" +#line 345 "Db.c"  					}  #line 56 "/home/jens/Source/shotwell/src/db/Db.vala"  					return result; -#line 320 "Db.c" +#line 349 "Db.c"  				}  			}  		} @@ -329,526 +358,384 @@ DbVerifyResult db_verify_database (gchar* * app_version, gint* schema_version) {  	if (app_version) {  #line 59 "/home/jens/Source/shotwell/src/db/Db.vala"  		*app_version = _vala_app_version; -#line 333 "Db.c" +#line 362 "Db.c"  	} else {  #line 59 "/home/jens/Source/shotwell/src/db/Db.vala"  		_g_free0 (_vala_app_version); -#line 337 "Db.c" +#line 366 "Db.c"  	}  #line 59 "/home/jens/Source/shotwell/src/db/Db.vala"  	if (schema_version) {  #line 59 "/home/jens/Source/shotwell/src/db/Db.vala"  		*schema_version = _vala_schema_version; -#line 343 "Db.c" +#line 372 "Db.c"  	}  #line 59 "/home/jens/Source/shotwell/src/db/Db.vala"  	return result; -#line 347 "Db.c" +#line 376 "Db.c"  } -DbVerifyResult db_upgrade_database (gint input_version) { +DbVerifyResult +db_upgrade_database (gint input_version) +{  	DbVerifyResult result = 0; -	gint _tmp0_;  	gint version = 0; +	gint _tmp0_;  	gint _tmp1_; -	gint _tmp2_; -	gint _tmp3_; -	gboolean _tmp4_; -	gboolean _tmp6_; -	gboolean _tmp8_; -	gboolean _tmp10_; -	gboolean _tmp12_; -	gboolean _tmp14_; -	gboolean _tmp16_; -	gboolean _tmp18_; -	gboolean _tmp20_ = FALSE; -	gboolean _tmp21_; -	gboolean _tmp24_; -	gboolean _tmp26_; -	gboolean _tmp27_; -	gboolean _tmp29_; -	gboolean _tmp31_; -	gboolean _tmp33_; -	gint _tmp35_; -	gint _tmp36_; -	gboolean _tmp37_; -	gboolean _tmp39_; -	gboolean _tmp40_; -	gboolean _tmp42_; -	gint _tmp44_; -	gint _tmp47_; -	VersionTable* _tmp48_; -	VersionTable* _tmp49_; -	gint _tmp50_; -	gint _tmp51_; -#line 63 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp0_ = input_version; +	gboolean _tmp2_ = FALSE; +	gint _tmp5_; +	VersionTable* _tmp6_; +	VersionTable* _tmp7_; +	gint _tmp8_; +	gint _tmp9_;  #line 63 "/home/jens/Source/shotwell/src/db/Db.vala" -	_vala_assert (_tmp0_ < DATABASE_TABLE_SCHEMA_VERSION, "input_version < DatabaseTable.SCHEMA_VERSION"); +	_vala_assert (input_version < DATABASE_TABLE_SCHEMA_VERSION, "input_version < DatabaseTable.SCHEMA_VERSION");  #line 65 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp1_ = input_version; -#line 65 "/home/jens/Source/shotwell/src/db/Db.vala" -	version = _tmp1_; +	version = input_version;  #line 68 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp2_ = version; +	_tmp0_ = version;  #line 68 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp2_ == 1) { +	if (_tmp0_ == 1) {  #line 69 "/home/jens/Source/shotwell/src/db/Db.vala"  		result = DB_VERIFY_RESULT_NO_UPGRADE_AVAILABLE;  #line 69 "/home/jens/Source/shotwell/src/db/Db.vala"  		return result; -#line 402 "Db.c" +#line 405 "Db.c"  	}  #line 71 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp3_ = version; +	_tmp1_ = version;  #line 71 "/home/jens/Source/shotwell/src/db/Db.vala" -	g_message ("Db.vala:71: Upgrading database from schema version %d to %d", _tmp3_, DATABASE_TABLE_SCHEMA_VERSION); -#line 83 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp4_ = database_table_has_column ("PhotoTable", "flags"); +	g_message ("Db.vala:71: Upgrading database from schema version %d to %d", _tmp1_, DATABASE_TABLE_SCHEMA_VERSION);  #line 83 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp4_) { -#line 412 "Db.c" -		gboolean _tmp5_; +	if (!database_table_has_column ("PhotoTable", "flags")) {  #line 84 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:84: upgrade_database: adding flags column to PhotoTable");  #line 85 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp5_ = database_table_add_column ("PhotoTable", "flags", "INTEGER DEFAULT 0"); -#line 85 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp5_) { +		if (!database_table_add_column ("PhotoTable", "flags", "INTEGER DEFAULT 0")) {  #line 86 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 86 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 424 "Db.c" +#line 421 "Db.c"  		}  	}  #line 89 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 3;  #line 100 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp6_ = database_table_has_column ("PhotoTable", "file_format"); -#line 100 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp6_) { -#line 433 "Db.c" -		gboolean _tmp7_; +	if (!database_table_has_column ("PhotoTable", "file_format")) {  #line 101 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:101: upgrade_database: adding file_format column to PhotoTable");  #line 102 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp7_ = database_table_add_column ("PhotoTable", "file_format", "INTEGER DEFAULT 0"); -#line 102 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp7_) { +		if (!database_table_add_column ("PhotoTable", "file_format", "INTEGER DEFAULT 0")) {  #line 103 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 103 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 445 "Db.c" +#line 436 "Db.c"  		}  	}  #line 106 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 4;  #line 113 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp8_ = database_table_has_column ("PhotoTable", "title"); -#line 113 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp8_) { -#line 454 "Db.c" -		gboolean _tmp9_; +	if (!database_table_has_column ("PhotoTable", "title")) {  #line 114 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:114: upgrade_database: adding title column to PhotoTable");  #line 115 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp9_ = database_table_add_column ("PhotoTable", "title", "TEXT"); -#line 115 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp9_) { +		if (!database_table_add_column ("PhotoTable", "title", "TEXT")) {  #line 116 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 116 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 466 "Db.c" +#line 451 "Db.c"  		}  	}  #line 119 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 5;  #line 126 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp10_ = database_table_has_column ("PhotoTable", "backlinks"); -#line 126 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp10_) { -#line 475 "Db.c" -		gboolean _tmp11_; +	if (!database_table_has_column ("PhotoTable", "backlinks")) {  #line 127 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:127: upgrade_database: adding backlinks column to PhotoTable");  #line 128 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp11_ = database_table_add_column ("PhotoTable", "backlinks", "TEXT"); -#line 128 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp11_) { +		if (!database_table_add_column ("PhotoTable", "backlinks", "TEXT")) {  #line 129 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 129 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 487 "Db.c" +#line 466 "Db.c"  		}  	}  #line 132 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 6;  #line 146 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp12_ = database_table_has_column ("PhotoTable", "time_reimported"); -#line 146 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp12_) { -#line 496 "Db.c" -		gboolean _tmp13_; +	if (!database_table_has_column ("PhotoTable", "time_reimported")) {  #line 147 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:147: upgrade_database: adding time_reimported column to PhotoT" \  "able");  #line 148 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp13_ = database_table_add_column ("PhotoTable", "time_reimported", "INTEGER"); -#line 148 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp13_) { +		if (!database_table_add_column ("PhotoTable", "time_reimported", "INTEGER")) {  #line 149 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 149 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 508 "Db.c" +#line 481 "Db.c"  		}  	}  #line 152 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp14_ = database_table_has_column ("PhotoTable", "editable_id"); -#line 152 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp14_) { -#line 515 "Db.c" -		gboolean _tmp15_; +	if (!database_table_has_column ("PhotoTable", "editable_id")) {  #line 153 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:153: upgrade_database: adding editable_id column to PhotoTable");  #line 154 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp15_ = database_table_add_column ("PhotoTable", "editable_id", "INTEGER DEFAULT -1"); -#line 154 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp15_) { +		if (!database_table_add_column ("PhotoTable", "editable_id", "INTEGER DEFAULT -1")) {  #line 155 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 155 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 527 "Db.c" +#line 494 "Db.c"  		}  	}  #line 158 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 7;  #line 170 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp16_ = database_table_has_column ("PhotoTable", "rating"); -#line 170 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp16_) { -#line 536 "Db.c" -		gboolean _tmp17_; +	if (!database_table_has_column ("PhotoTable", "rating")) {  #line 171 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:171: upgrade_database: adding rating column to PhotoTable");  #line 172 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp17_ = database_table_add_column ("PhotoTable", "rating", "INTEGER DEFAULT 0"); -#line 172 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp17_) { +		if (!database_table_add_column ("PhotoTable", "rating", "INTEGER DEFAULT 0")) {  #line 173 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 173 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 548 "Db.c" +#line 509 "Db.c"  		}  	}  #line 182 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp18_ = database_table_has_column ("PhotoTable", "metadata_dirty"); -#line 182 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp18_) { -#line 555 "Db.c" -		gboolean _tmp19_; +	if (!database_table_has_column ("PhotoTable", "metadata_dirty")) {  #line 183 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:183: upgrade_database: adding metadata_dirty column to PhotoTa" \  "ble");  #line 184 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp19_ = database_table_add_column ("PhotoTable", "metadata_dirty", "INTEGER DEFAULT 1"); -#line 184 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp19_) { +		if (!database_table_add_column ("PhotoTable", "metadata_dirty", "INTEGER DEFAULT 1")) {  #line 185 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 185 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 567 "Db.c" +#line 522 "Db.c"  		}  	}  #line 188 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 9;  #line 195 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp21_ = database_table_has_table ("VideoTable"); -#line 195 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp21_) { -#line 576 "Db.c" -		gboolean _tmp22_; -#line 195 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp22_ = database_table_has_column ("VideoTable", "flags"); +	if (database_table_has_table ("VideoTable")) {  #line 195 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp20_ = !_tmp22_; -#line 582 "Db.c" +		_tmp2_ = !database_table_has_column ("VideoTable", "flags"); +#line 531 "Db.c"  	} else {  #line 195 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp20_ = FALSE; -#line 586 "Db.c" +		_tmp2_ = FALSE; +#line 535 "Db.c"  	}  #line 195 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp20_) { -#line 590 "Db.c" -		gboolean _tmp23_; +	if (_tmp2_) {  #line 196 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:196: upgrade_database: adding flags column to VideoTable");  #line 197 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp23_ = database_table_add_column ("VideoTable", "flags", "INTEGER DEFAULT 0"); -#line 197 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp23_) { +		if (!database_table_add_column ("VideoTable", "flags", "INTEGER DEFAULT 0")) {  #line 198 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 198 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 602 "Db.c" +#line 547 "Db.c"  		}  	}  #line 201 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 10;  #line 208 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp24_ = database_table_has_column ("EventTable", "primary_source_id"); -#line 208 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp24_) { -#line 611 "Db.c" -		gboolean _tmp25_; +	if (!database_table_has_column ("EventTable", "primary_source_id")) {  #line 209 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:209: upgrade_database: adding primary_source_id column to Even" \  "tTable");  #line 210 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp25_ = database_table_add_column ("EventTable", "primary_source_id", "TEXT"); -#line 210 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp25_) { +		if (!database_table_add_column ("EventTable", "primary_source_id", "TEXT")) {  #line 211 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 211 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 623 "Db.c" +#line 562 "Db.c"  		}  	}  #line 214 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 11;  #line 221 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp26_ = database_table_ensure_column ("TombstoneTable", "reason", "INTEGER DEFAULT 0", "upgrade_database: adding reason column to TombstoneTable"); -#line 221 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp26_) { +	if (!database_table_ensure_column ("TombstoneTable", "reason", "INTEGER DEFAULT 0", "upgrade_database: adding reason column to TombstoneTable")) {  #line 223 "/home/jens/Source/shotwell/src/db/Db.vala"  		result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 223 "/home/jens/Source/shotwell/src/db/Db.vala"  		return result; -#line 636 "Db.c" +#line 573 "Db.c"  	}  #line 226 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 12;  #line 233 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp27_ = database_table_has_column ("PhotoTable", "developer"); -#line 233 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp27_) { -#line 644 "Db.c" -		gboolean _tmp28_; +	if (!database_table_has_column ("PhotoTable", "developer")) {  #line 234 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:234: upgrade_database: adding developer column to PhotoTable");  #line 235 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp28_ = database_table_add_column ("PhotoTable", "developer", "TEXT"); -#line 235 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp28_) { +		if (!database_table_add_column ("PhotoTable", "developer", "TEXT")) {  #line 236 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 236 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 656 "Db.c" +#line 587 "Db.c"  		}  	}  #line 239 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp29_ = database_table_has_column ("PhotoTable", "develop_shotwell_id"); -#line 239 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp29_) { -#line 663 "Db.c" -		gboolean _tmp30_; +	if (!database_table_has_column ("PhotoTable", "develop_shotwell_id")) {  #line 240 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:240: upgrade_database: adding develop_shotwell_id column to Ph" \  "otoTable");  #line 241 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp30_ = database_table_add_column ("PhotoTable", "develop_shotwell_id", "INTEGER DEFAULT -1"); -#line 241 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp30_) { +		if (!database_table_add_column ("PhotoTable", "develop_shotwell_id", "INTEGER DEFAULT -1")) {  #line 242 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 242 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 675 "Db.c" +#line 600 "Db.c"  		}  	}  #line 245 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp31_ = database_table_has_column ("PhotoTable", "develop_camera_id"); -#line 245 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp31_) { -#line 682 "Db.c" -		gboolean _tmp32_; +	if (!database_table_has_column ("PhotoTable", "develop_camera_id")) {  #line 246 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:246: upgrade_database: adding develop_camera_id column to Phot" \  "oTable");  #line 247 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp32_ = database_table_add_column ("PhotoTable", "develop_camera_id", "INTEGER DEFAULT -1"); -#line 247 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp32_) { +		if (!database_table_add_column ("PhotoTable", "develop_camera_id", "INTEGER DEFAULT -1")) {  #line 248 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 248 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 694 "Db.c" +#line 613 "Db.c"  		}  	}  #line 251 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp33_ = database_table_has_column ("PhotoTable", "develop_embedded_id"); -#line 251 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp33_) { -#line 701 "Db.c" -		gboolean _tmp34_; +	if (!database_table_has_column ("PhotoTable", "develop_embedded_id")) {  #line 252 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:252: upgrade_database: adding develop_embedded_id column to Ph" \  "otoTable");  #line 253 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp34_ = database_table_add_column ("PhotoTable", "develop_embedded_id", "INTEGER DEFAULT -1"); -#line 253 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp34_) { +		if (!database_table_add_column ("PhotoTable", "develop_embedded_id", "INTEGER DEFAULT -1")) {  #line 254 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 254 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 713 "Db.c" +#line 626 "Db.c"  		}  	}  #line 257 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 13;  #line 264 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp35_ = input_version; -#line 264 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp35_ < 14) { +	if (input_version < 14) {  #line 265 "/home/jens/Source/shotwell/src/db/Db.vala"  		tag_table_upgrade_for_htags (); -#line 724 "Db.c" +#line 635 "Db.c"  	}  #line 267 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 14;  #line 279 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 15;  #line 289 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp36_ = input_version; -#line 289 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp36_ < 16) { +	if (input_version < 16) {  #line 292 "/home/jens/Source/shotwell/src/db/Db.vala"  		gsettings_configuration_engine_run_gsettings_migrator (); -#line 736 "Db.c" +#line 645 "Db.c"  	}  #line 295 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 16;  #line 302 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp37_ = database_table_has_column ("PhotoTable", "comment"); -#line 302 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp37_) { -#line 744 "Db.c" -		gboolean _tmp38_; +	if (!database_table_has_column ("PhotoTable", "comment")) {  #line 303 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:303: upgrade_database: adding comment column to PhotoTable");  #line 304 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp38_ = database_table_add_column ("PhotoTable", "comment", "TEXT"); -#line 304 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp38_) { +		if (!database_table_add_column ("PhotoTable", "comment", "TEXT")) {  #line 305 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 305 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 756 "Db.c" +#line 659 "Db.c"  		}  	}  #line 307 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp39_ = database_table_has_table ("VideoTable"); -#line 307 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp40_ = database_table_has_column ("VideoTable", "comment"); -#line 307 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp39_ & (!_tmp40_)) { -#line 765 "Db.c" -		gboolean _tmp41_; +	if (database_table_has_table ("VideoTable") & (!database_table_has_column ("VideoTable", "comment"))) {  #line 308 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:308: upgrade_database: adding comment column to VideoTable");  #line 309 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp41_ = database_table_add_column ("VideoTable", "comment", "TEXT"); -#line 309 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp41_) { +		if (!database_table_add_column ("VideoTable", "comment", "TEXT")) {  #line 310 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 310 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 777 "Db.c" +#line 672 "Db.c"  		}  	}  #line 313 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 17;  #line 320 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp42_ = database_table_has_column ("EventTable", "comment"); -#line 320 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (!_tmp42_) { -#line 786 "Db.c" -		gboolean _tmp43_; +	if (!database_table_has_column ("EventTable", "comment")) {  #line 321 "/home/jens/Source/shotwell/src/db/Db.vala"  		g_message ("Db.vala:321: upgrade_database: adding comment column to EventTable");  #line 322 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp43_ = database_table_add_column ("EventTable", "comment", "TEXT"); -#line 322 "/home/jens/Source/shotwell/src/db/Db.vala" -		if (!_tmp43_) { +		if (!database_table_add_column ("EventTable", "comment", "TEXT")) {  #line 323 "/home/jens/Source/shotwell/src/db/Db.vala"  			result = DB_VERIFY_RESULT_UPGRADE_ERROR;  #line 323 "/home/jens/Source/shotwell/src/db/Db.vala"  			return result; -#line 798 "Db.c" +#line 687 "Db.c"  		}  	}  #line 326 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 18;  #line 337 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp44_ = input_version; -#line 337 "/home/jens/Source/shotwell/src/db/Db.vala" -	if (_tmp44_ < 19) { -#line 807 "Db.c" -		Application* _tmp45_; -		Application* _tmp46_; +	if (input_version < 19) { +#line 694 "Db.c" +		Application* _tmp3_; +		Application* _tmp4_;  #line 338 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp45_ = application_get_instance (); +		_tmp3_ = application_get_instance ();  #line 338 "/home/jens/Source/shotwell/src/db/Db.vala" -		_tmp46_ = _tmp45_; +		_tmp4_ = _tmp3_;  #line 338 "/home/jens/Source/shotwell/src/db/Db.vala" -		application_set_raw_thumbs_fix_required (_tmp46_, TRUE); +		application_set_raw_thumbs_fix_required (_tmp4_, TRUE);  #line 338 "/home/jens/Source/shotwell/src/db/Db.vala" -		_application_unref0 (_tmp46_); -#line 818 "Db.c" +		_application_unref0 (_tmp4_); +#line 705 "Db.c"  	}  #line 341 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 19;  #line 351 "/home/jens/Source/shotwell/src/db/Db.vala"  	version = 20;  #line 357 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp47_ = version; +	_tmp5_ = version;  #line 357 "/home/jens/Source/shotwell/src/db/Db.vala" -	_vala_assert (_tmp47_ == DATABASE_TABLE_SCHEMA_VERSION, "version == DatabaseTable.SCHEMA_VERSION"); +	_vala_assert (_tmp5_ == DATABASE_TABLE_SCHEMA_VERSION, "version == DatabaseTable.SCHEMA_VERSION");  #line 358 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp48_ = version_table_get_instance (); +	_tmp6_ = version_table_get_instance ();  #line 358 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp49_ = _tmp48_; +	_tmp7_ = _tmp6_;  #line 358 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp50_ = version; +	_tmp8_ = version;  #line 358 "/home/jens/Source/shotwell/src/db/Db.vala" -	version_table_update_version (_tmp49_, _tmp50_, RESOURCES_APP_VERSION); +	version_table_update_version (_tmp7_, _tmp8_, RESOURCES_APP_VERSION);  #line 358 "/home/jens/Source/shotwell/src/db/Db.vala" -	_database_table_unref0 (_tmp49_); +	_database_table_unref0 (_tmp7_);  #line 360 "/home/jens/Source/shotwell/src/db/Db.vala" -	_tmp51_ = version; +	_tmp9_ = version;  #line 360 "/home/jens/Source/shotwell/src/db/Db.vala" -	g_message ("Db.vala:360: Database upgrade to schema version %d successful", _tmp51_); +	g_message ("Db.vala:360: Database upgrade to schema version %d successful", _tmp9_);  #line 362 "/home/jens/Source/shotwell/src/db/Db.vala"  	result = DB_VERIFY_RESULT_OK;  #line 362 "/home/jens/Source/shotwell/src/db/Db.vala"  	return result; -#line 846 "Db.c" +#line 733 "Db.c"  } | 
