summaryrefslogtreecommitdiff
path: root/src/db/Db.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/Db.c')
-rw-r--r--src/db/Db.c155
1 files changed, 79 insertions, 76 deletions
diff --git a/src/db/Db.c b/src/db/Db.c
index 0695500..b5200cf 100644
--- a/src/db/Db.c
+++ b/src/db/Db.c
@@ -374,13 +374,14 @@ DbVerifyResult db_upgrade_database (gint input_version) {
gint _tmp36_;
gboolean _tmp37_;
gboolean _tmp39_;
- gboolean _tmp41_;
- gint _tmp43_;
- gint _tmp46_;
- VersionTable* _tmp47_;
+ gboolean _tmp40_;
+ gboolean _tmp42_;
+ gint _tmp44_;
+ gint _tmp47_;
VersionTable* _tmp48_;
- gint _tmp49_;
+ VersionTable* _tmp49_;
gint _tmp50_;
+ gint _tmp51_;
#line 63 "/home/jens/Source/shotwell/src/db/Db.vala"
_tmp0_ = input_version;
#line 63 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -397,7 +398,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_NO_UPGRADE_AVAILABLE;
#line 69 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 401 "Db.c"
+#line 402 "Db.c"
}
#line 71 "/home/jens/Source/shotwell/src/db/Db.vala"
_tmp3_ = version;
@@ -407,7 +408,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp4_ = database_table_has_column ("PhotoTable", "flags");
#line 83 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp4_) {
-#line 411 "Db.c"
+#line 412 "Db.c"
gboolean _tmp5_;
#line 84 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:84: upgrade_database: adding flags column to PhotoTable");
@@ -419,7 +420,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 86 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 423 "Db.c"
+#line 424 "Db.c"
}
}
#line 89 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -428,7 +429,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp6_ = database_table_has_column ("PhotoTable", "file_format");
#line 100 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp6_) {
-#line 432 "Db.c"
+#line 433 "Db.c"
gboolean _tmp7_;
#line 101 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:101: upgrade_database: adding file_format column to PhotoTable");
@@ -440,7 +441,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 103 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 444 "Db.c"
+#line 445 "Db.c"
}
}
#line 106 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -449,7 +450,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp8_ = database_table_has_column ("PhotoTable", "title");
#line 113 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp8_) {
-#line 453 "Db.c"
+#line 454 "Db.c"
gboolean _tmp9_;
#line 114 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:114: upgrade_database: adding title column to PhotoTable");
@@ -461,7 +462,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 116 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 465 "Db.c"
+#line 466 "Db.c"
}
}
#line 119 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -470,7 +471,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp10_ = database_table_has_column ("PhotoTable", "backlinks");
#line 126 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp10_) {
-#line 474 "Db.c"
+#line 475 "Db.c"
gboolean _tmp11_;
#line 127 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:127: upgrade_database: adding backlinks column to PhotoTable");
@@ -482,7 +483,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 129 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 486 "Db.c"
+#line 487 "Db.c"
}
}
#line 132 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -491,7 +492,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp12_ = database_table_has_column ("PhotoTable", "time_reimported");
#line 146 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp12_) {
-#line 495 "Db.c"
+#line 496 "Db.c"
gboolean _tmp13_;
#line 147 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:147: upgrade_database: adding time_reimported column to PhotoT" \
@@ -504,14 +505,14 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 149 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 507 "Db.c"
+#line 508 "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 514 "Db.c"
+#line 515 "Db.c"
gboolean _tmp15_;
#line 153 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:153: upgrade_database: adding editable_id column to PhotoTable");
@@ -523,7 +524,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 155 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 526 "Db.c"
+#line 527 "Db.c"
}
}
#line 158 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -532,7 +533,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp16_ = database_table_has_column ("PhotoTable", "rating");
#line 170 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp16_) {
-#line 535 "Db.c"
+#line 536 "Db.c"
gboolean _tmp17_;
#line 171 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:171: upgrade_database: adding rating column to PhotoTable");
@@ -544,14 +545,14 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 173 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 547 "Db.c"
+#line 548 "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 554 "Db.c"
+#line 555 "Db.c"
gboolean _tmp19_;
#line 183 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:183: upgrade_database: adding metadata_dirty column to PhotoTa" \
@@ -564,7 +565,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 185 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 566 "Db.c"
+#line 567 "Db.c"
}
}
#line 188 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -573,21 +574,21 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp21_ = database_table_has_table ("VideoTable");
#line 195 "/home/jens/Source/shotwell/src/db/Db.vala"
if (_tmp21_) {
-#line 575 "Db.c"
+#line 576 "Db.c"
gboolean _tmp22_;
#line 195 "/home/jens/Source/shotwell/src/db/Db.vala"
_tmp22_ = database_table_has_column ("VideoTable", "flags");
#line 195 "/home/jens/Source/shotwell/src/db/Db.vala"
_tmp20_ = !_tmp22_;
-#line 581 "Db.c"
+#line 582 "Db.c"
} else {
#line 195 "/home/jens/Source/shotwell/src/db/Db.vala"
_tmp20_ = FALSE;
-#line 585 "Db.c"
+#line 586 "Db.c"
}
#line 195 "/home/jens/Source/shotwell/src/db/Db.vala"
if (_tmp20_) {
-#line 589 "Db.c"
+#line 590 "Db.c"
gboolean _tmp23_;
#line 196 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:196: upgrade_database: adding flags column to VideoTable");
@@ -599,7 +600,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 198 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 601 "Db.c"
+#line 602 "Db.c"
}
}
#line 201 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -608,20 +609,20 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp24_ = database_table_has_column ("EventTable", "primary_source_id");
#line 208 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp24_) {
-#line 610 "Db.c"
+#line 611 "Db.c"
gboolean _tmp25_;
#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", "INTEGER DEFAULT 0");
+ _tmp25_ = database_table_add_column ("EventTable", "primary_source_id", "TEXT");
#line 210 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp25_) {
#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 622 "Db.c"
+#line 623 "Db.c"
}
}
#line 214 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -634,7 +635,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 223 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 635 "Db.c"
+#line 636 "Db.c"
}
#line 226 "/home/jens/Source/shotwell/src/db/Db.vala"
version = 12;
@@ -642,7 +643,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp27_ = database_table_has_column ("PhotoTable", "developer");
#line 233 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp27_) {
-#line 643 "Db.c"
+#line 644 "Db.c"
gboolean _tmp28_;
#line 234 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:234: upgrade_database: adding developer column to PhotoTable");
@@ -654,14 +655,14 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 236 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 655 "Db.c"
+#line 656 "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 662 "Db.c"
+#line 663 "Db.c"
gboolean _tmp30_;
#line 240 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:240: upgrade_database: adding develop_shotwell_id column to Ph" \
@@ -674,14 +675,14 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 242 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 674 "Db.c"
+#line 675 "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 681 "Db.c"
+#line 682 "Db.c"
gboolean _tmp32_;
#line 246 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:246: upgrade_database: adding develop_camera_id column to Phot" \
@@ -694,14 +695,14 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 248 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 693 "Db.c"
+#line 694 "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 700 "Db.c"
+#line 701 "Db.c"
gboolean _tmp34_;
#line 252 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:252: upgrade_database: adding develop_embedded_id column to Ph" \
@@ -714,7 +715,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 254 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 712 "Db.c"
+#line 713 "Db.c"
}
}
#line 257 "/home/jens/Source/shotwell/src/db/Db.vala"
@@ -725,7 +726,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
if (_tmp35_ < 14) {
#line 265 "/home/jens/Source/shotwell/src/db/Db.vala"
tag_table_upgrade_for_htags ();
-#line 723 "Db.c"
+#line 724 "Db.c"
}
#line 267 "/home/jens/Source/shotwell/src/db/Db.vala"
version = 14;
@@ -737,7 +738,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
if (_tmp36_ < 16) {
#line 292 "/home/jens/Source/shotwell/src/db/Db.vala"
gsettings_configuration_engine_run_gsettings_migrator ();
-#line 735 "Db.c"
+#line 736 "Db.c"
}
#line 295 "/home/jens/Source/shotwell/src/db/Db.vala"
version = 16;
@@ -745,7 +746,7 @@ DbVerifyResult db_upgrade_database (gint input_version) {
_tmp37_ = database_table_has_column ("PhotoTable", "comment");
#line 302 "/home/jens/Source/shotwell/src/db/Db.vala"
if (!_tmp37_) {
-#line 743 "Db.c"
+#line 744 "Db.c"
gboolean _tmp38_;
#line 303 "/home/jens/Source/shotwell/src/db/Db.vala"
g_message ("Db.vala:303: upgrade_database: adding comment column to PhotoTable");
@@ -757,95 +758,97 @@ DbVerifyResult db_upgrade_database (gint input_version) {
result = DB_VERIFY_RESULT_UPGRADE_ERROR;
#line 305 "/home/jens/Source/shotwell/src/db/Db.vala"
return result;
-#line 755 "Db.c"
+#line 756 "Db.c"
}
}
#line 307 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp39_ = database_table_has_column ("VideoTable", "comment");
+ _tmp39_ = database_table_has_table ("VideoTable");
#line 307 "/home/jens/Source/shotwell/src/db/Db.vala"
- if (!_tmp39_) {
-#line 762 "Db.c"
- gboolean _tmp40_;
+ _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_;
#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"
- _tmp40_ = database_table_add_column ("VideoTable", "comment", "TEXT");
+ _tmp41_ = database_table_add_column ("VideoTable", "comment", "TEXT");
#line 309 "/home/jens/Source/shotwell/src/db/Db.vala"
- if (!_tmp40_) {
+ if (!_tmp41_) {
#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 774 "Db.c"
+#line 777 "Db.c"
}
}
#line 313 "/home/jens/Source/shotwell/src/db/Db.vala"
version = 17;
#line 320 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp41_ = database_table_has_column ("EventTable", "comment");
+ _tmp42_ = database_table_has_column ("EventTable", "comment");
#line 320 "/home/jens/Source/shotwell/src/db/Db.vala"
- if (!_tmp41_) {
-#line 783 "Db.c"
- gboolean _tmp42_;
+ if (!_tmp42_) {
+#line 786 "Db.c"
+ gboolean _tmp43_;
#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"
- _tmp42_ = database_table_add_column ("EventTable", "comment", "TEXT");
+ _tmp43_ = database_table_add_column ("EventTable", "comment", "TEXT");
#line 322 "/home/jens/Source/shotwell/src/db/Db.vala"
- if (!_tmp42_) {
+ if (!_tmp43_) {
#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 795 "Db.c"
+#line 798 "Db.c"
}
}
#line 326 "/home/jens/Source/shotwell/src/db/Db.vala"
version = 18;
#line 337 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp43_ = input_version;
+ _tmp44_ = input_version;
#line 337 "/home/jens/Source/shotwell/src/db/Db.vala"
- if (_tmp43_ < 19) {
-#line 804 "Db.c"
- Application* _tmp44_;
+ if (_tmp44_ < 19) {
+#line 807 "Db.c"
Application* _tmp45_;
+ Application* _tmp46_;
#line 338 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp44_ = application_get_instance ();
+ _tmp45_ = application_get_instance ();
#line 338 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp45_ = _tmp44_;
+ _tmp46_ = _tmp45_;
#line 338 "/home/jens/Source/shotwell/src/db/Db.vala"
- application_set_raw_thumbs_fix_required (_tmp45_, TRUE);
+ application_set_raw_thumbs_fix_required (_tmp46_, TRUE);
#line 338 "/home/jens/Source/shotwell/src/db/Db.vala"
- _application_unref0 (_tmp45_);
-#line 815 "Db.c"
+ _application_unref0 (_tmp46_);
+#line 818 "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"
- _tmp46_ = version;
+ _tmp47_ = version;
#line 357 "/home/jens/Source/shotwell/src/db/Db.vala"
- _vala_assert (_tmp46_ == DATABASE_TABLE_SCHEMA_VERSION, "version == DatabaseTable.SCHEMA_VERSION");
+ _vala_assert (_tmp47_ == DATABASE_TABLE_SCHEMA_VERSION, "version == DatabaseTable.SCHEMA_VERSION");
#line 358 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp47_ = version_table_get_instance ();
+ _tmp48_ = version_table_get_instance ();
#line 358 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp48_ = _tmp47_;
+ _tmp49_ = _tmp48_;
#line 358 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp49_ = version;
+ _tmp50_ = version;
#line 358 "/home/jens/Source/shotwell/src/db/Db.vala"
- version_table_update_version (_tmp48_, _tmp49_, RESOURCES_APP_VERSION);
+ version_table_update_version (_tmp49_, _tmp50_, RESOURCES_APP_VERSION);
#line 358 "/home/jens/Source/shotwell/src/db/Db.vala"
- _database_table_unref0 (_tmp48_);
+ _database_table_unref0 (_tmp49_);
#line 360 "/home/jens/Source/shotwell/src/db/Db.vala"
- _tmp50_ = version;
+ _tmp51_ = version;
#line 360 "/home/jens/Source/shotwell/src/db/Db.vala"
- g_message ("Db.vala:360: Database upgrade to schema version %d successful", _tmp50_);
+ g_message ("Db.vala:360: Database upgrade to schema version %d successful", _tmp51_);
#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 843 "Db.c"
+#line 846 "Db.c"
}