1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
|
/* TagTable.c generated by valac 0.34.7, the Vala compiler
* generated from TagTable.vala, do not modify */
/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
#include <glib.h>
#include <glib-object.h>
#include <string.h>
#include <stdlib.h>
#include <gee.h>
#include <time.h>
#include <sqlite3.h>
#include <gobject/gvaluecollector.h>
#define TYPE_TAG_ID (tag_id_get_type ())
typedef struct _TagID TagID;
#define TYPE_TAG_ROW (tag_row_get_type ())
#define TAG_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_ROW, TagRow))
#define TAG_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_ROW, TagRowClass))
#define IS_TAG_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_ROW))
#define IS_TAG_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_ROW))
#define TAG_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_ROW, TagRowClass))
typedef struct _TagRow TagRow;
typedef struct _TagRowClass TagRowClass;
typedef struct _TagRowPrivate TagRowPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ParamSpecTagRow ParamSpecTagRow;
#define TYPE_DATABASE_TABLE (database_table_get_type ())
#define DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_TABLE, DatabaseTable))
#define DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_TABLE, DatabaseTableClass))
#define IS_DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_TABLE))
#define IS_DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_TABLE))
#define DATABASE_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_TABLE, DatabaseTableClass))
typedef struct _DatabaseTable DatabaseTable;
typedef struct _DatabaseTableClass DatabaseTableClass;
typedef struct _DatabaseTablePrivate DatabaseTablePrivate;
#define TYPE_TAG_TABLE (tag_table_get_type ())
#define TAG_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_TABLE, TagTable))
#define TAG_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_TABLE, TagTableClass))
#define IS_TAG_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_TABLE))
#define IS_TAG_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_TABLE))
#define TAG_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_TABLE, TagTableClass))
typedef struct _TagTable TagTable;
typedef struct _TagTableClass TagTableClass;
typedef struct _TagTablePrivate TagTablePrivate;
#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
#define _database_table_unref0(var) ((var == NULL) ? NULL : (var = (database_table_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _tag_row_unref0(var) ((var == NULL) ? NULL : (var = (tag_row_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define TYPE_PHOTO_ID (photo_id_get_type ())
typedef struct _PhotoID PhotoID;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
struct _TagID {
gint64 id;
};
struct _TagRow {
GTypeInstance parent_instance;
volatile int ref_count;
TagRowPrivate * priv;
TagID tag_id;
gchar* name;
GeeSet* source_id_list;
time_t time_created;
};
struct _TagRowClass {
GTypeClass parent_class;
void (*finalize) (TagRow *self);
};
struct _ParamSpecTagRow {
GParamSpec parent_instance;
};
struct _DatabaseTable {
GTypeInstance parent_instance;
volatile int ref_count;
DatabaseTablePrivate * priv;
gchar* table_name;
};
struct _DatabaseTableClass {
GTypeClass parent_class;
void (*finalize) (DatabaseTable *self);
};
struct _TagTable {
DatabaseTable parent_instance;
TagTablePrivate * priv;
};
struct _TagTableClass {
DatabaseTableClass parent_class;
};
typedef enum {
DATABASE_ERROR_ERROR,
DATABASE_ERROR_BACKING,
DATABASE_ERROR_MEMORY,
DATABASE_ERROR_ABORT,
DATABASE_ERROR_LIMITS,
DATABASE_ERROR_TYPESPEC
} DatabaseError;
#define DATABASE_ERROR database_error_quark ()
struct _PhotoID {
gint64 id;
};
static gpointer tag_row_parent_class = NULL;
static gpointer tag_table_parent_class = NULL;
static TagTable* tag_table_instance;
static TagTable* tag_table_instance = NULL;
extern sqlite3* database_table_db;
GType tag_id_get_type (void) G_GNUC_CONST;
TagID* tag_id_dup (const TagID* self);
void tag_id_free (TagID* self);
#define TAG_ID_INVALID ((gint64) -1)
void tag_id_init (TagID *self, gint64 id);
gboolean tag_id_is_invalid (TagID *self);
gboolean tag_id_is_valid (TagID *self);
gpointer tag_row_ref (gpointer instance);
void tag_row_unref (gpointer instance);
GParamSpec* param_spec_tag_row (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_tag_row (GValue* value, gpointer v_object);
void value_take_tag_row (GValue* value, gpointer v_object);
gpointer value_get_tag_row (const GValue* value);
GType tag_row_get_type (void) G_GNUC_CONST;
enum {
TAG_ROW_DUMMY_PROPERTY
};
TagRow* tag_row_new (void);
TagRow* tag_row_construct (GType object_type);
static void tag_row_finalize (TagRow* obj);
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);
gpointer value_get_database_table (const GValue* value);
GType database_table_get_type (void) G_GNUC_CONST;
GType tag_table_get_type (void) G_GNUC_CONST;
enum {
TAG_TABLE_DUMMY_PROPERTY
};
static TagTable* tag_table_new (void);
static TagTable* tag_table_construct (GType object_type);
DatabaseTable* database_table_construct (GType object_type);
void database_table_set_table_name (DatabaseTable* self, const gchar* table_name);
void database_table_fatal (const gchar* op, gint res);
TagTable* tag_table_get_instance (void);
void tag_table_upgrade_for_htags (void);
GQuark database_error_quark (void);
GeeList* tag_table_get_all_rows (TagTable* self, GError** error);
#define TAG_PATH_SEPARATOR_STRING "/"
void tag_table_rename (TagTable* self, TagID* tag_id, const gchar* new_name, GError** error);
TagRow* tag_table_add (TagTable* self, const gchar* name, GError** error);
gulong now_sec (void);
void database_table_throw_error (const gchar* method, gint res, GError** error);
void tag_table_create_from_row (TagTable* self, TagRow* row, TagID* result, GError** error);
static gchar* tag_table_serialize_source_ids (TagTable* self, GeeCollection* source_ids);
void tag_table_remove (TagTable* self, TagID* tag_id, GError** error);
void database_table_delete_by_id (DatabaseTable* self, gint64 id, GError** error);
gchar* tag_table_get_name (TagTable* self, TagID* tag_id, GError** error);
gboolean database_table_select_by_id (DatabaseTable* self, gint64 id, const gchar* columns, sqlite3_stmt** stmt);
TagRow* tag_table_get_row (TagTable* self, TagID* tag_id, GError** error);
static GeeSet* tag_table_unserialize_source_ids (TagTable* self, const gchar* text_list);
void database_table_update_text_by_id_2 (DatabaseTable* self, gint64 id, const gchar* column, const gchar* text, GError** error);
void tag_table_set_tagged_sources (TagTable* self, TagID* tag_id, GeeCollection* source_ids, GError** error);
gboolean is_string_empty (const gchar* s);
GType photo_id_get_type (void) G_GNUC_CONST;
PhotoID* photo_id_dup (const PhotoID* self);
void photo_id_free (PhotoID* self);
gchar* photo_id_upgrade_photo_id_to_source_id (PhotoID* photo_id);
gint64 parse_int64 (const gchar* str, gint num_base);
void photo_id_init (PhotoID *self, gint64 id);
static void tag_table_finalize (DatabaseTable* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);
void tag_id_init (TagID *self, gint64 id) {
gint64 _tmp0_ = 0LL;
#line 12 "/home/jens/Source/shotwell/src/db/TagTable.vala"
memset (self, 0, sizeof (TagID));
#line 13 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = id;
#line 13 "/home/jens/Source/shotwell/src/db/TagTable.vala"
(*self).id = _tmp0_;
#line 213 "TagTable.c"
}
gboolean tag_id_is_invalid (TagID *self) {
gboolean result = FALSE;
gint64 _tmp0_ = 0LL;
#line 17 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = (*self).id;
#line 17 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _tmp0_ == TAG_ID_INVALID;
#line 17 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 226 "TagTable.c"
}
gboolean tag_id_is_valid (TagID *self) {
gboolean result = FALSE;
gint64 _tmp0_ = 0LL;
#line 21 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = (*self).id;
#line 21 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _tmp0_ != TAG_ID_INVALID;
#line 21 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 239 "TagTable.c"
}
TagID* tag_id_dup (const TagID* self) {
TagID* dup;
#line 7 "/home/jens/Source/shotwell/src/db/TagTable.vala"
dup = g_new0 (TagID, 1);
#line 7 "/home/jens/Source/shotwell/src/db/TagTable.vala"
memcpy (dup, self, sizeof (TagID));
#line 7 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return dup;
#line 251 "TagTable.c"
}
void tag_id_free (TagID* self) {
#line 7 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_free (self);
#line 258 "TagTable.c"
}
GType tag_id_get_type (void) {
static volatile gsize tag_id_type_id__volatile = 0;
if (g_once_init_enter (&tag_id_type_id__volatile)) {
GType tag_id_type_id;
tag_id_type_id = g_boxed_type_register_static ("TagID", (GBoxedCopyFunc) tag_id_dup, (GBoxedFreeFunc) tag_id_free);
g_once_init_leave (&tag_id_type_id__volatile, tag_id_type_id);
}
return tag_id_type_id__volatile;
}
TagRow* tag_row_construct (GType object_type) {
TagRow* self = NULL;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
self = (TagRow*) g_type_create_instance (object_type);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return self;
#line 279 "TagTable.c"
}
TagRow* tag_row_new (void) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return tag_row_construct (TYPE_TAG_ROW);
#line 286 "TagTable.c"
}
static void value_tag_row_init (GValue* value) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = NULL;
#line 293 "TagTable.c"
}
static void value_tag_row_free_value (GValue* value) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (value->data[0].v_pointer) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_row_unref (value->data[0].v_pointer);
#line 302 "TagTable.c"
}
}
static void value_tag_row_copy_value (const GValue* src_value, GValue* dest_value) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (src_value->data[0].v_pointer) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
dest_value->data[0].v_pointer = tag_row_ref (src_value->data[0].v_pointer);
#line 312 "TagTable.c"
} else {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
dest_value->data[0].v_pointer = NULL;
#line 316 "TagTable.c"
}
}
static gpointer value_tag_row_peek_pointer (const GValue* value) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return value->data[0].v_pointer;
#line 324 "TagTable.c"
}
static gchar* value_tag_row_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (collect_values[0].v_pointer) {
#line 331 "TagTable.c"
TagRow* object;
object = collect_values[0].v_pointer;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (object->parent_instance.g_class == NULL) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 338 "TagTable.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 342 "TagTable.c"
}
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = tag_row_ref (object);
#line 346 "TagTable.c"
} else {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = NULL;
#line 350 "TagTable.c"
}
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 354 "TagTable.c"
}
static gchar* value_tag_row_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
TagRow** object_p;
object_p = collect_values[0].v_pointer;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (!object_p) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 365 "TagTable.c"
}
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (!value->data[0].v_pointer) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
*object_p = NULL;
#line 371 "TagTable.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
*object_p = value->data[0].v_pointer;
#line 375 "TagTable.c"
} else {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
*object_p = tag_row_ref (value->data[0].v_pointer);
#line 379 "TagTable.c"
}
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 383 "TagTable.c"
}
GParamSpec* param_spec_tag_row (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecTagRow* spec;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_TAG_ROW), NULL);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return G_PARAM_SPEC (spec);
#line 397 "TagTable.c"
}
gpointer value_get_tag_row (const GValue* value) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TAG_ROW), NULL);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return value->data[0].v_pointer;
#line 406 "TagTable.c"
}
void value_set_tag_row (GValue* value, gpointer v_object) {
TagRow* old;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TAG_ROW));
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
old = value->data[0].v_pointer;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (v_object) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TAG_ROW));
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = v_object;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_row_ref (value->data[0].v_pointer);
#line 426 "TagTable.c"
} else {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = NULL;
#line 430 "TagTable.c"
}
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (old) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_row_unref (old);
#line 436 "TagTable.c"
}
}
void value_take_tag_row (GValue* value, gpointer v_object) {
TagRow* old;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TAG_ROW));
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
old = value->data[0].v_pointer;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (v_object) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TAG_ROW));
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = v_object;
#line 455 "TagTable.c"
} else {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
value->data[0].v_pointer = NULL;
#line 459 "TagTable.c"
}
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (old) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_row_unref (old);
#line 465 "TagTable.c"
}
}
static void tag_row_class_init (TagRowClass * klass) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_row_parent_class = g_type_class_peek_parent (klass);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
((TagRowClass *) klass)->finalize = tag_row_finalize;
#line 475 "TagTable.c"
}
static void tag_row_instance_init (TagRow * self) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
self->ref_count = 1;
#line 482 "TagTable.c"
}
static void tag_row_finalize (TagRow* obj) {
TagRow * self;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TAG_ROW, TagRow);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_signal_handlers_destroy (self);
#line 27 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (self->name);
#line 28 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (self->source_id_list);
#line 496 "TagTable.c"
}
GType tag_row_get_type (void) {
static volatile gsize tag_row_type_id__volatile = 0;
if (g_once_init_enter (&tag_row_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_tag_row_init, value_tag_row_free_value, value_tag_row_copy_value, value_tag_row_peek_pointer, "p", value_tag_row_collect_value, "p", value_tag_row_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (TagRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tag_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TagRow), 0, (GInstanceInitFunc) tag_row_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType tag_row_type_id;
tag_row_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TagRow", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&tag_row_type_id__volatile, tag_row_type_id);
}
return tag_row_type_id__volatile;
}
gpointer tag_row_ref (gpointer instance) {
TagRow* self;
self = instance;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_atomic_int_inc (&self->ref_count);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return instance;
#line 521 "TagTable.c"
}
void tag_row_unref (gpointer instance) {
TagRow* self;
self = instance;
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
TAG_ROW_GET_CLASS (self)->finalize (self);
#line 25 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_type_free_instance ((GTypeInstance *) self);
#line 534 "TagTable.c"
}
}
static TagTable* tag_table_construct (GType object_type) {
TagTable* self = NULL;
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
gint _tmp5_ = 0;
gint _tmp6_ = 0;
#line 35 "/home/jens/Source/shotwell/src/db/TagTable.vala"
self = (TagTable*) database_table_construct (object_type);
#line 36 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_set_table_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATABASE_TABLE, DatabaseTable), "TagTable");
#line 39 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = database_table_db;
#line 39 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "CREATE TABLE IF NOT EXISTS " "TagTable " "(" "id INTEGER PRIMARY KEY, " "name TEXT UNIQUE NOT NULL, " "photo_id_list TEXT, " "time_created INTEGER" ")", -1, &_tmp1_, NULL);
#line 39 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 39 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp1_;
#line 39 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp2_;
#line 47 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = res;
#line 47 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 49 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = stmt;
#line 49 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = sqlite3_step (_tmp4_);
#line 49 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp5_;
#line 50 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = res;
#line 50 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp6_ != SQLITE_DONE) {
#line 578 "TagTable.c"
gint _tmp7_ = 0;
#line 51 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = res;
#line 51 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_fatal ("create TagTable", _tmp7_);
#line 584 "TagTable.c"
}
#line 35 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 35 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return self;
#line 590 "TagTable.c"
}
static TagTable* tag_table_new (void) {
#line 35 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return tag_table_construct (TYPE_TAG_TABLE);
#line 597 "TagTable.c"
}
static gpointer _database_table_ref0 (gpointer self) {
#line 58 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return self ? database_table_ref (self) : NULL;
#line 604 "TagTable.c"
}
TagTable* tag_table_get_instance (void) {
TagTable* result = NULL;
TagTable* _tmp0_ = NULL;
TagTable* _tmp2_ = NULL;
TagTable* _tmp3_ = NULL;
#line 55 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = tag_table_instance;
#line 55 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp0_ == NULL) {
#line 617 "TagTable.c"
TagTable* _tmp1_ = NULL;
#line 56 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = tag_table_new ();
#line 56 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_database_table_unref0 (tag_table_instance);
#line 56 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_table_instance = _tmp1_;
#line 625 "TagTable.c"
}
#line 58 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = tag_table_instance;
#line 58 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = _database_table_ref0 (_tmp2_);
#line 58 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _tmp3_;
#line 58 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 635 "TagTable.c"
}
static gpointer _g_object_ref0 (gpointer self) {
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return self ? g_object_ref (self) : NULL;
#line 642 "TagTable.c"
}
static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
gchar* result = NULL;
GError * _inner_error_ = NULL;
#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, NULL);
#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_return_val_if_fail (old != NULL, NULL);
#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_return_val_if_fail (replacement != NULL, NULL);
#line 655 "TagTable.c"
{
GRegex* regex = NULL;
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
gchar* _tmp2_ = NULL;
GRegex* _tmp3_ = NULL;
GRegex* _tmp4_ = NULL;
gchar* _tmp5_ = NULL;
GRegex* _tmp6_ = NULL;
const gchar* _tmp7_ = NULL;
gchar* _tmp8_ = NULL;
gchar* _tmp9_ = NULL;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp0_ = old;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp1_ = g_regex_escape_string (_tmp0_, -1);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp2_ = _tmp1_;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp4_ = _tmp3_;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_g_free0 (_tmp2_);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
regex = _tmp4_;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
if (_inner_error_->domain == G_REGEX_ERROR) {
#line 686 "TagTable.c"
goto __catch21_g_regex_error;
}
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_clear_error (&_inner_error_);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return NULL;
#line 695 "TagTable.c"
}
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp6_ = regex;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp7_ = replacement;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) -1, 0, _tmp7_, 0, &_inner_error_);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp5_ = _tmp8_;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
if (_inner_error_->domain == G_REGEX_ERROR) {
#line 711 "TagTable.c"
goto __catch21_g_regex_error;
}
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_clear_error (&_inner_error_);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return NULL;
#line 722 "TagTable.c"
}
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp9_ = _tmp5_;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp5_ = NULL;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
result = _tmp9_;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_g_free0 (_tmp5_);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return result;
#line 736 "TagTable.c"
}
goto __finally21;
__catch21_g_regex_error:
{
GError* e = NULL;
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
e = _inner_error_;
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_inner_error_ = NULL;
#line 1385 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_assert_not_reached ();
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_g_error_free0 (e);
#line 750 "TagTable.c"
}
__finally21:
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_clear_error (&_inner_error_);
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return NULL;
#line 761 "TagTable.c"
}
}
void tag_table_upgrade_for_htags (void) {
TagTable* table = NULL;
TagTable* _tmp0_ = NULL;
GError * _inner_error_ = NULL;
#line 62 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = tag_table_get_instance ();
#line 62 "/home/jens/Source/shotwell/src/db/TagTable.vala"
table = _tmp0_;
#line 774 "TagTable.c"
{
GeeList* rows = NULL;
TagTable* _tmp1_ = NULL;
GeeList* _tmp2_ = NULL;
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = table;
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = tag_table_get_all_rows (_tmp1_, &_inner_error_);
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
rows = _tmp2_;
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 789 "TagTable.c"
goto __catch20_database_error;
}
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_database_table_unref0 (table);
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.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 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 65 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 800 "TagTable.c"
}
{
GeeList* _row_list = NULL;
GeeList* _tmp3_ = NULL;
GeeList* _tmp4_ = NULL;
gint _row_size = 0;
GeeList* _tmp5_ = NULL;
gint _tmp6_ = 0;
gint _tmp7_ = 0;
gint _row_index = 0;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = rows;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = _g_object_ref0 (_tmp3_);
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_row_list = _tmp4_;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = _row_list;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COLLECTION, GeeCollection));
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = _tmp6_;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_row_size = _tmp7_;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_row_index = -1;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
while (TRUE) {
#line 829 "TagTable.c"
gint _tmp8_ = 0;
gint _tmp9_ = 0;
gint _tmp10_ = 0;
TagRow* row = NULL;
GeeList* _tmp11_ = NULL;
gint _tmp12_ = 0;
gpointer _tmp13_ = NULL;
TagRow* _tmp14_ = NULL;
TagRow* _tmp15_ = NULL;
const gchar* _tmp16_ = NULL;
gchar* _tmp17_ = NULL;
TagTable* _tmp18_ = NULL;
TagRow* _tmp19_ = NULL;
TagID _tmp20_ = {0};
TagRow* _tmp21_ = NULL;
const gchar* _tmp22_ = NULL;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = _row_index;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_row_index = _tmp8_ + 1;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = _row_index;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = _row_size;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (!(_tmp9_ < _tmp10_)) {
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
break;
#line 858 "TagTable.c"
}
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = _row_list;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = _row_index;
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = gee_list_get (_tmp11_, _tmp12_);
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
row = (TagRow*) _tmp13_;
#line 68 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = row;
#line 68 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = row;
#line 68 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = _tmp15_->name;
#line 68 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = string_replace (_tmp16_, TAG_PATH_SEPARATOR_STRING, "-");
#line 68 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (_tmp14_->name);
#line 68 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_->name = _tmp17_;
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = table;
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_ = row;
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp20_ = _tmp19_->tag_id;
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_ = row;
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp22_ = _tmp21_->name;
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_table_rename (_tmp18_, &_tmp20_, _tmp22_, &_inner_error_);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tag_row_unref0 (row);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_row_list);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (rows);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 902 "TagTable.c"
goto __catch20_database_error;
}
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tag_row_unref0 (row);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_row_list);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (rows);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_database_table_unref0 (table);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.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 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 69 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 919 "TagTable.c"
}
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tag_row_unref0 (row);
#line 923 "TagTable.c"
}
#line 67 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_row_list);
#line 927 "TagTable.c"
}
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (rows);
#line 931 "TagTable.c"
}
goto __finally20;
__catch20_database_error:
{
GError* e = NULL;
const gchar* _tmp23_ = NULL;
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
e = _inner_error_;
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_inner_error_ = NULL;
#line 72 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_ = e->message;
#line 72 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_error ("TagTable.vala:72: TagTable: can't upgrade tag names for hierarchical t" \
"ag support: %s", _tmp23_);
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_error_free0 (e);
#line 948 "TagTable.c"
}
__finally20:
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_database_table_unref0 (table);
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.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 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 64 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 961 "TagTable.c"
}
#line 61 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_database_table_unref0 (table);
#line 965 "TagTable.c"
}
TagRow* tag_table_add (TagTable* self, const gchar* name, GError** error) {
TagRow* result = NULL;
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
time_t time_created = 0;
gulong _tmp4_ = 0UL;
sqlite3_stmt* _tmp5_ = NULL;
const gchar* _tmp6_ = NULL;
gchar* _tmp7_ = NULL;
GDestroyNotify _tmp8_ = NULL;
gint _tmp9_ = 0;
gint _tmp10_ = 0;
sqlite3_stmt* _tmp11_ = NULL;
time_t _tmp12_ = 0;
gint _tmp13_ = 0;
gint _tmp14_ = 0;
sqlite3_stmt* _tmp15_ = NULL;
gint _tmp16_ = 0;
gint _tmp17_ = 0;
TagRow* row = NULL;
TagRow* _tmp19_ = NULL;
TagRow* _tmp20_ = NULL;
sqlite3* _tmp21_ = NULL;
gint64 _tmp22_ = 0LL;
TagRow* _tmp23_ = NULL;
const gchar* _tmp24_ = NULL;
gchar* _tmp25_ = NULL;
TagRow* _tmp26_ = NULL;
TagRow* _tmp27_ = NULL;
time_t _tmp28_ = 0;
GError * _inner_error_ = NULL;
#line 76 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (IS_TAG_TABLE (self), NULL);
#line 76 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (name != NULL, NULL);
#line 78 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = database_table_db;
#line 78 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "INSERT INTO TagTable (name, time_created) VALUES (?, ?)", -1, &_tmp1_, NULL);
#line 78 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 78 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp1_;
#line 78 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp2_;
#line 80 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = res;
#line 80 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 82 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = now_sec ();
#line 82 "/home/jens/Source/shotwell/src/db/TagTable.vala"
time_created = (time_t) _tmp4_;
#line 84 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = stmt;
#line 84 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = name;
#line 84 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = g_strdup (_tmp6_);
#line 84 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = g_free;
#line 84 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = sqlite3_bind_text (_tmp5_, 1, _tmp7_, -1, _tmp8_);
#line 84 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp9_;
#line 85 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = res;
#line 85 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp10_ == SQLITE_OK, "res == Sqlite.OK");
#line 86 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = stmt;
#line 86 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = time_created;
#line 86 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = sqlite3_bind_int64 (_tmp11_, 2, (gint64) _tmp12_);
#line 86 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp13_;
#line 87 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = res;
#line 87 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp14_ == SQLITE_OK, "res == Sqlite.OK");
#line 89 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = stmt;
#line 89 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = sqlite3_step (_tmp15_);
#line 89 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp16_;
#line 90 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = res;
#line 90 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp17_ != SQLITE_DONE) {
#line 1064 "TagTable.c"
gint _tmp18_ = 0;
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = res;
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_throw_error ("TagTable.add", _tmp18_, &_inner_error_);
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 1080 "TagTable.c"
} else {
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.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 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 91 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 1090 "TagTable.c"
}
}
}
#line 93 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_ = tag_row_new ();
#line 93 "/home/jens/Source/shotwell/src/db/TagTable.vala"
row = _tmp19_;
#line 94 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp20_ = row;
#line 94 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_ = database_table_db;
#line 94 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp22_ = sqlite3_last_insert_rowid (_tmp21_);
#line 94 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_id_init (&_tmp20_->tag_id, _tmp22_);
#line 95 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_ = row;
#line 95 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp24_ = name;
#line 95 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp25_ = g_strdup (_tmp24_);
#line 95 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (_tmp23_->name);
#line 95 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_->name = _tmp25_;
#line 96 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp26_ = row;
#line 96 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_tmp26_->source_id_list);
#line 96 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp26_->source_id_list = NULL;
#line 97 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp27_ = row;
#line 97 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp28_ = time_created;
#line 97 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp27_->time_created = _tmp28_;
#line 99 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = row;
#line 99 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 99 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1134 "TagTable.c"
}
void tag_table_create_from_row (TagTable* self, TagRow* row, TagID* result, GError** error) {
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
TagRow* _tmp5_ = NULL;
const gchar* _tmp6_ = NULL;
gchar* _tmp7_ = NULL;
GDestroyNotify _tmp8_ = NULL;
gint _tmp9_ = 0;
gint _tmp10_ = 0;
sqlite3_stmt* _tmp11_ = NULL;
TagRow* _tmp12_ = NULL;
GeeSet* _tmp13_ = NULL;
gchar* _tmp14_ = NULL;
GDestroyNotify _tmp15_ = NULL;
gint _tmp16_ = 0;
gint _tmp17_ = 0;
sqlite3_stmt* _tmp18_ = NULL;
TagRow* _tmp19_ = NULL;
time_t _tmp20_ = 0;
gint _tmp21_ = 0;
gint _tmp22_ = 0;
sqlite3_stmt* _tmp23_ = NULL;
gint _tmp24_ = 0;
gint _tmp25_ = 0;
sqlite3* _tmp27_ = NULL;
gint64 _tmp28_ = 0LL;
TagID _tmp29_ = {0};
GError * _inner_error_ = NULL;
#line 103 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (IS_TAG_TABLE (self));
#line 103 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (IS_TAG_ROW (row));
#line 105 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = database_table_db;
#line 105 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "INSERT INTO TagTable (name, photo_id_list, time_created) VALUES (?, ?," \
" ?)", -1, &_tmp1_, NULL);
#line 105 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 105 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp1_;
#line 105 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp2_;
#line 107 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = res;
#line 107 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = stmt;
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = row;
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = _tmp5_->name;
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = g_strdup (_tmp6_);
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = g_free;
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = sqlite3_bind_text (_tmp4_, 1, _tmp7_, -1, _tmp8_);
#line 109 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp9_;
#line 110 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = res;
#line 110 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp10_ == SQLITE_OK, "res == Sqlite.OK");
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = stmt;
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = row;
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = _tmp12_->source_id_list;
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = tag_table_serialize_source_ids (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_COLLECTION, GeeCollection));
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = g_free;
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = sqlite3_bind_text (_tmp11_, 2, _tmp14_, -1, _tmp15_);
#line 111 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp16_;
#line 112 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = res;
#line 112 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp17_ == SQLITE_OK, "res == Sqlite.OK");
#line 113 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = stmt;
#line 113 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_ = row;
#line 113 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp20_ = _tmp19_->time_created;
#line 113 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_ = sqlite3_bind_int64 (_tmp18_, 3, (gint64) _tmp20_);
#line 113 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp21_;
#line 114 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp22_ = res;
#line 114 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp22_ == SQLITE_OK, "res == Sqlite.OK");
#line 116 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_ = stmt;
#line 116 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp24_ = sqlite3_step (_tmp23_);
#line 116 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp24_;
#line 117 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp25_ = res;
#line 117 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp25_ != SQLITE_DONE) {
#line 1249 "TagTable.c"
gint _tmp26_ = 0;
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp26_ = res;
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_throw_error ("TagTable.create_from_row", _tmp26_, &_inner_error_);
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1265 "TagTable.c"
} else {
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.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 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 118 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1275 "TagTable.c"
}
}
}
#line 120 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp27_ = database_table_db;
#line 120 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp28_ = sqlite3_last_insert_rowid (_tmp27_);
#line 120 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_id_init (&_tmp29_, _tmp28_);
#line 120 "/home/jens/Source/shotwell/src/db/TagTable.vala"
*result = _tmp29_;
#line 120 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 120 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1291 "TagTable.c"
}
void tag_table_remove (TagTable* self, TagID* tag_id, GError** error) {
TagID _tmp0_ = {0};
gint64 _tmp1_ = 0LL;
GError * _inner_error_ = NULL;
#line 123 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (IS_TAG_TABLE (self));
#line 123 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (tag_id != NULL);
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = *tag_id;
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = _tmp0_.id;
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_delete_by_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATABASE_TABLE, DatabaseTable), _tmp1_, &_inner_error_);
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1317 "TagTable.c"
} else {
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.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 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 124 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1325 "TagTable.c"
}
}
}
gchar* tag_table_get_name (TagTable* self, TagID* tag_id, GError** error) {
gchar* result = NULL;
sqlite3_stmt* stmt = NULL;
TagID _tmp0_ = {0};
gint64 _tmp1_ = 0LL;
sqlite3_stmt* _tmp2_ = NULL;
gboolean _tmp3_ = FALSE;
sqlite3_stmt* _tmp4_ = NULL;
const gchar* _tmp5_ = NULL;
gchar* _tmp6_ = NULL;
#line 127 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (IS_TAG_TABLE (self), NULL);
#line 127 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (tag_id != NULL, NULL);
#line 129 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = *tag_id;
#line 129 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = _tmp0_.id;
#line 129 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = database_table_select_by_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATABASE_TABLE, DatabaseTable), _tmp1_, "name", &_tmp2_);
#line 129 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 129 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp2_;
#line 129 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (!_tmp3_) {
#line 130 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = NULL;
#line 130 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 130 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1363 "TagTable.c"
}
#line 132 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = stmt;
#line 132 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = sqlite3_column_text (_tmp4_, 0);
#line 132 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = g_strdup (_tmp5_);
#line 132 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _tmp6_;
#line 132 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 132 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1377 "TagTable.c"
}
TagRow* tag_table_get_row (TagTable* self, TagID* tag_id, GError** error) {
TagRow* result = NULL;
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
TagID _tmp5_ = {0};
gint64 _tmp6_ = 0LL;
gint _tmp7_ = 0;
gint _tmp8_ = 0;
sqlite3_stmt* _tmp9_ = NULL;
gint _tmp10_ = 0;
gint _tmp11_ = 0;
TagRow* row = NULL;
TagRow* _tmp14_ = NULL;
TagRow* _tmp15_ = NULL;
TagID _tmp16_ = {0};
TagRow* _tmp17_ = NULL;
sqlite3_stmt* _tmp18_ = NULL;
const gchar* _tmp19_ = NULL;
gchar* _tmp20_ = NULL;
TagRow* _tmp21_ = NULL;
sqlite3_stmt* _tmp22_ = NULL;
const gchar* _tmp23_ = NULL;
GeeSet* _tmp24_ = NULL;
TagRow* _tmp25_ = NULL;
sqlite3_stmt* _tmp26_ = NULL;
gint64 _tmp27_ = 0LL;
GError * _inner_error_ = NULL;
#line 135 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (IS_TAG_TABLE (self), NULL);
#line 135 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (tag_id != NULL, NULL);
#line 137 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = database_table_db;
#line 137 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "SELECT name, photo_id_list, time_created FROM TagTable WHERE id=?", -1, &_tmp1_, NULL);
#line 137 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 137 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp1_;
#line 137 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp2_;
#line 139 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = res;
#line 139 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 141 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = stmt;
#line 141 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = *tag_id;
#line 141 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = _tmp5_.id;
#line 141 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = sqlite3_bind_int64 (_tmp4_, 1, _tmp6_);
#line 141 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp7_;
#line 142 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = res;
#line 142 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp8_ == SQLITE_OK, "res == Sqlite.OK");
#line 144 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = stmt;
#line 144 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = sqlite3_step (_tmp9_);
#line 144 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp10_;
#line 145 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = res;
#line 145 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp11_ == SQLITE_DONE) {
#line 146 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = NULL;
#line 146 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 146 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1461 "TagTable.c"
} else {
gint _tmp12_ = 0;
#line 147 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = res;
#line 147 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp12_ != SQLITE_ROW) {
#line 1468 "TagTable.c"
gint _tmp13_ = 0;
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = res;
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_throw_error ("TagTable.get_row", _tmp13_, &_inner_error_);
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 1484 "TagTable.c"
} else {
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.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 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 148 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 1494 "TagTable.c"
}
}
}
}
#line 150 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = tag_row_new ();
#line 150 "/home/jens/Source/shotwell/src/db/TagTable.vala"
row = _tmp14_;
#line 151 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = row;
#line 151 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = *tag_id;
#line 151 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_->tag_id = _tmp16_;
#line 152 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = row;
#line 152 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = stmt;
#line 152 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_ = sqlite3_column_text (_tmp18_, 0);
#line 152 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp20_ = g_strdup (_tmp19_);
#line 152 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (_tmp17_->name);
#line 152 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_->name = _tmp20_;
#line 153 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_ = row;
#line 153 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp22_ = stmt;
#line 153 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_ = sqlite3_column_text (_tmp22_, 1);
#line 153 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp24_ = tag_table_unserialize_source_ids (self, _tmp23_);
#line 153 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_tmp21_->source_id_list);
#line 153 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_->source_id_list = _tmp24_;
#line 154 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp25_ = row;
#line 154 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp26_ = stmt;
#line 154 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp27_ = sqlite3_column_int64 (_tmp26_, 2);
#line 154 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp25_->time_created = (time_t) _tmp27_;
#line 156 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = row;
#line 156 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 156 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1547 "TagTable.c"
}
GeeList* tag_table_get_all_rows (TagTable* self, GError** error) {
GeeList* result = NULL;
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
GeeList* rows = NULL;
GeeArrayList* _tmp4_ = NULL;
GError * _inner_error_ = NULL;
#line 159 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (IS_TAG_TABLE (self), NULL);
#line 161 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = database_table_db;
#line 161 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "SELECT id, name, photo_id_list, time_created FROM TagTable", -1, &_tmp1_, NULL);
#line 161 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 161 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp1_;
#line 161 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp2_;
#line 163 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = res;
#line 163 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 165 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = gee_array_list_new (TYPE_TAG_ROW, (GBoxedCopyFunc) tag_row_ref, (GDestroyNotify) tag_row_unref, NULL, NULL, NULL);
#line 165 "/home/jens/Source/shotwell/src/db/TagTable.vala"
rows = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_LIST, GeeList);
#line 1582 "TagTable.c"
{
gboolean _tmp5_ = FALSE;
#line 167 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = TRUE;
#line 167 "/home/jens/Source/shotwell/src/db/TagTable.vala"
while (TRUE) {
#line 1589 "TagTable.c"
sqlite3_stmt* _tmp6_ = NULL;
gint _tmp7_ = 0;
gint _tmp8_ = 0;
TagRow* row = NULL;
TagRow* _tmp11_ = NULL;
TagRow* _tmp12_ = NULL;
sqlite3_stmt* _tmp13_ = NULL;
gint64 _tmp14_ = 0LL;
TagRow* _tmp15_ = NULL;
sqlite3_stmt* _tmp16_ = NULL;
const gchar* _tmp17_ = NULL;
gchar* _tmp18_ = NULL;
TagRow* _tmp19_ = NULL;
sqlite3_stmt* _tmp20_ = NULL;
const gchar* _tmp21_ = NULL;
GeeSet* _tmp22_ = NULL;
TagRow* _tmp23_ = NULL;
sqlite3_stmt* _tmp24_ = NULL;
gint64 _tmp25_ = 0LL;
GeeList* _tmp26_ = NULL;
TagRow* _tmp27_ = NULL;
#line 167 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (!_tmp5_) {
#line 1613 "TagTable.c"
}
#line 167 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = FALSE;
#line 168 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = stmt;
#line 168 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = sqlite3_step (_tmp6_);
#line 168 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp7_;
#line 169 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = res;
#line 169 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp8_ == SQLITE_DONE) {
#line 170 "/home/jens/Source/shotwell/src/db/TagTable.vala"
break;
#line 1629 "TagTable.c"
} else {
gint _tmp9_ = 0;
#line 171 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = res;
#line 171 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp9_ != SQLITE_ROW) {
#line 1636 "TagTable.c"
gint _tmp10_ = 0;
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = res;
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_throw_error ("TagTable.get_all_rows", _tmp10_, &_inner_error_);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (rows);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 1654 "TagTable.c"
} else {
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (rows);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 172 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return NULL;
#line 1666 "TagTable.c"
}
}
}
}
#line 175 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = tag_row_new ();
#line 175 "/home/jens/Source/shotwell/src/db/TagTable.vala"
row = _tmp11_;
#line 176 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = row;
#line 176 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = stmt;
#line 176 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = sqlite3_column_int64 (_tmp13_, 0);
#line 176 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_id_init (&_tmp12_->tag_id, _tmp14_);
#line 177 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = row;
#line 177 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = stmt;
#line 177 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = sqlite3_column_text (_tmp16_, 1);
#line 177 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = g_strdup (_tmp17_);
#line 177 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (_tmp15_->name);
#line 177 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_->name = _tmp18_;
#line 178 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_ = row;
#line 178 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp20_ = stmt;
#line 178 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_ = sqlite3_column_text (_tmp20_, 2);
#line 178 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp22_ = tag_table_unserialize_source_ids (self, _tmp21_);
#line 178 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_tmp19_->source_id_list);
#line 178 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_->source_id_list = _tmp22_;
#line 179 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_ = row;
#line 179 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp24_ = stmt;
#line 179 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp25_ = sqlite3_column_int64 (_tmp24_, 3);
#line 179 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp23_->time_created = (time_t) _tmp25_;
#line 181 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp26_ = rows;
#line 181 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp27_ = row;
#line 181 "/home/jens/Source/shotwell/src/db/TagTable.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_COLLECTION, GeeCollection), _tmp27_);
#line 167 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tag_row_unref0 (row);
#line 1723 "TagTable.c"
}
}
#line 184 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = rows;
#line 184 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 184 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1732 "TagTable.c"
}
void tag_table_rename (TagTable* self, TagID* tag_id, const gchar* new_name, GError** error) {
TagID _tmp0_ = {0};
gint64 _tmp1_ = 0LL;
const gchar* _tmp2_ = NULL;
GError * _inner_error_ = NULL;
#line 187 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (IS_TAG_TABLE (self));
#line 187 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (tag_id != NULL);
#line 187 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (new_name != NULL);
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = *tag_id;
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = _tmp0_.id;
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = new_name;
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_update_text_by_id_2 (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATABASE_TABLE, DatabaseTable), _tmp1_, "name", _tmp2_, &_inner_error_);
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1763 "TagTable.c"
} else {
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.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 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 188 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1771 "TagTable.c"
}
}
}
void tag_table_set_tagged_sources (TagTable* self, TagID* tag_id, GeeCollection* source_ids, GError** error) {
sqlite3_stmt* stmt = NULL;
gint res = 0;
sqlite3* _tmp0_ = NULL;
sqlite3_stmt* _tmp1_ = NULL;
gint _tmp2_ = 0;
gint _tmp3_ = 0;
sqlite3_stmt* _tmp4_ = NULL;
GeeCollection* _tmp5_ = NULL;
gchar* _tmp6_ = NULL;
GDestroyNotify _tmp7_ = NULL;
gint _tmp8_ = 0;
gint _tmp9_ = 0;
sqlite3_stmt* _tmp10_ = NULL;
TagID _tmp11_ = {0};
gint64 _tmp12_ = 0LL;
gint _tmp13_ = 0;
gint _tmp14_ = 0;
sqlite3_stmt* _tmp15_ = NULL;
gint _tmp16_ = 0;
gint _tmp17_ = 0;
GError * _inner_error_ = NULL;
#line 191 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (IS_TAG_TABLE (self));
#line 191 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (tag_id != NULL);
#line 191 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_if_fail (GEE_IS_COLLECTION (source_ids));
#line 193 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = database_table_db;
#line 193 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = sqlite3_prepare_v2 (_tmp0_, "UPDATE TagTable SET photo_id_list=? WHERE id=?", -1, &_tmp1_, NULL);
#line 193 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 193 "/home/jens/Source/shotwell/src/db/TagTable.vala"
stmt = _tmp1_;
#line 193 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp2_;
#line 194 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = res;
#line 194 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp3_ == SQLITE_OK, "res == Sqlite.OK");
#line 196 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = stmt;
#line 196 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = source_ids;
#line 196 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = tag_table_serialize_source_ids (self, _tmp5_);
#line 196 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = g_free;
#line 196 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = sqlite3_bind_text (_tmp4_, 1, _tmp6_, -1, _tmp7_);
#line 196 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp8_;
#line 197 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = res;
#line 197 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp9_ == SQLITE_OK, "res == Sqlite.OK");
#line 198 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = stmt;
#line 198 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = *tag_id;
#line 198 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = _tmp11_.id;
#line 198 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = sqlite3_bind_int64 (_tmp10_, 2, _tmp12_);
#line 198 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp13_;
#line 199 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = res;
#line 199 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_vala_assert (_tmp14_ == SQLITE_OK, "res == Sqlite.OK");
#line 201 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = stmt;
#line 201 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = sqlite3_step (_tmp15_);
#line 201 "/home/jens/Source/shotwell/src/db/TagTable.vala"
res = _tmp16_;
#line 202 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = res;
#line 202 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp17_ != SQLITE_DONE) {
#line 1859 "TagTable.c"
gint _tmp18_ = 0;
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = res;
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
database_table_throw_error ("TagTable.set_tagged_photos", _tmp18_, &_inner_error_);
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_inner_error_->domain == DATABASE_ERROR) {
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_propagate_error (error, _inner_error_);
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1875 "TagTable.c"
} else {
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.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 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_clear_error (&_inner_error_);
#line 203 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return;
#line 1885 "TagTable.c"
}
}
}
#line 191 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_sqlite3_finalize0 (stmt);
#line 1891 "TagTable.c"
}
static gchar* tag_table_serialize_source_ids (TagTable* self, GeeCollection* source_ids) {
gchar* result = NULL;
GeeCollection* _tmp0_ = NULL;
GString* _result_ = NULL;
GString* _tmp1_ = NULL;
const gchar* _tmp11_ = NULL;
GString* _tmp12_ = NULL;
gssize _tmp13_ = 0L;
gchar* _tmp16_ = NULL;
#line 206 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (IS_TAG_TABLE (self), NULL);
#line 206 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail ((source_ids == NULL) || GEE_IS_COLLECTION (source_ids), NULL);
#line 207 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = source_ids;
#line 207 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp0_ == NULL) {
#line 208 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = NULL;
#line 208 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 1916 "TagTable.c"
}
#line 210 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = g_string_new ("");
#line 210 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_result_ = _tmp1_;
#line 1922 "TagTable.c"
{
GeeIterator* _source_id_it = NULL;
GeeCollection* _tmp2_ = NULL;
GeeIterator* _tmp3_ = NULL;
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = source_ids;
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp3_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ITERABLE, GeeIterable));
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_source_id_it = _tmp3_;
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
while (TRUE) {
#line 1935 "TagTable.c"
GeeIterator* _tmp4_ = NULL;
gboolean _tmp5_ = FALSE;
gchar* source_id = NULL;
GeeIterator* _tmp6_ = NULL;
gpointer _tmp7_ = NULL;
GString* _tmp8_ = NULL;
const gchar* _tmp9_ = NULL;
GString* _tmp10_ = NULL;
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = _source_id_it;
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = gee_iterator_next (_tmp4_);
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (!_tmp5_) {
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
break;
#line 1952 "TagTable.c"
}
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = _source_id_it;
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = gee_iterator_get (_tmp6_);
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
source_id = (gchar*) _tmp7_;
#line 213 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = _result_;
#line 213 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = source_id;
#line 213 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_string_append (_tmp8_, _tmp9_);
#line 214 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = _result_;
#line 214 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_string_append (_tmp10_, ",");
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (source_id);
#line 1972 "TagTable.c"
}
#line 212 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_object_unref0 (_source_id_it);
#line 1976 "TagTable.c"
}
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = _result_;
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = _tmp12_->len;
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp13_ != ((gssize) 0)) {
#line 1984 "TagTable.c"
GString* _tmp14_ = NULL;
const gchar* _tmp15_ = NULL;
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = _result_;
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp15_ = _tmp14_->str;
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = _tmp15_;
#line 1993 "TagTable.c"
} else {
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = NULL;
#line 1997 "TagTable.c"
}
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = g_strdup (_tmp11_);
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _tmp16_;
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_string_free0 (_result_);
#line 217 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 2007 "TagTable.c"
}
static gchar string_get (const gchar* self, glong index) {
gchar result = '\0';
glong _tmp0_ = 0L;
gchar _tmp1_ = '\0';
#line 1086 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, '\0');
#line 1087 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp0_ = index;
#line 1087 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
_tmp1_ = ((gchar*) self)[_tmp0_];
#line 1087 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
result = _tmp1_;
#line 1087 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
return result;
#line 2025 "TagTable.c"
}
static GeeSet* tag_table_unserialize_source_ids (TagTable* self, const gchar* text_list) {
GeeSet* result = NULL;
GeeSet* _result_ = NULL;
GeeHashSet* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
gchar** split = NULL;
const gchar* _tmp2_ = NULL;
gchar** _tmp3_ = NULL;
gchar** _tmp4_ = NULL;
gint split_length1 = 0;
gint _split_size_ = 0;
gchar** _tmp5_ = NULL;
gint _tmp5__length1 = 0;
#line 220 "/home/jens/Source/shotwell/src/db/TagTable.vala"
g_return_val_if_fail (IS_TAG_TABLE (self), NULL);
#line 221 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 221 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_result_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SET, GeeSet);
#line 223 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp1_ = text_list;
#line 223 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp1_ == NULL) {
#line 224 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _result_;
#line 224 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 2056 "TagTable.c"
}
#line 226 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp2_ = text_list;
#line 226 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ",", 0);
#line 226 "/home/jens/Source/shotwell/src/db/TagTable.vala"
split = _tmp4_;
#line 226 "/home/jens/Source/shotwell/src/db/TagTable.vala"
split_length1 = _vala_array_length (_tmp3_);
#line 226 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_split_size_ = split_length1;
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5_ = split;
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp5__length1 = split_length1;
#line 2072 "TagTable.c"
{
gchar** token_collection = NULL;
gint token_collection_length1 = 0;
gint _token_collection_size_ = 0;
gint token_it = 0;
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
token_collection = _tmp5_;
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
token_collection_length1 = _tmp5__length1;
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
for (token_it = 0; token_it < _tmp5__length1; token_it = token_it + 1) {
#line 2084 "TagTable.c"
gchar* _tmp6_ = NULL;
gchar* token = NULL;
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp6_ = g_strdup (token_collection[token_it]);
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
token = _tmp6_;
#line 2091 "TagTable.c"
{
const gchar* _tmp7_ = NULL;
gboolean _tmp8_ = FALSE;
const gchar* _tmp9_ = NULL;
gchar _tmp10_ = '\0';
gboolean _tmp11_ = FALSE;
#line 228 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp7_ = token;
#line 228 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp8_ = is_string_empty (_tmp7_);
#line 228 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp8_) {
#line 229 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (token);
#line 229 "/home/jens/Source/shotwell/src/db/TagTable.vala"
continue;
#line 2108 "TagTable.c"
}
#line 236 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp9_ = token;
#line 236 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp10_ = string_get (_tmp9_, (glong) 0);
#line 236 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp11_ = g_ascii_isdigit (_tmp10_);
#line 236 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp11_) {
#line 2118 "TagTable.c"
GeeSet* _tmp12_ = NULL;
const gchar* _tmp13_ = NULL;
gint64 _tmp14_ = 0LL;
PhotoID _tmp15_ = {0};
gchar* _tmp16_ = NULL;
gchar* _tmp17_ = NULL;
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp12_ = _result_;
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp13_ = token;
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp14_ = parse_int64 (_tmp13_, 10);
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
photo_id_init (&_tmp15_, _tmp14_);
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp16_ = photo_id_upgrade_photo_id_to_source_id (&_tmp15_);
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp17_ = _tmp16_;
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection), _tmp17_);
#line 238 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (_tmp17_);
#line 2141 "TagTable.c"
} else {
const gchar* _tmp18_ = NULL;
gchar _tmp19_ = '\0';
gboolean _tmp20_ = FALSE;
#line 239 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp18_ = token;
#line 239 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp19_ = string_get (_tmp18_, (glong) 0);
#line 239 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp20_ = g_ascii_isalpha (_tmp19_);
#line 239 "/home/jens/Source/shotwell/src/db/TagTable.vala"
if (_tmp20_) {
#line 2154 "TagTable.c"
GeeSet* _tmp21_ = NULL;
const gchar* _tmp22_ = NULL;
#line 241 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp21_ = _result_;
#line 241 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_tmp22_ = token;
#line 241 "/home/jens/Source/shotwell/src/db/TagTable.vala"
gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_COLLECTION, GeeCollection), _tmp22_);
#line 2163 "TagTable.c"
}
}
#line 227 "/home/jens/Source/shotwell/src/db/TagTable.vala"
_g_free0 (token);
#line 2168 "TagTable.c"
}
}
}
#line 245 "/home/jens/Source/shotwell/src/db/TagTable.vala"
result = _result_;
#line 245 "/home/jens/Source/shotwell/src/db/TagTable.vala"
split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
#line 245 "/home/jens/Source/shotwell/src/db/TagTable.vala"
return result;
#line 2178 "TagTable.c"
}
static void tag_table_class_init (TagTableClass * klass) {
#line 32 "/home/jens/Source/shotwell/src/db/TagTable.vala"
tag_table_parent_class = g_type_class_peek_parent (klass);
#line 32 "/home/jens/Source/shotwell/src/db/TagTable.vala"
((DatabaseTableClass *) klass)->finalize = tag_table_finalize;
#line 2187 "TagTable.c"
}
static void tag_table_instance_init (TagTable * self) {
}
static void tag_table_finalize (DatabaseTable* obj) {
TagTable * self;
#line 32 "/home/jens/Source/shotwell/src/db/TagTable.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TAG_TABLE, TagTable);
#line 32 "/home/jens/Source/shotwell/src/db/TagTable.vala"
DATABASE_TABLE_CLASS (tag_table_parent_class)->finalize (obj);
#line 2201 "TagTable.c"
}
GType tag_table_get_type (void) {
static volatile gsize tag_table_type_id__volatile = 0;
if (g_once_init_enter (&tag_table_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (TagTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tag_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TagTable), 0, (GInstanceInitFunc) tag_table_instance_init, NULL };
GType tag_table_type_id;
tag_table_type_id = g_type_register_static (TYPE_DATABASE_TABLE, "TagTable", &g_define_type_info, 0);
g_once_init_leave (&tag_table_type_id__volatile, tag_table_type_id);
}
return tag_table_type_id__volatile;
}
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
if ((array != NULL) && (destroy_func != NULL)) {
int i;
for (i = 0; i < array_length; i = i + 1) {
if (((gpointer*) array)[i] != NULL) {
destroy_func (((gpointer*) array)[i]);
}
}
}
}
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
static gint _vala_array_length (gpointer array) {
int length;
length = 0;
if (array) {
while (((gpointer*) array)[length]) {
length++;
}
}
return length;
}
|