summaryrefslogtreecommitdiff
path: root/src/MetadataWriter.c
blob: ec51b730a75ca7b091c6014a3654268e684ebac6 (plain)
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
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
/* MetadataWriter.c generated by valac 0.32.1, the Vala compiler
 * generated from MetadataWriter.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.
 */
/* MetadataWriter tracks LibraryPhotos for alterations to their metadata and commits those changes*/
/* in a timely manner to their backing files.  Because only the MetadataWriter knows when the*/
/* metadata has been properly committed, it is also responsible for updating the metadata-dirty*/
/* flag in Photo.  Thus, MetadataWriter should *always* be running, even if the user has turned off*/
/* the feature, so if they turn it on MetadataWriter can properly go out and update the backing*/
/* files.*/

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <time.h>


#define TYPE_METADATA_WRITER (metadata_writer_get_type ())
#define METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_WRITER, MetadataWriter))
#define METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_WRITER, MetadataWriterClass))
#define IS_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_WRITER))
#define IS_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_WRITER))
#define METADATA_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_WRITER, MetadataWriterClass))

typedef struct _MetadataWriter MetadataWriter;
typedef struct _MetadataWriterClass MetadataWriterClass;
typedef struct _MetadataWriterPrivate MetadataWriterPrivate;

#define TYPE_WORKERS (workers_get_type ())
#define WORKERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WORKERS, Workers))
#define WORKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WORKERS, WorkersClass))
#define IS_WORKERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WORKERS))
#define IS_WORKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WORKERS))
#define WORKERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WORKERS, WorkersClass))

typedef struct _Workers Workers;
typedef struct _WorkersClass WorkersClass;

#define TYPE_TIMED_QUEUE (timed_queue_get_type ())
#define TIMED_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TIMED_QUEUE, TimedQueue))
#define TIMED_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TIMED_QUEUE, TimedQueueClass))
#define IS_TIMED_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TIMED_QUEUE))
#define IS_TIMED_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TIMED_QUEUE))
#define TIMED_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TIMED_QUEUE, TimedQueueClass))

typedef struct _TimedQueue TimedQueue;
typedef struct _TimedQueueClass TimedQueueClass;

#define TYPE_HASH_TIMED_QUEUE (hash_timed_queue_get_type ())
#define HASH_TIMED_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HASH_TIMED_QUEUE, HashTimedQueue))
#define HASH_TIMED_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HASH_TIMED_QUEUE, HashTimedQueueClass))
#define IS_HASH_TIMED_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HASH_TIMED_QUEUE))
#define IS_HASH_TIMED_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HASH_TIMED_QUEUE))
#define HASH_TIMED_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HASH_TIMED_QUEUE, HashTimedQueueClass))

typedef struct _HashTimedQueue HashTimedQueue;
typedef struct _HashTimedQueueClass HashTimedQueueClass;

#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

#define TYPE_DATA_SOURCE (data_source_get_type ())
#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource))
#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass))
#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE))
#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE))
#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass))

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;

#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ())
#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource))
#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE))
#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE))
#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))

typedef struct _ThumbnailSource ThumbnailSource;
typedef struct _ThumbnailSourceClass ThumbnailSourceClass;

#define TYPE_MEDIA_SOURCE (media_source_get_type ())
#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource))
#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass))
#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE))
#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE))
#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass))

typedef struct _MediaSource MediaSource;
typedef struct _MediaSourceClass MediaSourceClass;

#define TYPE_PHOTO_SOURCE (photo_source_get_type ())
#define PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_SOURCE, PhotoSource))
#define PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_SOURCE, PhotoSourceClass))
#define IS_PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_SOURCE))
#define IS_PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_SOURCE))
#define PHOTO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_SOURCE, PhotoSourceClass))

typedef struct _PhotoSource PhotoSource;
typedef struct _PhotoSourceClass PhotoSourceClass;

#define TYPE_PHOTO (photo_get_type ())
#define PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO, Photo))
#define PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO, PhotoClass))
#define IS_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO))
#define IS_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO))
#define PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO, PhotoClass))

typedef struct _Photo Photo;
typedef struct _PhotoClass PhotoClass;

#define TYPE_LIBRARY_PHOTO (library_photo_get_type ())
#define LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO, LibraryPhoto))
#define LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))
#define IS_LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO))
#define IS_LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO))
#define LIBRARY_PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define TYPE_BACKGROUND_JOB (background_job_get_type ())
#define BACKGROUND_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND_JOB, BackgroundJob))
#define BACKGROUND_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKGROUND_JOB, BackgroundJobClass))
#define IS_BACKGROUND_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND_JOB))
#define IS_BACKGROUND_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKGROUND_JOB))
#define BACKGROUND_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKGROUND_JOB, BackgroundJobClass))

typedef struct _BackgroundJob BackgroundJob;
typedef struct _BackgroundJobClass BackgroundJobClass;

#define METADATA_WRITER_TYPE_COMMIT_JOB (metadata_writer_commit_job_get_type ())
#define METADATA_WRITER_COMMIT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJob))
#define METADATA_WRITER_COMMIT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJobClass))
#define METADATA_WRITER_IS_COMMIT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), METADATA_WRITER_TYPE_COMMIT_JOB))
#define METADATA_WRITER_IS_COMMIT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), METADATA_WRITER_TYPE_COMMIT_JOB))
#define METADATA_WRITER_COMMIT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJobClass))

typedef struct _MetadataWriterCommitJob MetadataWriterCommitJob;
typedef struct _MetadataWriterCommitJobClass MetadataWriterCommitJobClass;

#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))

typedef struct _ConfigurationFacade ConfigurationFacade;
typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;

#define CONFIG_TYPE_FACADE (config_facade_get_type ())
#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))

typedef struct _ConfigFacade ConfigFacade;
typedef struct _ConfigFacadeClass ConfigFacadeClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_DATA_COLLECTION (data_collection_get_type ())
#define DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_COLLECTION, DataCollection))
#define DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_COLLECTION, DataCollectionClass))
#define IS_DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_COLLECTION))
#define IS_DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_COLLECTION))
#define DATA_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_COLLECTION, DataCollectionClass))

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

#define TYPE_SOURCE_COLLECTION (source_collection_get_type ())
#define SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_COLLECTION, SourceCollection))
#define SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_COLLECTION, SourceCollectionClass))
#define IS_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_COLLECTION))
#define IS_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_COLLECTION))
#define SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_COLLECTION, SourceCollectionClass))

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

#define TYPE_DATABASE_SOURCE_COLLECTION (database_source_collection_get_type ())
#define DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollection))
#define DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))
#define IS_DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_SOURCE_COLLECTION))
#define IS_DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_SOURCE_COLLECTION))
#define DATABASE_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))

typedef struct _DatabaseSourceCollection DatabaseSourceCollection;
typedef struct _DatabaseSourceCollectionClass DatabaseSourceCollectionClass;

#define TYPE_MEDIA_SOURCE_COLLECTION (media_source_collection_get_type ())
#define MEDIA_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection))
#define MEDIA_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollectionClass))
#define IS_MEDIA_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_COLLECTION))
#define IS_MEDIA_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_COLLECTION))
#define MEDIA_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollectionClass))

typedef struct _MediaSourceCollection MediaSourceCollection;
typedef struct _MediaSourceCollectionClass MediaSourceCollectionClass;

#define TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION (library_photo_source_collection_get_type ())
#define LIBRARY_PHOTO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection))
#define LIBRARY_PHOTO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionClass))
#define IS_LIBRARY_PHOTO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION))
#define IS_LIBRARY_PHOTO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION))
#define LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionClass))

typedef struct _LibraryPhotoSourceCollection LibraryPhotoSourceCollection;
typedef struct _LibraryPhotoSourceCollectionClass LibraryPhotoSourceCollectionClass;

#define TYPE_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;

#define TYPE_CONTAINER_SOURCE_COLLECTION (container_source_collection_get_type ())
#define CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection))
#define CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))
#define IS_CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE_COLLECTION))
#define IS_CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONTAINER_SOURCE_COLLECTION))
#define CONTAINER_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))

typedef struct _ContainerSourceCollection ContainerSourceCollection;
typedef struct _ContainerSourceCollectionClass ContainerSourceCollectionClass;

#define TYPE_TAG_SOURCE_COLLECTION (tag_source_collection_get_type ())
#define TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollection))
#define TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))
#define IS_TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_SOURCE_COLLECTION))
#define IS_TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_SOURCE_COLLECTION))
#define TAG_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))

typedef struct _TagSourceCollection TagSourceCollection;
typedef struct _TagSourceCollectionClass TagSourceCollectionClass;

#define TYPE_CONTAINER_SOURCE (container_source_get_type ())
#define CONTAINER_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE, ContainerSource))
#define IS_CONTAINER_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE))
#define CONTAINER_SOURCE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_CONTAINER_SOURCE, ContainerSourceIface))

typedef struct _ContainerSource ContainerSource;
typedef struct _ContainerSourceIface ContainerSourceIface;

#define TYPE_SOURCE_BACKLINK (source_backlink_get_type ())
#define SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_BACKLINK, SourceBacklink))
#define SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))
#define IS_SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_BACKLINK))
#define IS_SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_BACKLINK))
#define SOURCE_BACKLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))

typedef struct _SourceBacklink SourceBacklink;
typedef struct _SourceBacklinkClass SourceBacklinkClass;

#define TYPE_APPLICATION (application_get_type ())
#define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
#define APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION, ApplicationClass))
#define IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLICATION))
#define IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION))
#define APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION, ApplicationClass))

typedef struct _Application Application;
typedef struct _ApplicationClass ApplicationClass;
#define _application_unref0(var) ((var == NULL) ? NULL : (var = (application_unref (var), NULL)))

#define TYPE_LIBRARY_MONITOR_POOL (library_monitor_pool_get_type ())
#define LIBRARY_MONITOR_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_MONITOR_POOL, LibraryMonitorPool))
#define LIBRARY_MONITOR_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_MONITOR_POOL, LibraryMonitorPoolClass))
#define IS_LIBRARY_MONITOR_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_MONITOR_POOL))
#define IS_LIBRARY_MONITOR_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_MONITOR_POOL))
#define LIBRARY_MONITOR_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_MONITOR_POOL, LibraryMonitorPoolClass))

typedef struct _LibraryMonitorPool LibraryMonitorPool;
typedef struct _LibraryMonitorPoolClass LibraryMonitorPoolClass;

#define TYPE_DIRECTORY_MONITOR (directory_monitor_get_type ())
#define DIRECTORY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DIRECTORY_MONITOR, DirectoryMonitor))
#define DIRECTORY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DIRECTORY_MONITOR, DirectoryMonitorClass))
#define IS_DIRECTORY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DIRECTORY_MONITOR))
#define IS_DIRECTORY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DIRECTORY_MONITOR))
#define DIRECTORY_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DIRECTORY_MONITOR, DirectoryMonitorClass))

typedef struct _DirectoryMonitor DirectoryMonitor;
typedef struct _DirectoryMonitorClass DirectoryMonitorClass;

#define TYPE_LIBRARY_MONITOR (library_monitor_get_type ())
#define LIBRARY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_MONITOR, LibraryMonitor))
#define LIBRARY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_MONITOR, LibraryMonitorClass))
#define IS_LIBRARY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_MONITOR))
#define IS_LIBRARY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_MONITOR))
#define LIBRARY_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_MONITOR, LibraryMonitorClass))

typedef struct _LibraryMonitor LibraryMonitor;
typedef struct _LibraryMonitorClass LibraryMonitorClass;
#define _library_monitor_pool_unref0(var) ((var == NULL) ? NULL : (var = (library_monitor_pool_unref (var), NULL)))
#define _workers_unref0(var) ((var == NULL) ? NULL : (var = (workers_unref (var), NULL)))
#define _timed_queue_unref0(var) ((var == NULL) ? NULL : (var = (timed_queue_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _alteration_unref0(var) ((var == NULL) ? NULL : (var = (alteration_unref (var), NULL)))

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

#define TYPE_TRANSACTION_CONTROLLER (transaction_controller_get_type ())
#define TRANSACTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSACTION_CONTROLLER, TransactionController))
#define TRANSACTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSACTION_CONTROLLER, TransactionControllerClass))
#define IS_TRANSACTION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSACTION_CONTROLLER))
#define IS_TRANSACTION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSACTION_CONTROLLER))
#define TRANSACTION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSACTION_CONTROLLER, TransactionControllerClass))

typedef struct _TransactionController TransactionController;
typedef struct _TransactionControllerClass TransactionControllerClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _background_job_unref0(var) ((var == NULL) ? NULL : (var = (background_job_unref (var), NULL)))
typedef struct _BackgroundJobPrivate BackgroundJobPrivate;

#define BACKGROUND_JOB_TYPE_JOB_PRIORITY (background_job_job_priority_get_type ())
typedef struct _MetadataWriterCommitJobPrivate MetadataWriterCommitJobPrivate;

#define PHOTO_TYPE_REIMPORT_MASTER_STATE (photo_reimport_master_state_get_type ())
#define PHOTO_REIMPORT_MASTER_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterState))
#define PHOTO_REIMPORT_MASTER_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterStateClass))
#define PHOTO_IS_REIMPORT_MASTER_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE))
#define PHOTO_IS_REIMPORT_MASTER_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_MASTER_STATE))
#define PHOTO_REIMPORT_MASTER_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_MASTER_STATE, PhotoReimportMasterStateClass))

typedef struct _PhotoReimportMasterState PhotoReimportMasterState;
typedef struct _PhotoReimportMasterStateClass PhotoReimportMasterStateClass;

#define PHOTO_TYPE_REIMPORT_EDITABLE_STATE (photo_reimport_editable_state_get_type ())
#define PHOTO_REIMPORT_EDITABLE_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableState))
#define PHOTO_REIMPORT_EDITABLE_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableStateClass))
#define PHOTO_IS_REIMPORT_EDITABLE_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE))
#define PHOTO_IS_REIMPORT_EDITABLE_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PHOTO_TYPE_REIMPORT_EDITABLE_STATE))
#define PHOTO_REIMPORT_EDITABLE_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PHOTO_TYPE_REIMPORT_EDITABLE_STATE, PhotoReimportEditableStateClass))

typedef struct _PhotoReimportEditableState PhotoReimportEditableState;
typedef struct _PhotoReimportEditableStateClass PhotoReimportEditableStateClass;
#define _photo_reimport_master_state_unref0(var) ((var == NULL) ? NULL : (var = (photo_reimport_master_state_unref (var), NULL)))
#define _photo_reimport_editable_state_unref0(var) ((var == NULL) ? NULL : (var = (photo_reimport_editable_state_unref (var), NULL)))

#define TYPE_ABSTRACT_SEMAPHORE (abstract_semaphore_get_type ())
#define ABSTRACT_SEMAPHORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore))
#define ABSTRACT_SEMAPHORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphoreClass))
#define IS_ABSTRACT_SEMAPHORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ABSTRACT_SEMAPHORE))
#define IS_ABSTRACT_SEMAPHORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ABSTRACT_SEMAPHORE))
#define ABSTRACT_SEMAPHORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphoreClass))

typedef struct _AbstractSemaphore AbstractSemaphore;
typedef struct _AbstractSemaphoreClass AbstractSemaphoreClass;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())

#define TYPE_MEDIA_METADATA (media_metadata_get_type ())
#define MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_METADATA, MediaMetadata))
#define MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_METADATA, MediaMetadataClass))
#define IS_MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_METADATA))
#define IS_MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_METADATA))
#define MEDIA_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_METADATA, MediaMetadataClass))

typedef struct _MediaMetadata MediaMetadata;
typedef struct _MediaMetadataClass MediaMetadataClass;

#define TYPE_PHOTO_METADATA (photo_metadata_get_type ())
#define PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_METADATA, PhotoMetadata))
#define PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_METADATA, PhotoMetadataClass))
#define IS_PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_METADATA))
#define IS_PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_METADATA))
#define PHOTO_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_METADATA, PhotoMetadataClass))

typedef struct _PhotoMetadata PhotoMetadata;
typedef struct _PhotoMetadataClass PhotoMetadataClass;
#define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL)))

#define PHOTO_METADATA_TYPE_SET_OPTION (photo_metadata_set_option_get_type ())

#define TYPE_RATING (rating_get_type ())

#define TYPE_METADATA_DATE_TIME (metadata_date_time_get_type ())
#define METADATA_DATE_TIME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_DATE_TIME, MetadataDateTime))
#define METADATA_DATE_TIME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_DATE_TIME, MetadataDateTimeClass))
#define IS_METADATA_DATE_TIME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_DATE_TIME))
#define IS_METADATA_DATE_TIME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_DATE_TIME))
#define METADATA_DATE_TIME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_DATE_TIME, MetadataDateTimeClass))

typedef struct _MetadataDateTime MetadataDateTime;
typedef struct _MetadataDateTimeClass MetadataDateTimeClass;
#define _metadata_date_time_unref0(var) ((var == NULL) ? NULL : (var = (metadata_date_time_unref (var), NULL)))

#define TYPE_ORIENTATION (orientation_get_type ())
#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 _MetadataWriter {
	GObject parent_instance;
	MetadataWriterPrivate * priv;
};

struct _MetadataWriterClass {
	GObjectClass parent_class;
};

struct _MetadataWriterPrivate {
	Workers* workers;
	gboolean enabled;
	HashTimedQueue* dirty;
	GeeHashMap* pending;
	GeeHashSet* pending_cancel;
	GeeHashSet* interested_photo_details;
	LibraryPhoto* ignore_photo_alteration;
	guint outstanding_total;
	guint outstanding_completed;
	gboolean closed;
	gint pause_count;
	GeeHashSet* importing_photos;
};

struct _ContainerSourceIface {
	GTypeInterface parent_iface;
	gboolean (*has_links) (ContainerSource* self);
	SourceBacklink* (*get_backlink) (ContainerSource* self);
	void (*break_link) (ContainerSource* self, DataSource* source);
	void (*break_link_many) (ContainerSource* self, GeeCollection* sources);
	void (*establish_link) (ContainerSource* self, DataSource* source);
	void (*establish_link_many) (ContainerSource* self, GeeCollection* sources);
};

typedef void (*DequeuedCallback) (gconstpointer item, void* user_data);
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 ()
typedef enum  {
	BACKGROUND_JOB_JOB_PRIORITY_HIGHEST = 100,
	BACKGROUND_JOB_JOB_PRIORITY_HIGH = 75,
	BACKGROUND_JOB_JOB_PRIORITY_NORMAL = 50,
	BACKGROUND_JOB_JOB_PRIORITY_LOW = 25,
	BACKGROUND_JOB_JOB_PRIORITY_LOWEST = 0
} BackgroundJobJobPriority;

struct _BackgroundJob {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BackgroundJobPrivate * priv;
};

struct _BackgroundJobClass {
	GTypeClass parent_class;
	void (*finalize) (BackgroundJob *self);
	void (*execute) (BackgroundJob* self);
	BackgroundJobJobPriority (*get_priority) (BackgroundJob* self);
};

struct _MetadataWriterCommitJob {
	BackgroundJob parent_instance;
	MetadataWriterCommitJobPrivate * priv;
	LibraryPhoto* photo;
	GeeSet* current_keywords;
	PhotoReimportMasterState* reimport_master_state;
	PhotoReimportEditableState* reimport_editable_state;
	GError* err;
	gboolean wrote_master;
	gboolean wrote_editable;
};

struct _MetadataWriterCommitJobClass {
	BackgroundJobClass parent_class;
};

typedef void (*CompletionCallback) (BackgroundJob* job, void* user_data);
typedef void (*CancellationCallback) (BackgroundJob* job, void* user_data);
typedef enum  {
	PHOTO_FILE_FORMAT_JFIF,
	PHOTO_FILE_FORMAT_RAW,
	PHOTO_FILE_FORMAT_PNG,
	PHOTO_FILE_FORMAT_TIFF,
	PHOTO_FILE_FORMAT_BMP,
	PHOTO_FILE_FORMAT_UNKNOWN
} PhotoFileFormat;

typedef enum  {
	PHOTO_METADATA_SET_OPTION_ALL_DOMAINS,
	PHOTO_METADATA_SET_OPTION_ONLY_IF_DOMAIN_PRESENT,
	PHOTO_METADATA_SET_OPTION_AT_LEAST_DEFAULT_DOMAIN
} PhotoMetadataSetOption;

typedef enum  {
	RATING_REJECTED = -1,
	RATING_UNRATED = 0,
	RATING_ONE = 1,
	RATING_TWO = 2,
	RATING_THREE = 3,
	RATING_FOUR = 4,
	RATING_FIVE = 5
} Rating;

typedef enum  {
	ORIENTATION_MIN = 1,
	ORIENTATION_TOP_LEFT = 1,
	ORIENTATION_TOP_RIGHT = 2,
	ORIENTATION_BOTTOM_RIGHT = 3,
	ORIENTATION_BOTTOM_LEFT = 4,
	ORIENTATION_LEFT_TOP = 5,
	ORIENTATION_RIGHT_TOP = 6,
	ORIENTATION_RIGHT_BOTTOM = 7,
	ORIENTATION_LEFT_BOTTOM = 8,
	ORIENTATION_MAX = 8
} Orientation;


static gpointer metadata_writer_parent_class = NULL;
extern LibraryPhotoSourceCollection* library_photo_global;
extern TagSourceCollection* tag_global;
static MetadataWriter* metadata_writer_instance;
static MetadataWriter* metadata_writer_instance = NULL;
static gpointer metadata_writer_commit_job_parent_class = NULL;

GType metadata_writer_get_type (void) G_GNUC_CONST;
gpointer workers_ref (gpointer instance);
void workers_unref (gpointer instance);
GParamSpec* param_spec_workers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_workers (GValue* value, gpointer v_object);
void value_take_workers (GValue* value, gpointer v_object);
gpointer value_get_workers (const GValue* value);
GType workers_get_type (void) G_GNUC_CONST;
gpointer timed_queue_ref (gpointer instance);
void timed_queue_unref (gpointer instance);
GParamSpec* param_spec_timed_queue (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_timed_queue (GValue* value, gpointer v_object);
void value_take_timed_queue (GValue* value, gpointer v_object);
gpointer value_get_timed_queue (const GValue* value);
GType timed_queue_get_type (void) G_GNUC_CONST;
GType hash_timed_queue_get_type (void) G_GNUC_CONST;
GType data_object_get_type (void) G_GNUC_CONST;
GType data_source_get_type (void) G_GNUC_CONST;
GType thumbnail_source_get_type (void) G_GNUC_CONST;
GType media_source_get_type (void) G_GNUC_CONST;
GType photo_source_get_type (void) G_GNUC_CONST;
GType photo_get_type (void) G_GNUC_CONST;
GType library_photo_get_type (void) G_GNUC_CONST;
gpointer background_job_ref (gpointer instance);
void background_job_unref (gpointer instance);
GParamSpec* param_spec_background_job (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_background_job (GValue* value, gpointer v_object);
void value_take_background_job (GValue* value, gpointer v_object);
gpointer value_get_background_job (const GValue* value);
GType background_job_get_type (void) G_GNUC_CONST;
static GType metadata_writer_commit_job_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define METADATA_WRITER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_METADATA_WRITER, MetadataWriterPrivate))
enum  {
	METADATA_WRITER_DUMMY_PROPERTY
};
GType configuration_facade_get_type (void) G_GNUC_CONST;
GType config_facade_get_type (void) G_GNUC_CONST;
ConfigFacade* config_facade_get_instance (void);
static void metadata_writer_on_config_changed (MetadataWriter* self);
static void _metadata_writer_on_config_changed_configuration_facade_commit_metadata_to_masters_changed (ConfigurationFacade* _sender, gpointer self);
gpointer data_collection_ref (gpointer instance);
void data_collection_unref (gpointer instance);
GParamSpec* param_spec_data_collection (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_collection (GValue* value, gpointer v_object);
void value_take_data_collection (GValue* value, gpointer v_object);
gpointer value_get_data_collection (const GValue* value);
GType data_collection_get_type (void) G_GNUC_CONST;
GType source_collection_get_type (void) G_GNUC_CONST;
GType database_source_collection_get_type (void) G_GNUC_CONST;
GType media_source_collection_get_type (void) G_GNUC_CONST;
GType library_photo_source_collection_get_type (void) G_GNUC_CONST;
static void metadata_writer_on_importing_photos (MetadataWriter* self, GeeCollection* media_sources);
static void _metadata_writer_on_importing_photos_media_source_collection_media_import_starting (MediaSourceCollection* _sender, GeeCollection* media, gpointer self);
static void metadata_writer_on_photos_imported (MetadataWriter* self, GeeCollection* media_sources);
static void _metadata_writer_on_photos_imported_media_source_collection_media_import_completed (MediaSourceCollection* _sender, GeeCollection* media, gpointer self);
static void metadata_writer_on_photos_added_removed (MetadataWriter* self, GeeIterable* added, GeeIterable* removed);
static void _metadata_writer_on_photos_added_removed_data_collection_contents_altered (DataCollection* _sender, GeeIterable* added, GeeIterable* removed, gpointer self);
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_alteration (GValue* value, gpointer v_object);
void value_take_alteration (GValue* value, gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
static void metadata_writer_on_photos_altered (MetadataWriter* self, GeeMap* items);
static void _metadata_writer_on_photos_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self);
static void metadata_writer_on_collection_frozen (MetadataWriter* self);
static void _metadata_writer_on_collection_frozen_data_collection_frozen (DataCollection* _sender, gpointer self);
static void metadata_writer_on_collection_thawed (MetadataWriter* self);
static void _metadata_writer_on_collection_thawed_data_collection_thawed (DataCollection* _sender, gpointer self);
static void metadata_writer_on_photos_destroyed (MetadataWriter* self, GeeCollection* destroyed);
static void _metadata_writer_on_photos_destroyed_source_collection_items_destroyed (SourceCollection* _sender, GeeCollection* destroyed, gpointer self);
GType container_source_collection_get_type (void) G_GNUC_CONST;
GType tag_source_collection_get_type (void) G_GNUC_CONST;
static void metadata_writer_on_tags_altered (MetadataWriter* self, GeeMap* map);
static void _metadata_writer_on_tags_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self);
gpointer source_backlink_ref (gpointer instance);
void source_backlink_unref (gpointer instance);
GParamSpec* param_spec_source_backlink (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_source_backlink (GValue* value, gpointer v_object);
void value_take_source_backlink (GValue* value, gpointer v_object);
gpointer value_get_source_backlink (const GValue* value);
GType source_backlink_get_type (void) G_GNUC_CONST;
GType container_source_get_type (void) G_GNUC_CONST;
static void metadata_writer_on_tag_contents_altered (MetadataWriter* self, ContainerSource* container, GeeCollection* added, gboolean relinking, GeeCollection* removed, gboolean unlinking);
static void _metadata_writer_on_tag_contents_altered_container_source_collection_container_contents_altered (ContainerSourceCollection* _sender, ContainerSource* container, GeeCollection* added, gboolean relinked, GeeCollection* removed, gboolean unlinked, gpointer self);
static void metadata_writer_on_tag_backlink_removed (MetadataWriter* self, ContainerSource* container, GeeCollection* sources);
static void _metadata_writer_on_tag_backlink_removed_container_source_collection_backlink_to_container_removed (ContainerSourceCollection* _sender, ContainerSource* container, GeeCollection* sources, gpointer self);
gpointer application_ref (gpointer instance);
void application_unref (gpointer instance);
GParamSpec* param_spec_application (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_application (GValue* value, gpointer v_object);
void value_take_application (GValue* value, gpointer v_object);
gpointer value_get_application (const GValue* value);
GType application_get_type (void) G_GNUC_CONST;
Application* application_get_instance (void);
static void metadata_writer_on_application_exiting (MetadataWriter* self);
static void _metadata_writer_on_application_exiting_application_exiting (Application* _sender, gboolean panicked, gpointer self);
gpointer library_monitor_pool_ref (gpointer instance);
void library_monitor_pool_unref (gpointer instance);
GParamSpec* param_spec_library_monitor_pool (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_library_monitor_pool (GValue* value, gpointer v_object);
void value_take_library_monitor_pool (GValue* value, gpointer v_object);
gpointer value_get_library_monitor_pool (const GValue* value);
GType library_monitor_pool_get_type (void) G_GNUC_CONST;
LibraryMonitorPool* library_monitor_pool_get_instance (void);
GType directory_monitor_get_type (void) G_GNUC_CONST;
GType library_monitor_get_type (void) G_GNUC_CONST;
static void metadata_writer_on_monitor_installed (MetadataWriter* self, LibraryMonitor* monitor);
static void _metadata_writer_on_monitor_installed_library_monitor_pool_monitor_installed (LibraryMonitorPool* _sender, LibraryMonitor* monitor, gpointer self);
static void metadata_writer_on_monitor_destroyed (MetadataWriter* self, LibraryMonitor* monitor);
static void _metadata_writer_on_monitor_destroyed_library_monitor_pool_monitor_destroyed (LibraryMonitorPool* _sender, LibraryMonitor* monitor, gpointer self);
Workers* workers_new (guint max_threads, gboolean exclusive);
Workers* workers_construct (GType object_type, guint max_threads, gboolean exclusive);
#define METADATA_WRITER_COMMIT_DELAY_MSEC ((guint) 3000)
#define METADATA_WRITER_COMMIT_SPACING_MSEC ((guint) 50)
static MetadataWriter* metadata_writer_new (void);
static MetadataWriter* metadata_writer_construct (GType object_type);
static void metadata_writer_on_photo_dequeued (MetadataWriter* self, LibraryPhoto* photo);
static void _metadata_writer_on_photo_dequeued_dequeued_callback (gconstpointer item, gpointer self);
HashTimedQueue* hash_timed_queue_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, guint hold_msec, DequeuedCallback callback, void* callback_target, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify, gint priority);
HashTimedQueue* hash_timed_queue_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, guint hold_msec, DequeuedCallback callback, void* callback_target, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify, gint priority);
void timed_queue_set_dequeue_spacing_msec (TimedQueue* self, guint msec);
void metadata_writer_pause (MetadataWriter* self);
gboolean configuration_facade_get_commit_metadata_to_masters (ConfigurationFacade* self);
void metadata_writer_force_rescan (MetadataWriter* self);
void metadata_writer_init (void);
void metadata_writer_terminate (void);
void metadata_writer_close (MetadataWriter* self);
MetadataWriter* metadata_writer_get_instance (void);
static void metadata_writer_schedule_if_dirty (MetadataWriter* self, GeeIterable* media_sources, const gchar* reason);
GeeCollection* data_collection_get_all (DataCollection* self);
void timed_queue_pause (TimedQueue* self);
void metadata_writer_unpause (MetadataWriter* self);
void timed_queue_unpause (TimedQueue* self);
static void metadata_writer_cancel_all (MetadataWriter* self, gboolean wait);
static void metadata_writer_on_discovery_completed (MetadataWriter* self);
static void _metadata_writer_on_discovery_completed_directory_monitor_discovery_completed (DirectoryMonitor* _sender, gpointer self);
static gboolean metadata_writer_cancel_job (MetadataWriter* self, LibraryPhoto* photo);
gboolean alteration_has_detail (Alteration* self, const gchar* subject, const gchar* detail);
GeeCollection* alteration_get_details (Alteration* self, const gchar* subject);
static void metadata_writer_photos_are_dirty (MetadataWriter* self, GeeCollection* photos, const gchar* reason, gboolean already_marked);
GType tag_get_type (void) G_GNUC_CONST;
GeeCollection* tag_get_sources (Tag* self);
gchar* data_object_to_string (DataObject* self);
static void metadata_writer_count_enqueued_work (MetadataWriter* self, gint count, gboolean report);
static void metadata_writer_count_cancelled_work (MetadataWriter* self, gint count, gboolean report);
static void metadata_writer_count_completed_work (MetadataWriter* self, gint count, gboolean report);
gboolean photo_is_master_metadata_dirty (Photo* self);
gpointer transaction_controller_ref (gpointer instance);
void transaction_controller_unref (gpointer instance);
GParamSpec* param_spec_transaction_controller (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_transaction_controller (GValue* value, gpointer v_object);
void value_take_transaction_controller (GValue* value, gpointer v_object);
gpointer value_get_transaction_controller (const GValue* value);
GType transaction_controller_get_type (void) G_GNUC_CONST;
TransactionController* media_source_collection_get_transaction_controller (MediaSourceCollection* self);
void transaction_controller_begin (TransactionController* self);
GQuark database_error_quark (void);
void photo_set_master_metadata_dirty (Photo* self, gboolean dirty, GError** error);
void transaction_controller_commit (TransactionController* self);
void app_window_database_error (GError* err);
gboolean timed_queue_enqueue (TimedQueue* self, gconstpointer item);
void timed_queue_clear (TimedQueue* self);
void background_job_cancel (BackgroundJob* self);
void workers_wait_for_empty_queue (Workers* self);
gboolean timed_queue_contains (TimedQueue* self, gconstpointer item);
gboolean timed_queue_remove_first (TimedQueue* self, gconstpointer item);
GeeList* tag_source_collection_fetch_for_source (TagSourceCollection* self, MediaSource* source);
gchar* data_object_get_name (DataObject* self);
static MetadataWriterCommitJob* metadata_writer_commit_job_new (MetadataWriter* owner, LibraryPhoto* photo, GeeSet* keywords);
static MetadataWriterCommitJob* metadata_writer_commit_job_construct (GType object_type, MetadataWriter* owner, LibraryPhoto* photo, GeeSet* keywords);
void workers_enqueue (Workers* self, BackgroundJob* job);
static void metadata_writer_on_update_completed (MetadataWriter* self, BackgroundJob* j);
GType background_job_job_priority_get_type (void) G_GNUC_CONST;
gpointer photo_reimport_master_state_ref (gpointer instance);
void photo_reimport_master_state_unref (gpointer instance);
GParamSpec* photo_param_spec_reimport_master_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void photo_value_set_reimport_master_state (GValue* value, gpointer v_object);
void photo_value_take_reimport_master_state (GValue* value, gpointer v_object);
gpointer photo_value_get_reimport_master_state (const GValue* value);
GType photo_reimport_master_state_get_type (void) G_GNUC_CONST;
gpointer photo_reimport_editable_state_ref (gpointer instance);
void photo_reimport_editable_state_unref (gpointer instance);
GParamSpec* photo_param_spec_reimport_editable_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void photo_value_set_reimport_editable_state (GValue* value, gpointer v_object);
void photo_value_take_reimport_editable_state (GValue* value, gpointer v_object);
gpointer photo_value_get_reimport_editable_state (const GValue* value);
GType photo_reimport_editable_state_get_type (void) G_GNUC_CONST;
GFile* media_source_get_master_file (MediaSource* self);
GFile* photo_get_editable_file (Photo* self);
void photo_finish_update_master_metadata (Photo* self, PhotoReimportMasterState* state, GError** error);
void photo_finish_update_editable_metadata (Photo* self, PhotoReimportEditableState* state, GError** error);
static void metadata_writer_on_update_cancelled (MetadataWriter* self, BackgroundJob* j);
static void g_cclosure_user_marshal_VOID__UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
enum  {
	METADATA_WRITER_COMMIT_JOB_DUMMY_PROPERTY
};
static void _metadata_writer_on_update_completed_completion_callback (BackgroundJob* job, gpointer self);
static void _metadata_writer_on_update_cancelled_cancellation_callback (BackgroundJob* job, gpointer self);
gpointer abstract_semaphore_ref (gpointer instance);
void abstract_semaphore_unref (gpointer instance);
GParamSpec* param_spec_abstract_semaphore (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_abstract_semaphore (GValue* value, gpointer v_object);
void value_take_abstract_semaphore (GValue* value, gpointer v_object);
gpointer value_get_abstract_semaphore (const GValue* value);
GType abstract_semaphore_get_type (void) G_GNUC_CONST;
BackgroundJob* background_job_construct (GType object_type, GObject* owner, CompletionCallback callback, void* callback_target, GCancellable* cancellable, CancellationCallback cancellation, void* cancellation_target, AbstractSemaphore* completion_semaphore);
static void metadata_writer_commit_job_real_execute (BackgroundJob* base);
static void metadata_writer_commit_job_commit_master (MetadataWriterCommitJob* self, GError** error);
static void metadata_writer_commit_job_commit_editable (MetadataWriterCommitJob* self, GError** error);
gboolean photo_has_editable (Photo* self);
GType photo_file_format_get_type (void) G_GNUC_CONST;
PhotoFileFormat photo_get_master_file_format (Photo* self);
gboolean photo_file_format_can_write_metadata (PhotoFileFormat self);
gpointer media_metadata_ref (gpointer instance);
void media_metadata_unref (gpointer instance);
GParamSpec* param_spec_media_metadata (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_media_metadata (GValue* value, gpointer v_object);
void value_take_media_metadata (GValue* value, gpointer v_object);
gpointer value_get_media_metadata (const GValue* value);
GType media_metadata_get_type (void) G_GNUC_CONST;
GType photo_metadata_get_type (void) G_GNUC_CONST;
PhotoMetadata* photo_get_master_metadata (Photo* self, GError** error);
static gboolean metadata_writer_commit_job_update_metadata (MetadataWriterCommitJob* self, PhotoMetadata* metadata, gboolean skip_orientation);
void library_monitor_blacklist_file (GFile* file, const gchar* reason);
gboolean photo_persist_master_metadata (Photo* self, PhotoMetadata* metadata, PhotoReimportMasterState** state, GError** error);
void library_monitor_unblacklist_file (GFile* file);
PhotoFileFormat* photo_get_editable_file_format (Photo* self);
PhotoMetadata* photo_get_editable_metadata (Photo* self, GError** error);
gboolean photo_persist_editable_metadata (Photo* self, PhotoMetadata* metadata, PhotoReimportEditableState** state, GError** error);
gchar* media_source_get_title (MediaSource* self);
gchar* media_metadata_get_title (MediaMetadata* self);
GType photo_metadata_set_option_get_type (void) G_GNUC_CONST;
void photo_metadata_set_title (PhotoMetadata* self, const gchar* title, PhotoMetadataSetOption option);
gchar* media_source_get_comment (MediaSource* self);
gchar* media_metadata_get_comment (MediaMetadata* self);
void photo_metadata_set_comment (PhotoMetadata* self, const gchar* comment);
GType rating_get_type (void) G_GNUC_CONST;
Rating media_source_get_rating (MediaSource* self);
Rating photo_metadata_get_rating (PhotoMetadata* self);
void photo_metadata_set_rating (PhotoMetadata* self, Rating rating);
time_t media_source_get_exposure_time (MediaSource* self);
gpointer metadata_date_time_ref (gpointer instance);
void metadata_date_time_unref (gpointer instance);
GParamSpec* param_spec_metadata_date_time (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_metadata_date_time (GValue* value, gpointer v_object);
void value_take_metadata_date_time (GValue* value, gpointer v_object);
gpointer value_get_metadata_date_time (const GValue* value);
GType metadata_date_time_get_type (void) G_GNUC_CONST;
MetadataDateTime* photo_metadata_get_exposure_date_time (PhotoMetadata* self);
time_t metadata_date_time_get_timestamp (MetadataDateTime* self);
MetadataDateTime* metadata_date_time_new (time_t timestamp);
MetadataDateTime* metadata_date_time_construct (GType object_type, time_t timestamp);
void photo_metadata_set_exposure_date_time (PhotoMetadata* self, MetadataDateTime* date_time, PhotoMetadataSetOption option);
Tag* tag_for_path (const gchar* name);
gchar* tag_get_user_visible_name (Tag* self);
gboolean equal_sets (GeeSet* a, GeeSet* b);
GeeSet* photo_metadata_get_keywords (PhotoMetadata* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
void photo_metadata_set_keywords (PhotoMetadata* self, GeeCollection* keywords, PhotoMetadataSetOption option);
GType orientation_get_type (void) G_GNUC_CONST;
Orientation photo_get_orientation (Photo* self);
Orientation photo_metadata_get_orientation (PhotoMetadata* self);
void photo_metadata_set_orientation (PhotoMetadata* self, Orientation orientation);
void photo_metadata_set_software (PhotoMetadata* self, const gchar* software, const gchar* version);
#define RESOURCES_APP_TITLE "Shotwell"
#define RESOURCES_APP_VERSION _VERSION
static void metadata_writer_commit_job_finalize (BackgroundJob* obj);
static void metadata_writer_finalize (GObject* obj);

static const gchar* METADATA_WRITER_INTERESTED_PHOTO_METADATA_DETAILS[4] = {"name", "comment", "rating", "exposure-time"};

static void _metadata_writer_on_config_changed_configuration_facade_commit_metadata_to_masters_changed (ConfigurationFacade* _sender, gpointer self) {
#line 220 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_config_changed ((MetadataWriter*) self);
#line 828 "MetadataWriter.c"
}


static void _metadata_writer_on_importing_photos_media_source_collection_media_import_starting (MediaSourceCollection* _sender, GeeCollection* media, gpointer self) {
#line 222 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_importing_photos ((MetadataWriter*) self, media);
#line 835 "MetadataWriter.c"
}


static void _metadata_writer_on_photos_imported_media_source_collection_media_import_completed (MediaSourceCollection* _sender, GeeCollection* media, gpointer self) {
#line 223 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_photos_imported ((MetadataWriter*) self, media);
#line 842 "MetadataWriter.c"
}


static void _metadata_writer_on_photos_added_removed_data_collection_contents_altered (DataCollection* _sender, GeeIterable* added, GeeIterable* removed, gpointer self) {
#line 224 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_photos_added_removed ((MetadataWriter*) self, added, removed);
#line 849 "MetadataWriter.c"
}


static void _metadata_writer_on_photos_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self) {
#line 225 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_photos_altered ((MetadataWriter*) self, items);
#line 856 "MetadataWriter.c"
}


static void _metadata_writer_on_collection_frozen_data_collection_frozen (DataCollection* _sender, gpointer self) {
#line 226 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_collection_frozen ((MetadataWriter*) self);
#line 863 "MetadataWriter.c"
}


static void _metadata_writer_on_collection_thawed_data_collection_thawed (DataCollection* _sender, gpointer self) {
#line 227 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_collection_thawed ((MetadataWriter*) self);
#line 870 "MetadataWriter.c"
}


static void _metadata_writer_on_photos_destroyed_source_collection_items_destroyed (SourceCollection* _sender, GeeCollection* destroyed, gpointer self) {
#line 228 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_photos_destroyed ((MetadataWriter*) self, destroyed);
#line 877 "MetadataWriter.c"
}


static void _metadata_writer_on_tags_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self) {
#line 230 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_tags_altered ((MetadataWriter*) self, items);
#line 884 "MetadataWriter.c"
}


static void _metadata_writer_on_tag_contents_altered_container_source_collection_container_contents_altered (ContainerSourceCollection* _sender, ContainerSource* container, GeeCollection* added, gboolean relinked, GeeCollection* removed, gboolean unlinked, gpointer self) {
#line 231 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_tag_contents_altered ((MetadataWriter*) self, container, added, relinked, removed, unlinked);
#line 891 "MetadataWriter.c"
}


static void _metadata_writer_on_tag_backlink_removed_container_source_collection_backlink_to_container_removed (ContainerSourceCollection* _sender, ContainerSource* container, GeeCollection* sources, gpointer self) {
#line 232 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_tag_backlink_removed ((MetadataWriter*) self, container, sources);
#line 898 "MetadataWriter.c"
}


static void _metadata_writer_on_application_exiting_application_exiting (Application* _sender, gboolean panicked, gpointer self) {
#line 236 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_application_exiting ((MetadataWriter*) self);
#line 905 "MetadataWriter.c"
}


static void _metadata_writer_on_monitor_installed_library_monitor_pool_monitor_installed (LibraryMonitorPool* _sender, LibraryMonitor* monitor, gpointer self) {
#line 238 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_monitor_installed ((MetadataWriter*) self, monitor);
#line 912 "MetadataWriter.c"
}


static void _metadata_writer_on_monitor_destroyed_library_monitor_pool_monitor_destroyed (LibraryMonitorPool* _sender, LibraryMonitor* monitor, gpointer self) {
#line 239 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_monitor_destroyed ((MetadataWriter*) self, monitor);
#line 919 "MetadataWriter.c"
}


static void _metadata_writer_on_photo_dequeued_dequeued_callback (gconstpointer item, gpointer self) {
#line 180 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_photo_dequeued ((MetadataWriter*) self, (LibraryPhoto*) item);
#line 926 "MetadataWriter.c"
}


static MetadataWriter* metadata_writer_construct (GType object_type) {
	MetadataWriter * self = NULL;
	HashTimedQueue* _tmp0_ = NULL;
	HashTimedQueue* _tmp1_ = NULL;
	ConfigFacade* _tmp5_ = NULL;
	ConfigFacade* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	ConfigFacade* _tmp8_ = NULL;
	ConfigFacade* _tmp9_ = NULL;
	LibraryPhotoSourceCollection* _tmp10_ = NULL;
	LibraryPhotoSourceCollection* _tmp11_ = NULL;
	LibraryPhotoSourceCollection* _tmp12_ = NULL;
	LibraryPhotoSourceCollection* _tmp13_ = NULL;
	LibraryPhotoSourceCollection* _tmp14_ = NULL;
	LibraryPhotoSourceCollection* _tmp15_ = NULL;
	LibraryPhotoSourceCollection* _tmp16_ = NULL;
	TagSourceCollection* _tmp17_ = NULL;
	TagSourceCollection* _tmp18_ = NULL;
	TagSourceCollection* _tmp19_ = NULL;
	TagSourceCollection* _tmp20_ = NULL;
	TagSourceCollection* _tmp21_ = NULL;
	Application* _tmp22_ = NULL;
	Application* _tmp23_ = NULL;
	LibraryMonitorPool* _tmp24_ = NULL;
	LibraryMonitorPool* _tmp25_ = NULL;
	LibraryMonitorPool* _tmp26_ = NULL;
	LibraryMonitorPool* _tmp27_ = NULL;
#line 179 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self = (MetadataWriter*) g_object_new (object_type, NULL);
#line 180 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = hash_timed_queue_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, METADATA_WRITER_COMMIT_DELAY_MSEC, _metadata_writer_on_photo_dequeued_dequeued_callback, self, NULL, NULL, NULL, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
#line 180 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_timed_queue_unref0 (self->priv->dirty);
#line 180 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->dirty = _tmp0_;
#line 181 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = self->priv->dirty;
#line 181 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	timed_queue_set_dequeue_spacing_msec (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_TIMED_QUEUE, TimedQueue), METADATA_WRITER_COMMIT_SPACING_MSEC);
#line 186 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_pause (self);
#line 971 "MetadataWriter.c"
	{
		const gchar** detail_collection = NULL;
		gint detail_collection_length1 = 0;
		gint _detail_collection_size_ = 0;
		gint detail_it = 0;
#line 189 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		detail_collection = METADATA_WRITER_INTERESTED_PHOTO_METADATA_DETAILS;
#line 189 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		detail_collection_length1 = G_N_ELEMENTS (METADATA_WRITER_INTERESTED_PHOTO_METADATA_DETAILS);
#line 189 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		for (detail_it = 0; detail_it < G_N_ELEMENTS (METADATA_WRITER_INTERESTED_PHOTO_METADATA_DETAILS); detail_it = detail_it + 1) {
#line 983 "MetadataWriter.c"
			gchar* _tmp2_ = NULL;
			gchar* detail = NULL;
#line 189 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp2_ = g_strdup (detail_collection[detail_it]);
#line 189 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			detail = _tmp2_;
#line 990 "MetadataWriter.c"
			{
				GeeHashSet* _tmp3_ = NULL;
				const gchar* _tmp4_ = NULL;
#line 190 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp3_ = self->priv->interested_photo_details;
#line 190 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp4_ = detail;
#line 190 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp4_);
#line 189 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_free0 (detail);
#line 1002 "MetadataWriter.c"
			}
		}
	}
#line 193 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = config_facade_get_instance ();
#line 193 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp6_ = _tmp5_;
#line 193 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
#line 193 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->enabled = _tmp7_;
#line 193 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp6_);
#line 194 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp8_ = config_facade_get_instance ();
#line 194 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp9_ = _tmp8_;
#line 194 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), "commit-metadata-to-masters-changed", (GCallback) _metadata_writer_on_config_changed_configuration_facade_commit_metadata_to_masters_changed, self, 0);
#line 194 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp9_);
#line 197 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_force_rescan (self);
#line 199 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp10_ = library_photo_global;
#line 199 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), "media-import-starting", (GCallback) _metadata_writer_on_importing_photos_media_source_collection_media_import_starting, self, 0);
#line 200 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp11_ = library_photo_global;
#line 200 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), "media-import-completed", (GCallback) _metadata_writer_on_photos_imported_media_source_collection_media_import_completed, self, 0);
#line 201 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp12_ = library_photo_global;
#line 201 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _metadata_writer_on_photos_added_removed_data_collection_contents_altered, self, 0);
#line 202 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp13_ = library_photo_global;
#line 202 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _metadata_writer_on_photos_altered_data_collection_items_altered, self, 0);
#line 203 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp14_ = library_photo_global;
#line 203 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_DATA_COLLECTION, DataCollection), "frozen", (GCallback) _metadata_writer_on_collection_frozen_data_collection_frozen, self, 0);
#line 204 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp15_ = library_photo_global;
#line 204 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_DATA_COLLECTION, DataCollection), "thawed", (GCallback) _metadata_writer_on_collection_thawed_data_collection_thawed, self, 0);
#line 205 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp16_ = library_photo_global;
#line 205 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_SOURCE_COLLECTION, SourceCollection), "items-destroyed", (GCallback) _metadata_writer_on_photos_destroyed_source_collection_items_destroyed, self, 0);
#line 207 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp17_ = tag_global;
#line 207 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _metadata_writer_on_tags_altered_data_collection_items_altered, self, 0);
#line 208 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp18_ = tag_global;
#line 208 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection), "container-contents-altered", (GCallback) _metadata_writer_on_tag_contents_altered_container_source_collection_container_contents_altered, self, 0);
#line 209 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp19_ = tag_global;
#line 209 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection), "backlink-to-container-removed", (GCallback) _metadata_writer_on_tag_backlink_removed_container_source_collection_backlink_to_container_removed, self, 0);
#line 210 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp20_ = tag_global;
#line 210 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_DATA_COLLECTION, DataCollection), "frozen", (GCallback) _metadata_writer_on_collection_frozen_data_collection_frozen, self, 0);
#line 211 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp21_ = tag_global;
#line 211 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_DATA_COLLECTION, DataCollection), "thawed", (GCallback) _metadata_writer_on_collection_thawed_data_collection_thawed, self, 0);
#line 213 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp22_ = application_get_instance ();
#line 213 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp23_ = _tmp22_;
#line 213 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (_tmp23_, "exiting", (GCallback) _metadata_writer_on_application_exiting_application_exiting, self, 0);
#line 213 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_application_unref0 (_tmp23_);
#line 215 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp24_ = library_monitor_pool_get_instance ();
#line 215 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp25_ = _tmp24_;
#line 215 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (_tmp25_, "monitor-installed", (GCallback) _metadata_writer_on_monitor_installed_library_monitor_pool_monitor_installed, self, 0);
#line 215 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_library_monitor_pool_unref0 (_tmp25_);
#line 216 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp26_ = library_monitor_pool_get_instance ();
#line 216 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp27_ = _tmp26_;
#line 216 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (_tmp27_, "monitor-destroyed", (GCallback) _metadata_writer_on_monitor_destroyed_library_monitor_pool_monitor_destroyed, self, 0);
#line 216 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_library_monitor_pool_unref0 (_tmp27_);
#line 179 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return self;
#line 1100 "MetadataWriter.c"
}


static MetadataWriter* metadata_writer_new (void) {
#line 179 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return metadata_writer_construct (TYPE_METADATA_WRITER);
#line 1107 "MetadataWriter.c"
}


void metadata_writer_init (void) {
	MetadataWriter* _tmp0_ = NULL;
#line 243 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = metadata_writer_new ();
#line 243 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (metadata_writer_instance);
#line 243 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_instance = _tmp0_;
#line 1119 "MetadataWriter.c"
}


void metadata_writer_terminate (void) {
	MetadataWriter* _tmp0_ = NULL;
#line 247 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = metadata_writer_instance;
#line 247 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp0_ != NULL) {
#line 1129 "MetadataWriter.c"
		MetadataWriter* _tmp1_ = NULL;
#line 248 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = metadata_writer_instance;
#line 248 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_close (_tmp1_);
#line 1135 "MetadataWriter.c"
	}
#line 250 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (metadata_writer_instance);
#line 250 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_instance = NULL;
#line 1141 "MetadataWriter.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 254 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return self ? g_object_ref (self) : NULL;
#line 1148 "MetadataWriter.c"
}


MetadataWriter* metadata_writer_get_instance (void) {
	MetadataWriter* result = NULL;
	MetadataWriter* _tmp0_ = NULL;
	MetadataWriter* _tmp1_ = NULL;
#line 254 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = metadata_writer_instance;
#line 254 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 254 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	result = _tmp1_;
#line 254 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return result;
#line 1164 "MetadataWriter.c"
}


void metadata_writer_force_rescan (MetadataWriter* self) {
	LibraryPhotoSourceCollection* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* _tmp2_ = NULL;
#line 258 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 259 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = library_photo_global;
#line 259 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = data_collection_get_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_COLLECTION, DataCollection));
#line 259 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection);
#line 259 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_schedule_if_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ITERABLE, GeeIterable), "force rescan");
#line 259 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp2_);
#line 1184 "MetadataWriter.c"
}


void metadata_writer_pause (MetadataWriter* self) {
	gint _tmp0_ = 0;
	HashTimedQueue* _tmp1_ = NULL;
#line 262 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 263 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->pause_count;
#line 263 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->pause_count = _tmp0_ + 1;
#line 263 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp0_ != 0) {
#line 264 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 1201 "MetadataWriter.c"
	}
#line 266 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = self->priv->dirty;
#line 266 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	timed_queue_pause (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_TIMED_QUEUE, TimedQueue));
#line 268 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_emit_by_name (self, "progress", (guint) 0, (guint) 0);
#line 1209 "MetadataWriter.c"
}


void metadata_writer_unpause (MetadataWriter* self) {
	gboolean _tmp0_ = FALSE;
	gint _tmp1_ = 0;
	HashTimedQueue* _tmp4_ = NULL;
#line 271 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = self->priv->pause_count;
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp1_ == 0) {
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = TRUE;
#line 1225 "MetadataWriter.c"
	} else {
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = self->priv->pause_count;
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->priv->pause_count = _tmp2_ - 1;
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = self->priv->pause_count;
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = _tmp3_ != 0;
#line 1237 "MetadataWriter.c"
	}
#line 272 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp0_) {
#line 273 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 1243 "MetadataWriter.c"
	}
#line 275 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = self->priv->dirty;
#line 275 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	timed_queue_unpause (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_TIMED_QUEUE, TimedQueue));
#line 1249 "MetadataWriter.c"
}


void metadata_writer_close (MetadataWriter* self) {
	gboolean _tmp0_ = FALSE;
#line 278 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 279 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->closed;
#line 279 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp0_) {
#line 280 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 1263 "MetadataWriter.c"
	}
#line 282 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_cancel_all (self, TRUE);
#line 284 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->closed = TRUE;
#line 1269 "MetadataWriter.c"
}


static void metadata_writer_on_config_changed (MetadataWriter* self) {
	gboolean value = FALSE;
	ConfigFacade* _tmp0_ = NULL;
	ConfigFacade* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
#line 287 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 288 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = config_facade_get_instance ();
#line 288 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = _tmp0_;
#line 288 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = configuration_facade_get_commit_metadata_to_masters (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
#line 288 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = _tmp2_;
#line 288 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp1_);
#line 288 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	value = _tmp3_;
#line 290 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = self->priv->enabled;
#line 290 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = value;
#line 290 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp4_ == _tmp5_) {
#line 291 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 1305 "MetadataWriter.c"
	}
#line 293 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp6_ = value;
#line 293 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->enabled = _tmp6_;
#line 294 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = self->priv->enabled;
#line 294 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp7_) {
#line 295 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_force_rescan (self);
#line 1317 "MetadataWriter.c"
	} else {
#line 297 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_cancel_all (self, FALSE);
#line 1321 "MetadataWriter.c"
	}
}


static void metadata_writer_on_application_exiting (MetadataWriter* self) {
#line 300 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 301 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_close (self);
#line 1331 "MetadataWriter.c"
}


static void _metadata_writer_on_discovery_completed_directory_monitor_discovery_completed (DirectoryMonitor* _sender, gpointer self) {
#line 305 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_discovery_completed ((MetadataWriter*) self);
#line 1338 "MetadataWriter.c"
}


static void metadata_writer_on_monitor_installed (MetadataWriter* self, LibraryMonitor* monitor) {
	LibraryMonitor* _tmp0_ = NULL;
#line 304 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 304 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_LIBRARY_MONITOR (monitor));
#line 305 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = monitor;
#line 305 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), "discovery-completed", (GCallback) _metadata_writer_on_discovery_completed_directory_monitor_discovery_completed, self, 0);
#line 1352 "MetadataWriter.c"
}


static void metadata_writer_on_monitor_destroyed (MetadataWriter* self, LibraryMonitor* monitor) {
	LibraryMonitor* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
#line 308 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 308 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_LIBRARY_MONITOR (monitor));
#line 309 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = monitor;
#line 309 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("discovery-completed", TYPE_DIRECTORY_MONITOR, &_tmp1_, NULL, FALSE);
#line 309 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _metadata_writer_on_discovery_completed_directory_monitor_discovery_completed, self);
#line 1369 "MetadataWriter.c"
}


static void metadata_writer_on_discovery_completed (MetadataWriter* self) {
#line 312 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 313 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_unpause (self);
#line 1378 "MetadataWriter.c"
}


static void metadata_writer_on_collection_frozen (MetadataWriter* self) {
#line 316 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 317 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_pause (self);
#line 1387 "MetadataWriter.c"
}


static void metadata_writer_on_collection_thawed (MetadataWriter* self) {
#line 320 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 321 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_unpause (self);
#line 1396 "MetadataWriter.c"
}


static void metadata_writer_on_importing_photos (MetadataWriter* self, GeeCollection* media_sources) {
	GeeHashSet* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
#line 324 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 324 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_COLLECTION (media_sources));
#line 325 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->importing_photos;
#line 325 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = media_sources;
#line 325 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
#line 1413 "MetadataWriter.c"
}


static void metadata_writer_on_photos_imported (MetadataWriter* self, GeeCollection* media_sources) {
	GeeHashSet* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
#line 328 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 328 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_COLLECTION (media_sources));
#line 329 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->importing_photos;
#line 329 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = media_sources;
#line 329 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	gee_collection_remove_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
#line 1430 "MetadataWriter.c"
}


static void metadata_writer_on_photos_added_removed (MetadataWriter* self, GeeIterable* added, GeeIterable* removed) {
	gboolean _tmp0_ = FALSE;
	GeeIterable* _tmp1_ = NULL;
	GeeIterable* _tmp4_ = NULL;
#line 332 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 332 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_ITERABLE (added));
#line 332 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_ITERABLE (removed));
#line 335 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = added;
#line 335 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp1_ != NULL) {
#line 1448 "MetadataWriter.c"
		gboolean _tmp2_ = FALSE;
#line 335 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = self->priv->enabled;
#line 335 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = _tmp2_;
#line 1454 "MetadataWriter.c"
	} else {
#line 335 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = FALSE;
#line 1458 "MetadataWriter.c"
	}
#line 335 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp0_) {
#line 1462 "MetadataWriter.c"
		GeeIterable* _tmp3_ = NULL;
#line 336 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = added;
#line 336 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_schedule_if_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable), "added to LibraryPhoto.global");
#line 1468 "MetadataWriter.c"
	}
#line 339 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = removed;
#line 339 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp4_ != NULL) {
#line 1474 "MetadataWriter.c"
		gboolean cancelled = FALSE;
		gboolean _tmp15_ = FALSE;
#line 340 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		cancelled = FALSE;
#line 1479 "MetadataWriter.c"
		{
			GeeIterator* _object_it = NULL;
			GeeIterable* _tmp5_ = NULL;
			GeeIterator* _tmp6_ = NULL;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp5_ = removed;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = gee_iterable_iterator (_tmp5_);
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_object_it = _tmp6_;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			while (TRUE) {
#line 1492 "MetadataWriter.c"
				GeeIterator* _tmp7_ = NULL;
				gboolean _tmp8_ = FALSE;
				DataObject* object = NULL;
				GeeIterator* _tmp9_ = NULL;
				gpointer _tmp10_ = NULL;
				gboolean _tmp11_ = FALSE;
				DataObject* _tmp12_ = NULL;
				gboolean _tmp13_ = FALSE;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp7_ = _object_it;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp8_ = gee_iterator_next (_tmp7_);
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (!_tmp8_) {
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					break;
#line 1509 "MetadataWriter.c"
				}
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp9_ = _object_it;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp10_ = gee_iterator_get (_tmp9_);
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				object = (DataObject*) _tmp10_;
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp12_ = object;
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp13_ = metadata_writer_cancel_job (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (_tmp13_) {
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp11_ = TRUE;
#line 1525 "MetadataWriter.c"
				} else {
					gboolean _tmp14_ = FALSE;
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp14_ = cancelled;
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp11_ = _tmp14_;
#line 1532 "MetadataWriter.c"
				}
#line 342 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				cancelled = _tmp11_;
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (object);
#line 1538 "MetadataWriter.c"
			}
#line 341 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_object_it);
#line 1542 "MetadataWriter.c"
		}
#line 344 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp15_ = cancelled;
#line 344 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (_tmp15_) {
#line 1548 "MetadataWriter.c"
			guint _tmp16_ = 0U;
			guint _tmp17_ = 0U;
#line 345 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp16_ = self->priv->outstanding_completed;
#line 345 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp17_ = self->priv->outstanding_total;
#line 345 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_signal_emit_by_name (self, "progress", _tmp16_, _tmp17_);
#line 1557 "MetadataWriter.c"
		}
	}
}


static void metadata_writer_on_photos_altered (MetadataWriter* self, GeeMap* items) {
	GeeHashSet* photos = NULL;
	GeeHashSet* _tmp39_ = NULL;
#line 349 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 349 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_MAP (items));
#line 350 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	photos = NULL;
#line 1572 "MetadataWriter.c"
	{
		GeeIterator* _object_it = NULL;
		GeeMap* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = items;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = gee_map_get_keys (_tmp0_);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = _tmp1_;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = _tmp2_;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = _tmp4_;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_tmp3_);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_object_it = _tmp5_;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 1599 "MetadataWriter.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			DataObject* object = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			LibraryPhoto* photo = NULL;
			DataObject* _tmp10_ = NULL;
			LibraryPhoto* _tmp11_ = NULL;
			LibraryPhoto* _tmp12_ = NULL;
			LibraryPhoto* _tmp13_ = NULL;
			Alteration* alteration = NULL;
			GeeMap* _tmp14_ = NULL;
			DataObject* _tmp15_ = NULL;
			gpointer _tmp16_ = NULL;
			Alteration* _tmp17_ = NULL;
			gboolean _tmp18_ = FALSE;
			GeeCollection* details = NULL;
			Alteration* _tmp23_ = NULL;
			GeeCollection* _tmp24_ = NULL;
			GeeCollection* _tmp25_ = NULL;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = _object_it;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp7_) {
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 1628 "MetadataWriter.c"
			}
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = _object_it;
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			object = (DataObject*) _tmp9_;
#line 352 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp10_ = object;
#line 352 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 352 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo = _tmp11_;
#line 356 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp12_ = photo;
#line 356 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp13_ = self->priv->ignore_photo_alteration;
#line 356 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp12_ == _tmp13_) {
#line 357 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 357 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (object);
#line 357 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				continue;
#line 1654 "MetadataWriter.c"
			}
#line 359 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp14_ = items;
#line 359 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp15_ = object;
#line 359 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp16_ = gee_map_get (_tmp14_, _tmp15_);
#line 359 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			alteration = (Alteration*) _tmp16_;
#line 362 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp17_ = alteration;
#line 362 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp18_ = alteration_has_detail (_tmp17_, "image", "orientation");
#line 362 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp18_) {
#line 1670 "MetadataWriter.c"
				GeeHashSet* _tmp19_ = NULL;
				GeeHashSet* _tmp21_ = NULL;
				LibraryPhoto* _tmp22_ = NULL;
#line 363 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp19_ = photos;
#line 363 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (_tmp19_ == NULL) {
#line 1678 "MetadataWriter.c"
					GeeHashSet* _tmp20_ = NULL;
#line 364 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp20_ = gee_hash_set_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 364 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_g_object_unref0 (photos);
#line 364 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					photos = _tmp20_;
#line 1686 "MetadataWriter.c"
				}
#line 366 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp21_ = photos;
#line 366 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp22_ = photo;
#line 366 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp22_);
#line 368 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_alteration_unref0 (alteration);
#line 368 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 368 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (object);
#line 368 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				continue;
#line 1702 "MetadataWriter.c"
			}
#line 372 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp23_ = alteration;
#line 372 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp24_ = alteration_get_details (_tmp23_, "metadata");
#line 372 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			details = _tmp24_;
#line 373 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp25_ = details;
#line 373 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp25_ == NULL) {
#line 374 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (details);
#line 374 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_alteration_unref0 (alteration);
#line 374 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 374 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (object);
#line 374 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				continue;
#line 1724 "MetadataWriter.c"
			}
			{
				GeeIterator* _detail_it = NULL;
				GeeCollection* _tmp26_ = NULL;
				GeeIterator* _tmp27_ = NULL;
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp26_ = details;
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp27_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_ITERABLE, GeeIterable));
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_detail_it = _tmp27_;
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				while (TRUE) {
#line 1738 "MetadataWriter.c"
					GeeIterator* _tmp28_ = NULL;
					gboolean _tmp29_ = FALSE;
					gchar* detail = NULL;
					GeeIterator* _tmp30_ = NULL;
					gpointer _tmp31_ = NULL;
					GeeHashSet* _tmp32_ = NULL;
					const gchar* _tmp33_ = NULL;
					gboolean _tmp34_ = FALSE;
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp28_ = _detail_it;
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp29_ = gee_iterator_next (_tmp28_);
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (!_tmp29_) {
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						break;
#line 1755 "MetadataWriter.c"
					}
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp30_ = _detail_it;
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp31_ = gee_iterator_get (_tmp30_);
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					detail = (gchar*) _tmp31_;
#line 378 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp32_ = self->priv->interested_photo_details;
#line 378 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp33_ = detail;
#line 378 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp34_ = gee_abstract_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp33_);
#line 378 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (_tmp34_) {
#line 1771 "MetadataWriter.c"
						GeeHashSet* _tmp35_ = NULL;
						GeeHashSet* _tmp37_ = NULL;
						LibraryPhoto* _tmp38_ = NULL;
#line 379 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp35_ = photos;
#line 379 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						if (_tmp35_ == NULL) {
#line 1779 "MetadataWriter.c"
							GeeHashSet* _tmp36_ = NULL;
#line 380 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
							_tmp36_ = gee_hash_set_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 380 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
							_g_object_unref0 (photos);
#line 380 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
							photos = _tmp36_;
#line 1787 "MetadataWriter.c"
						}
#line 382 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp37_ = photos;
#line 382 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp38_ = photo;
#line 382 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp38_);
#line 384 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_g_free0 (detail);
#line 384 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						break;
#line 1799 "MetadataWriter.c"
					}
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_g_free0 (detail);
#line 1803 "MetadataWriter.c"
				}
#line 377 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (_detail_it);
#line 1807 "MetadataWriter.c"
			}
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (details);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_alteration_unref0 (alteration);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (photo);
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (object);
#line 1817 "MetadataWriter.c"
		}
#line 351 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_object_it);
#line 1821 "MetadataWriter.c"
	}
#line 389 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp39_ = photos;
#line 389 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp39_ != NULL) {
#line 1827 "MetadataWriter.c"
		GeeHashSet* _tmp40_ = NULL;
#line 390 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp40_ = photos;
#line 390 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_photos_are_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, GEE_TYPE_COLLECTION, GeeCollection), "alteration", FALSE);
#line 1833 "MetadataWriter.c"
	}
#line 349 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (photos);
#line 1837 "MetadataWriter.c"
}


static void metadata_writer_on_photos_destroyed (MetadataWriter* self, GeeCollection* destroyed) {
#line 393 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 393 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_COLLECTION (destroyed));
#line 1846 "MetadataWriter.c"
	{
		GeeIterator* _source_it = NULL;
		GeeCollection* _tmp0_ = NULL;
		GeeIterator* _tmp1_ = NULL;
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = destroyed;
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ITERABLE, GeeIterable));
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_source_it = _tmp1_;
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 1859 "MetadataWriter.c"
			GeeIterator* _tmp2_ = NULL;
			gboolean _tmp3_ = FALSE;
			DataSource* source = NULL;
			GeeIterator* _tmp4_ = NULL;
			gpointer _tmp5_ = NULL;
			LibraryPhoto* photo = NULL;
			DataSource* _tmp6_ = NULL;
			LibraryPhoto* _tmp7_ = NULL;
			LibraryPhoto* _tmp8_ = NULL;
			GeeHashSet* _tmp9_ = NULL;
			LibraryPhoto* _tmp10_ = NULL;
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp2_ = _source_it;
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp3_ = gee_iterator_next (_tmp2_);
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp3_) {
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 1879 "MetadataWriter.c"
			}
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp4_ = _source_it;
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp5_ = gee_iterator_get (_tmp4_);
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			source = (DataSource*) _tmp5_;
#line 395 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = source;
#line 395 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_LIBRARY_PHOTO, LibraryPhoto));
#line 395 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo = _tmp7_;
#line 396 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = photo;
#line 396 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			metadata_writer_cancel_job (self, _tmp8_);
#line 397 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = self->priv->importing_photos;
#line 397 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp10_ = photo;
#line 397 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp10_);
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (photo);
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (source);
#line 1907 "MetadataWriter.c"
		}
#line 394 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_source_it);
#line 1911 "MetadataWriter.c"
	}
}


static void metadata_writer_on_tags_altered (MetadataWriter* self, GeeMap* map) {
	GeeHashSet* photos = NULL;
	GeeHashSet* _tmp32_ = NULL;
#line 401 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 401 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_MAP (map));
#line 402 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	photos = NULL;
#line 1925 "MetadataWriter.c"
	{
		GeeIterator* _object_it = NULL;
		GeeMap* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = map;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = gee_map_get_keys (_tmp0_);
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = _tmp1_;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = _tmp2_;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = _tmp4_;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_tmp3_);
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_object_it = _tmp5_;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 1952 "MetadataWriter.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			DataObject* object = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			GeeMap* _tmp10_ = NULL;
			DataObject* _tmp11_ = NULL;
			gpointer _tmp12_ = NULL;
			Alteration* _tmp13_ = NULL;
			gboolean _tmp14_ = FALSE;
			gboolean _tmp15_ = FALSE;
			GeeHashSet* _tmp16_ = NULL;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = _object_it;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp7_) {
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 1973 "MetadataWriter.c"
			}
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = _object_it;
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			object = (DataObject*) _tmp9_;
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp10_ = map;
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp11_ = object;
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp12_ = gee_map_get (_tmp10_, _tmp11_);
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp13_ = (Alteration*) _tmp12_;
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp14_ = alteration_has_detail (_tmp13_, "metadata", "name");
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp15_ = !_tmp14_;
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_alteration_unref0 (_tmp13_);
#line 404 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp15_) {
#line 405 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (object);
#line 405 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				continue;
#line 2001 "MetadataWriter.c"
			}
#line 407 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp16_ = photos;
#line 407 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp16_ == NULL) {
#line 2007 "MetadataWriter.c"
				GeeHashSet* _tmp17_ = NULL;
#line 408 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp17_ = gee_hash_set_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 408 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photos);
#line 408 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				photos = _tmp17_;
#line 2015 "MetadataWriter.c"
			}
			{
				GeeIterator* _media_it = NULL;
				DataObject* _tmp18_ = NULL;
				GeeCollection* _tmp19_ = NULL;
				GeeCollection* _tmp20_ = NULL;
				GeeIterator* _tmp21_ = NULL;
				GeeIterator* _tmp22_ = NULL;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp18_ = object;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp19_ = tag_get_sources (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_TAG, Tag));
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp20_ = _tmp19_;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp21_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_TYPE_ITERABLE, GeeIterable));
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp22_ = _tmp21_;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (_tmp20_);
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_media_it = _tmp22_;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				while (TRUE) {
#line 2040 "MetadataWriter.c"
					GeeIterator* _tmp23_ = NULL;
					gboolean _tmp24_ = FALSE;
					MediaSource* media = NULL;
					GeeIterator* _tmp25_ = NULL;
					gpointer _tmp26_ = NULL;
					LibraryPhoto* photo = NULL;
					MediaSource* _tmp27_ = NULL;
					LibraryPhoto* _tmp28_ = NULL;
					LibraryPhoto* _tmp29_ = NULL;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp23_ = _media_it;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp24_ = gee_iterator_next (_tmp23_);
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (!_tmp24_) {
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						break;
#line 2058 "MetadataWriter.c"
					}
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp25_ = _media_it;
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp26_ = gee_iterator_get (_tmp25_);
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					media = (MediaSource*) _tmp26_;
#line 411 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp27_ = media;
#line 411 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp28_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp27_) : NULL);
#line 411 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					photo = _tmp28_;
#line 412 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp29_ = photo;
#line 412 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (_tmp29_ != NULL) {
#line 2076 "MetadataWriter.c"
						GeeHashSet* _tmp30_ = NULL;
						LibraryPhoto* _tmp31_ = NULL;
#line 413 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp30_ = photos;
#line 413 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp31_ = photo;
#line 413 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp31_);
#line 2085 "MetadataWriter.c"
					}
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_g_object_unref0 (photo);
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_g_object_unref0 (media);
#line 2091 "MetadataWriter.c"
				}
#line 410 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (_media_it);
#line 2095 "MetadataWriter.c"
			}
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (object);
#line 2099 "MetadataWriter.c"
		}
#line 403 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_object_it);
#line 2103 "MetadataWriter.c"
	}
#line 417 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp32_ = photos;
#line 417 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp32_ != NULL) {
#line 2109 "MetadataWriter.c"
		GeeHashSet* _tmp33_ = NULL;
#line 418 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp33_ = photos;
#line 418 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_photos_are_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GEE_TYPE_COLLECTION, GeeCollection), "tag renamed", FALSE);
#line 2115 "MetadataWriter.c"
	}
#line 401 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (photos);
#line 2119 "MetadataWriter.c"
}


static void metadata_writer_on_tag_contents_altered (MetadataWriter* self, ContainerSource* container, GeeCollection* added, gboolean relinking, GeeCollection* removed, gboolean unlinking) {
	Tag* tag = NULL;
	ContainerSource* _tmp0_ = NULL;
	Tag* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GeeCollection* _tmp3_ = NULL;
	gboolean _tmp27_ = FALSE;
	GeeCollection* _tmp28_ = NULL;
#line 421 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 421 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_CONTAINER_SOURCE (container));
#line 421 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail ((added == NULL) || GEE_IS_COLLECTION (added));
#line 421 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail ((removed == NULL) || GEE_IS_COLLECTION (removed));
#line 423 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = container;
#line 423 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_TAG, Tag));
#line 423 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	tag = _tmp1_;
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = added;
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp3_ != NULL) {
#line 2149 "MetadataWriter.c"
		gboolean _tmp4_ = FALSE;
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = relinking;
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = !_tmp4_;
#line 2155 "MetadataWriter.c"
	} else {
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = FALSE;
#line 2159 "MetadataWriter.c"
	}
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp2_) {
#line 2163 "MetadataWriter.c"
		GeeArrayList* added_photos = NULL;
		GeeArrayList* _tmp5_ = NULL;
		GeeArrayList* _tmp21_ = NULL;
		Tag* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gchar* _tmp26_ = NULL;
#line 426 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
#line 426 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		added_photos = _tmp5_;
#line 2176 "MetadataWriter.c"
		{
			GeeIterator* _source_it = NULL;
			GeeCollection* _tmp6_ = NULL;
			GeeIterator* _tmp7_ = NULL;
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = added;
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ITERABLE, GeeIterable));
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_source_it = _tmp7_;
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			while (TRUE) {
#line 2189 "MetadataWriter.c"
				GeeIterator* _tmp8_ = NULL;
				gboolean _tmp9_ = FALSE;
				DataSource* source = NULL;
				GeeIterator* _tmp10_ = NULL;
				gpointer _tmp11_ = NULL;
				LibraryPhoto* photo = NULL;
				DataSource* _tmp12_ = NULL;
				LibraryPhoto* _tmp13_ = NULL;
				gboolean _tmp14_ = FALSE;
				LibraryPhoto* _tmp15_ = NULL;
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp8_ = _source_it;
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp9_ = gee_iterator_next (_tmp8_);
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (!_tmp9_) {
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					break;
#line 2208 "MetadataWriter.c"
				}
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp10_ = _source_it;
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp11_ = gee_iterator_get (_tmp10_);
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				source = (DataSource*) _tmp11_;
#line 428 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp12_ = source;
#line 428 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp12_) : NULL);
#line 428 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				photo = _tmp13_;
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp15_ = photo;
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (_tmp15_ != NULL) {
#line 2226 "MetadataWriter.c"
					GeeHashSet* _tmp16_ = NULL;
					LibraryPhoto* _tmp17_ = NULL;
					gboolean _tmp18_ = FALSE;
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp16_ = self->priv->importing_photos;
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp17_ = photo;
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp18_ = gee_abstract_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp17_);
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp14_ = !_tmp18_;
#line 2238 "MetadataWriter.c"
				} else {
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp14_ = FALSE;
#line 2242 "MetadataWriter.c"
				}
#line 429 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (_tmp14_) {
#line 2246 "MetadataWriter.c"
					GeeArrayList* _tmp19_ = NULL;
					LibraryPhoto* _tmp20_ = NULL;
#line 430 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp19_ = added_photos;
#line 430 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp20_ = photo;
#line 430 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp20_);
#line 2255 "MetadataWriter.c"
				}
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (source);
#line 2261 "MetadataWriter.c"
			}
#line 427 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_source_it);
#line 2265 "MetadataWriter.c"
		}
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp21_ = added_photos;
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp22_ = tag;
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp23_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_DATA_OBJECT, DataObject));
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp24_ = _tmp23_;
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp25_ = g_strdup_printf ("added to %s", _tmp24_);
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp26_ = _tmp25_;
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_photos_are_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_COLLECTION, GeeCollection), _tmp26_, FALSE);
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_free0 (_tmp26_);
#line 433 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_free0 (_tmp24_);
#line 425 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (added_photos);
#line 2287 "MetadataWriter.c"
	}
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp28_ = removed;
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp28_ != NULL) {
#line 2293 "MetadataWriter.c"
		gboolean _tmp29_ = FALSE;
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp29_ = unlinking;
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp27_ = !_tmp29_;
#line 2299 "MetadataWriter.c"
	} else {
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp27_ = FALSE;
#line 2303 "MetadataWriter.c"
	}
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp27_) {
#line 2307 "MetadataWriter.c"
		GeeArrayList* removed_photos = NULL;
		GeeArrayList* _tmp30_ = NULL;
		GeeArrayList* _tmp42_ = NULL;
		Tag* _tmp43_ = NULL;
		gchar* _tmp44_ = NULL;
		gchar* _tmp45_ = NULL;
		gchar* _tmp46_ = NULL;
		gchar* _tmp47_ = NULL;
#line 437 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp30_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
#line 437 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		removed_photos = _tmp30_;
#line 2320 "MetadataWriter.c"
		{
			GeeIterator* _source_it = NULL;
			GeeCollection* _tmp31_ = NULL;
			GeeIterator* _tmp32_ = NULL;
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp31_ = removed;
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp32_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GEE_TYPE_ITERABLE, GeeIterable));
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_source_it = _tmp32_;
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			while (TRUE) {
#line 2333 "MetadataWriter.c"
				GeeIterator* _tmp33_ = NULL;
				gboolean _tmp34_ = FALSE;
				DataSource* source = NULL;
				GeeIterator* _tmp35_ = NULL;
				gpointer _tmp36_ = NULL;
				LibraryPhoto* photo = NULL;
				DataSource* _tmp37_ = NULL;
				LibraryPhoto* _tmp38_ = NULL;
				LibraryPhoto* _tmp39_ = NULL;
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp33_ = _source_it;
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp34_ = gee_iterator_next (_tmp33_);
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (!_tmp34_) {
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					break;
#line 2351 "MetadataWriter.c"
				}
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp35_ = _source_it;
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp36_ = gee_iterator_get (_tmp35_);
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				source = (DataSource*) _tmp36_;
#line 439 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp37_ = source;
#line 439 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp38_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp37_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp37_) : NULL);
#line 439 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				photo = _tmp38_;
#line 440 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp39_ = photo;
#line 440 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (_tmp39_ != NULL) {
#line 2369 "MetadataWriter.c"
					GeeArrayList* _tmp40_ = NULL;
					LibraryPhoto* _tmp41_ = NULL;
#line 441 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp40_ = removed_photos;
#line 441 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp41_ = photo;
#line 441 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp41_);
#line 2378 "MetadataWriter.c"
				}
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (source);
#line 2384 "MetadataWriter.c"
			}
#line 438 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_source_it);
#line 2388 "MetadataWriter.c"
		}
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp42_ = removed_photos;
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp43_ = tag;
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp44_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, TYPE_DATA_OBJECT, DataObject));
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp45_ = _tmp44_;
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp46_ = g_strdup_printf ("removed from %s", _tmp45_);
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp47_ = _tmp46_;
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_photos_are_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GEE_TYPE_COLLECTION, GeeCollection), _tmp47_, FALSE);
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_free0 (_tmp47_);
#line 444 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_free0 (_tmp45_);
#line 436 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (removed_photos);
#line 2410 "MetadataWriter.c"
	}
#line 421 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (tag);
#line 2414 "MetadataWriter.c"
}


static void metadata_writer_on_tag_backlink_removed (MetadataWriter* self, ContainerSource* container, GeeCollection* sources) {
	GeeArrayList* photos = NULL;
	GeeArrayList* _tmp0_ = NULL;
	GeeArrayList* _tmp12_ = NULL;
	ContainerSource* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
#line 448 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 448 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_CONTAINER_SOURCE (container));
#line 448 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_COLLECTION (sources));
#line 449 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
#line 449 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	photos = _tmp0_;
#line 2437 "MetadataWriter.c"
	{
		GeeIterator* _source_it = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeIterator* _tmp2_ = NULL;
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = sources;
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ITERABLE, GeeIterable));
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_source_it = _tmp2_;
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 2450 "MetadataWriter.c"
			GeeIterator* _tmp3_ = NULL;
			gboolean _tmp4_ = FALSE;
			DataSource* source = NULL;
			GeeIterator* _tmp5_ = NULL;
			gpointer _tmp6_ = NULL;
			LibraryPhoto* photo = NULL;
			DataSource* _tmp7_ = NULL;
			LibraryPhoto* _tmp8_ = NULL;
			LibraryPhoto* _tmp9_ = NULL;
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp3_ = _source_it;
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp4_ = gee_iterator_next (_tmp3_);
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp4_) {
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 2468 "MetadataWriter.c"
			}
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp5_ = _source_it;
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = gee_iterator_get (_tmp5_);
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			source = (DataSource*) _tmp6_;
#line 451 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = source;
#line 451 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp7_) : NULL);
#line 451 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo = _tmp8_;
#line 452 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = photo;
#line 452 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp9_ != NULL) {
#line 2486 "MetadataWriter.c"
				GeeArrayList* _tmp10_ = NULL;
				LibraryPhoto* _tmp11_ = NULL;
#line 453 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp10_ = photos;
#line 453 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp11_ = photo;
#line 453 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp11_);
#line 2495 "MetadataWriter.c"
			}
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (photo);
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (source);
#line 2501 "MetadataWriter.c"
		}
#line 450 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_source_it);
#line 2505 "MetadataWriter.c"
	}
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp12_ = photos;
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp13_ = container;
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp14_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_OBJECT, DataObject));
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp15_ = _tmp14_;
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp16_ = g_strdup_printf ("backlink removed from %s", _tmp15_);
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp17_ = _tmp16_;
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_photos_are_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection), _tmp17_, FALSE);
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_free0 (_tmp17_);
#line 456 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_free0 (_tmp15_);
#line 448 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (photos);
#line 2527 "MetadataWriter.c"
}


static void metadata_writer_count_enqueued_work (MetadataWriter* self, gint count, gboolean report) {
	guint _tmp0_ = 0U;
	gint _tmp1_ = 0;
	gboolean _tmp2_ = FALSE;
#line 459 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 460 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->outstanding_total;
#line 460 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = count;
#line 460 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->outstanding_total = _tmp0_ + _tmp1_;
#line 466 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = report;
#line 466 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp2_) {
#line 2547 "MetadataWriter.c"
		guint _tmp3_ = 0U;
		guint _tmp4_ = 0U;
#line 467 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = self->priv->outstanding_completed;
#line 467 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = self->priv->outstanding_total;
#line 467 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_signal_emit_by_name (self, "progress", _tmp3_, _tmp4_);
#line 2556 "MetadataWriter.c"
	}
}


static void metadata_writer_count_cancelled_work (MetadataWriter* self, gint count, gboolean report) {
	guint _tmp0_ = 0U;
	guint _tmp1_ = 0U;
	gint _tmp2_ = 0;
	guint _tmp5_ = 0U;
	guint _tmp6_ = 0U;
	gboolean _tmp7_ = FALSE;
#line 470 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = self->priv->outstanding_total;
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = count;
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp1_ >= ((guint) _tmp2_)) {
#line 2576 "MetadataWriter.c"
		guint _tmp3_ = 0U;
		gint _tmp4_ = 0;
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = self->priv->outstanding_total;
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = count;
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = _tmp3_ - _tmp4_;
#line 2585 "MetadataWriter.c"
	} else {
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = (guint) 0;
#line 2589 "MetadataWriter.c"
	}
#line 471 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->outstanding_total = _tmp0_;
#line 472 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = self->priv->outstanding_completed;
#line 472 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp6_ = self->priv->outstanding_total;
#line 472 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp5_ >= _tmp6_) {
#line 473 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->priv->outstanding_completed = (guint) 0;
#line 474 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->priv->outstanding_total = (guint) 0;
#line 2603 "MetadataWriter.c"
	}
#line 481 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = report;
#line 481 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp7_) {
#line 2609 "MetadataWriter.c"
		guint _tmp8_ = 0U;
		guint _tmp9_ = 0U;
#line 482 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp8_ = self->priv->outstanding_completed;
#line 482 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp9_ = self->priv->outstanding_total;
#line 482 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_signal_emit_by_name (self, "progress", _tmp8_, _tmp9_);
#line 2618 "MetadataWriter.c"
	}
}


static void metadata_writer_count_completed_work (MetadataWriter* self, gint count, gboolean report) {
	guint _tmp0_ = 0U;
	gint _tmp1_ = 0;
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	gboolean _tmp4_ = FALSE;
#line 485 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 486 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->outstanding_completed;
#line 486 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = count;
#line 486 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->outstanding_completed = _tmp0_ + _tmp1_;
#line 487 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = self->priv->outstanding_completed;
#line 487 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = self->priv->outstanding_total;
#line 487 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp2_ >= _tmp3_) {
#line 488 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->priv->outstanding_completed = (guint) 0;
#line 489 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->priv->outstanding_total = (guint) 0;
#line 2647 "MetadataWriter.c"
	}
#line 496 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = report;
#line 496 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp4_) {
#line 2653 "MetadataWriter.c"
		guint _tmp5_ = 0U;
		guint _tmp6_ = 0U;
#line 497 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = self->priv->outstanding_completed;
#line 497 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp6_ = self->priv->outstanding_total;
#line 497 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_signal_emit_by_name (self, "progress", _tmp5_, _tmp6_);
#line 2662 "MetadataWriter.c"
	}
}


static void metadata_writer_schedule_if_dirty (MetadataWriter* self, GeeIterable* media_sources, const gchar* reason) {
	GeeArrayList* photos = NULL;
	GeeArrayList* _tmp18_ = NULL;
#line 500 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 500 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_ITERABLE (media_sources));
#line 500 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (reason != NULL);
#line 501 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	photos = NULL;
#line 2678 "MetadataWriter.c"
	{
		GeeIterator* _media_it = NULL;
		GeeIterable* _tmp0_ = NULL;
		GeeIterator* _tmp1_ = NULL;
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = media_sources;
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = gee_iterable_iterator (_tmp0_);
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_media_it = _tmp1_;
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 2691 "MetadataWriter.c"
			GeeIterator* _tmp2_ = NULL;
			gboolean _tmp3_ = FALSE;
			MediaSource* media = NULL;
			GeeIterator* _tmp4_ = NULL;
			gpointer _tmp5_ = NULL;
			LibraryPhoto* photo = NULL;
			MediaSource* _tmp6_ = NULL;
			LibraryPhoto* _tmp7_ = NULL;
			LibraryPhoto* _tmp8_ = NULL;
			GeeHashSet* _tmp9_ = NULL;
			LibraryPhoto* _tmp10_ = NULL;
			gboolean _tmp11_ = FALSE;
			LibraryPhoto* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp2_ = _media_it;
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp3_ = gee_iterator_next (_tmp2_);
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp3_) {
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 2714 "MetadataWriter.c"
			}
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp4_ = _media_it;
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp5_ = gee_iterator_get (_tmp4_);
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			media = (MediaSource*) _tmp5_;
#line 503 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = media;
#line 503 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, TYPE_LIBRARY_PHOTO) ? ((LibraryPhoto*) _tmp6_) : NULL);
#line 503 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo = _tmp7_;
#line 504 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = photo;
#line 504 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp8_ == NULL) {
#line 505 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 505 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (media);
#line 505 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				continue;
#line 2738 "MetadataWriter.c"
			}
#line 508 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = self->priv->importing_photos;
#line 508 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp10_ = photo;
#line 508 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp11_ = gee_abstract_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp10_);
#line 508 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp11_) {
#line 509 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (photo);
#line 509 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (media);
#line 509 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				continue;
#line 2754 "MetadataWriter.c"
			}
#line 511 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp12_ = photo;
#line 511 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp13_ = photo_is_master_metadata_dirty (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_PHOTO, Photo));
#line 511 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp13_) {
#line 2762 "MetadataWriter.c"
				GeeArrayList* _tmp14_ = NULL;
				GeeArrayList* _tmp16_ = NULL;
				LibraryPhoto* _tmp17_ = NULL;
#line 512 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp14_ = photos;
#line 512 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (_tmp14_ == NULL) {
#line 2770 "MetadataWriter.c"
					GeeArrayList* _tmp15_ = NULL;
#line 513 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp15_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
#line 513 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_g_object_unref0 (photos);
#line 513 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					photos = _tmp15_;
#line 2778 "MetadataWriter.c"
				}
#line 515 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp16_ = photos;
#line 515 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp17_ = photo;
#line 515 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp17_);
#line 2786 "MetadataWriter.c"
			}
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (photo);
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (media);
#line 2792 "MetadataWriter.c"
		}
#line 502 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_media_it);
#line 2796 "MetadataWriter.c"
	}
#line 519 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp18_ = photos;
#line 519 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp18_ != NULL) {
#line 2802 "MetadataWriter.c"
		GeeArrayList* _tmp19_ = NULL;
		const gchar* _tmp20_ = NULL;
#line 520 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp19_ = photos;
#line 520 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp20_ = reason;
#line 520 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_photos_are_dirty (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection), _tmp20_, TRUE);
#line 2811 "MetadataWriter.c"
	}
#line 500 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (photos);
#line 2815 "MetadataWriter.c"
}


static void metadata_writer_photos_are_dirty (MetadataWriter* self, GeeCollection* photos, const gchar* reason, gboolean already_marked) {
	GeeCollection* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	GeeCollection* _tmp41_ = NULL;
	gint _tmp42_ = 0;
	gint _tmp43_ = 0;
	GError * _inner_error_ = NULL;
#line 524 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 524 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (GEE_IS_COLLECTION (photos));
#line 524 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (reason != NULL);
#line 525 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = photos;
#line 525 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = gee_collection_get_size (_tmp0_);
#line 525 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = _tmp1_;
#line 525 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp2_ == 0) {
#line 526 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 2846 "MetadataWriter.c"
	}
	{
		GeeIterator* _photo_it = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = photos;
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_photo_it = _tmp4_;
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 2860 "MetadataWriter.c"
			GeeIterator* _tmp5_ = NULL;
			gboolean _tmp6_ = FALSE;
			LibraryPhoto* photo = NULL;
			GeeIterator* _tmp7_ = NULL;
			gpointer _tmp8_ = NULL;
			LibraryPhoto* _tmp9_ = NULL;
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp5_ = _photo_it;
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = gee_iterator_next (_tmp5_);
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp6_) {
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 2875 "MetadataWriter.c"
			}
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = _photo_it;
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = gee_iterator_get (_tmp7_);
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo = (LibraryPhoto*) _tmp8_;
#line 530 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = photo;
#line 530 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			metadata_writer_cancel_job (self, _tmp9_);
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (photo);
#line 2889 "MetadataWriter.c"
		}
#line 529 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_photo_it);
#line 2893 "MetadataWriter.c"
	}
#line 533 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp10_ = already_marked;
#line 533 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (!_tmp10_) {
#line 2899 "MetadataWriter.c"
		{
			LibraryPhotoSourceCollection* _tmp11_ = NULL;
			TransactionController* _tmp12_ = NULL;
			TransactionController* _tmp13_ = NULL;
			LibraryPhotoSourceCollection* _tmp21_ = NULL;
			TransactionController* _tmp22_ = NULL;
			TransactionController* _tmp23_ = NULL;
#line 535 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp11_ = library_photo_global;
#line 535 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp12_ = media_source_collection_get_transaction_controller (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 535 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp13_ = _tmp12_;
#line 535 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			transaction_controller_begin (_tmp13_);
#line 2915 "MetadataWriter.c"
			{
				GeeIterator* _photo_it = NULL;
				GeeCollection* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp14_ = photos;
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp15_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GEE_TYPE_ITERABLE, GeeIterable));
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_photo_it = _tmp15_;
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				while (TRUE) {
#line 2928 "MetadataWriter.c"
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					LibraryPhoto* photo = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					LibraryPhoto* _tmp20_ = NULL;
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp16_ = _photo_it;
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp17_ = gee_iterator_next (_tmp16_);
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (!_tmp17_) {
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						break;
#line 2943 "MetadataWriter.c"
					}
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp18_ = _photo_it;
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp19_ = gee_iterator_get (_tmp18_);
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					photo = (LibraryPhoto*) _tmp19_;
#line 538 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_tmp20_ = photo;
#line 538 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					photo_set_master_metadata_dirty (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_PHOTO, Photo), TRUE, &_inner_error_);
#line 538 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 538 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_g_object_unref0 (photo);
#line 538 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_g_object_unref0 (_photo_it);
#line 2961 "MetadataWriter.c"
						goto __catch541_g_error;
					}
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_g_object_unref0 (photo);
#line 2966 "MetadataWriter.c"
				}
#line 537 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (_photo_it);
#line 2970 "MetadataWriter.c"
			}
#line 540 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp21_ = library_photo_global;
#line 540 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp22_ = media_source_collection_get_transaction_controller (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 540 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp23_ = _tmp22_;
#line 540 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			transaction_controller_commit (_tmp23_);
#line 2980 "MetadataWriter.c"
		}
		goto __finally541;
		__catch541_g_error:
		{
			GError* err = NULL;
			GError* _tmp24_ = NULL;
#line 534 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			err = _inner_error_;
#line 534 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_inner_error_ = NULL;
#line 542 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp24_ = err;
#line 542 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp24_->domain == DATABASE_ERROR) {
#line 2995 "MetadataWriter.c"
				GError* _tmp25_ = NULL;
#line 543 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp25_ = err;
#line 543 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				app_window_database_error ((GError*) _tmp25_);
#line 3001 "MetadataWriter.c"
			} else {
				GError* _tmp26_ = NULL;
				const gchar* _tmp27_ = NULL;
#line 545 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp26_ = err;
#line 545 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp27_ = _tmp26_->message;
#line 545 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				g_error ("MetadataWriter.vala:545: Unable to mark metadata as dirty: %s", _tmp27_);
#line 3011 "MetadataWriter.c"
			}
#line 534 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_error_free0 (err);
#line 3015 "MetadataWriter.c"
		}
		__finally541:
#line 534 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 534 "/home/jens/Source/shotwell/src/MetadataWriter.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 534 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_clear_error (&_inner_error_);
#line 534 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			return;
#line 3026 "MetadataWriter.c"
		}
	}
#line 551 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp29_ = self->priv->closed;
#line 551 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp29_) {
#line 551 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp28_ = TRUE;
#line 3035 "MetadataWriter.c"
	} else {
		gboolean _tmp30_ = FALSE;
#line 551 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp30_ = self->priv->enabled;
#line 551 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp28_ = !_tmp30_;
#line 3042 "MetadataWriter.c"
	}
#line 551 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp28_) {
#line 552 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 3048 "MetadataWriter.c"
	}
	{
		GeeIterator* _photo_it = NULL;
		GeeCollection* _tmp31_ = NULL;
		GeeIterator* _tmp32_ = NULL;
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp31_ = photos;
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp32_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GEE_TYPE_ITERABLE, GeeIterable));
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_photo_it = _tmp32_;
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 3062 "MetadataWriter.c"
			GeeIterator* _tmp33_ = NULL;
			gboolean _tmp34_ = FALSE;
			LibraryPhoto* photo = NULL;
			GeeIterator* _tmp35_ = NULL;
			gpointer _tmp36_ = NULL;
			gboolean enqueued = FALSE;
			HashTimedQueue* _tmp37_ = NULL;
			LibraryPhoto* _tmp38_ = NULL;
			gboolean _tmp39_ = FALSE;
			gboolean _tmp40_ = FALSE;
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp33_ = _photo_it;
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp34_ = gee_iterator_next (_tmp33_);
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp34_) {
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 3081 "MetadataWriter.c"
			}
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp35_ = _photo_it;
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp36_ = gee_iterator_get (_tmp35_);
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo = (LibraryPhoto*) _tmp36_;
#line 559 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp37_ = self->priv->dirty;
#line 559 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp38_ = photo;
#line 559 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp39_ = timed_queue_enqueue (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, TYPE_TIMED_QUEUE, TimedQueue), _tmp38_);
#line 559 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			enqueued = _tmp39_;
#line 560 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp40_ = enqueued;
#line 560 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_vala_assert (_tmp40_, "enqueued");
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (photo);
#line 3103 "MetadataWriter.c"
		}
#line 558 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_photo_it);
#line 3107 "MetadataWriter.c"
	}
#line 563 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp41_ = photos;
#line 563 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp42_ = gee_collection_get_size (_tmp41_);
#line 563 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp43_ = _tmp42_;
#line 563 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_count_enqueued_work (self, _tmp43_, TRUE);
#line 3117 "MetadataWriter.c"
}


static void metadata_writer_cancel_all (MetadataWriter* self, gboolean wait) {
	HashTimedQueue* _tmp0_ = NULL;
	gboolean _tmp12_ = FALSE;
#line 566 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 567 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->dirty;
#line 567 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	timed_queue_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_TIMED_QUEUE, TimedQueue));
#line 3130 "MetadataWriter.c"
	{
		GeeIterator* _job_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = self->priv->pending;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp2_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_MAP, GeeMap));
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = _tmp2_;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = _tmp3_;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp6_ = _tmp5_;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_tmp4_);
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_job_it = _tmp6_;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		while (TRUE) {
#line 3157 "MetadataWriter.c"
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			MetadataWriterCommitJob* job = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			MetadataWriterCommitJob* _tmp11_ = NULL;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = _job_it;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp8_ = gee_iterator_next (_tmp7_);
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (!_tmp8_) {
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				break;
#line 3172 "MetadataWriter.c"
			}
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp9_ = _job_it;
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp10_ = gee_iterator_get (_tmp9_);
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			job = (MetadataWriterCommitJob*) _tmp10_;
#line 570 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp11_ = job;
#line 570 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			background_job_cancel (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_background_job_unref0 (job);
#line 3186 "MetadataWriter.c"
		}
#line 569 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_job_it);
#line 3190 "MetadataWriter.c"
	}
#line 572 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp12_ = wait;
#line 572 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp12_) {
#line 3196 "MetadataWriter.c"
		Workers* _tmp13_ = NULL;
#line 573 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp13_ = self->priv->workers;
#line 573 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		workers_wait_for_empty_queue (_tmp13_);
#line 3202 "MetadataWriter.c"
	}
#line 575 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_count_cancelled_work (self, G_MAXINT, TRUE);
#line 3206 "MetadataWriter.c"
}


static gboolean metadata_writer_cancel_job (MetadataWriter* self, LibraryPhoto* photo) {
	gboolean result = FALSE;
	gboolean cancelled = FALSE;
	GeeHashMap* _tmp0_ = NULL;
	LibraryPhoto* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	HashTimedQueue* _tmp11_ = NULL;
	LibraryPhoto* _tmp12_ = NULL;
	gboolean _tmp13_ = FALSE;
#line 578 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail (IS_METADATA_WRITER (self), FALSE);
#line 578 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO (photo), FALSE);
#line 579 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	cancelled = FALSE;
#line 581 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->pending;
#line 581 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = photo;
#line 581 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_);
#line 581 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp2_) {
#line 3233 "MetadataWriter.c"
		MetadataWriterCommitJob* j = NULL;
		GeeHashMap* _tmp3_ = NULL;
		LibraryPhoto* _tmp4_ = NULL;
		gpointer _tmp5_ = NULL;
		GeeHashSet* _tmp6_ = NULL;
		MetadataWriterCommitJob* _tmp7_ = NULL;
		MetadataWriterCommitJob* _tmp8_ = NULL;
		GeeHashMap* _tmp9_ = NULL;
		LibraryPhoto* _tmp10_ = NULL;
#line 582 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = self->priv->pending;
#line 582 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = photo;
#line 582 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp4_);
#line 582 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		j = G_TYPE_CHECK_INSTANCE_CAST ((MetadataWriterCommitJob*) _tmp5_, METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJob);
#line 583 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp6_ = self->priv->pending_cancel;
#line 583 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp7_ = j;
#line 583 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp7_);
#line 584 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp8_ = j;
#line 584 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		background_job_cancel (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 585 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp9_ = self->priv->pending;
#line 585 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp10_ = photo;
#line 585 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp10_, NULL);
#line 586 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		cancelled = TRUE;
#line 581 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_background_job_unref0 (j);
#line 3271 "MetadataWriter.c"
	}
#line 589 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp11_ = self->priv->dirty;
#line 589 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp12_ = photo;
#line 589 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp13_ = timed_queue_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_TIMED_QUEUE, TimedQueue), _tmp12_);
#line 589 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp13_) {
#line 3281 "MetadataWriter.c"
		gboolean removed = FALSE;
		HashTimedQueue* _tmp14_ = NULL;
		LibraryPhoto* _tmp15_ = NULL;
		gboolean _tmp16_ = FALSE;
		gboolean _tmp17_ = FALSE;
		HashTimedQueue* _tmp18_ = NULL;
		LibraryPhoto* _tmp19_ = NULL;
		gboolean _tmp20_ = FALSE;
#line 590 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp14_ = self->priv->dirty;
#line 590 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp15_ = photo;
#line 590 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp16_ = timed_queue_remove_first (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_TIMED_QUEUE, TimedQueue), _tmp15_);
#line 590 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		removed = _tmp16_;
#line 591 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp17_ = removed;
#line 591 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_vala_assert (_tmp17_, "removed");
#line 593 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp18_ = self->priv->dirty;
#line 593 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp19_ = photo;
#line 593 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp20_ = timed_queue_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_TIMED_QUEUE, TimedQueue), _tmp19_);
#line 593 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_vala_assert (!_tmp20_, "!dirty.contains(photo)");
#line 595 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_count_cancelled_work (self, 1, FALSE);
#line 596 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		cancelled = TRUE;
#line 3314 "MetadataWriter.c"
	}
#line 599 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	result = cancelled;
#line 599 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return result;
#line 3320 "MetadataWriter.c"
}


static void metadata_writer_on_photo_dequeued (MetadataWriter* self, LibraryPhoto* photo) {
	gboolean _tmp0_ = FALSE;
	GeeSet* keywords = NULL;
	GeeCollection* tags = NULL;
	TagSourceCollection* _tmp1_ = NULL;
	LibraryPhoto* _tmp2_ = NULL;
	GeeList* _tmp3_ = NULL;
	GeeCollection* _tmp4_ = NULL;
	GeeHashMap* _tmp16_ = NULL;
	LibraryPhoto* _tmp17_ = NULL;
	gboolean _tmp18_ = FALSE;
	MetadataWriterCommitJob* job = NULL;
	LibraryPhoto* _tmp20_ = NULL;
	GeeSet* _tmp21_ = NULL;
	MetadataWriterCommitJob* _tmp22_ = NULL;
	GeeHashMap* _tmp23_ = NULL;
	LibraryPhoto* _tmp24_ = NULL;
	MetadataWriterCommitJob* _tmp25_ = NULL;
	Workers* _tmp26_ = NULL;
	MetadataWriterCommitJob* _tmp27_ = NULL;
#line 602 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 602 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_LIBRARY_PHOTO (photo));
#line 603 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->enabled;
#line 603 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (!_tmp0_) {
#line 604 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_count_cancelled_work (self, 1, TRUE);
#line 606 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 3356 "MetadataWriter.c"
	}
#line 609 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	keywords = NULL;
#line 610 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = tag_global;
#line 610 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = photo;
#line 610 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = tag_source_collection_fetch_for_source (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_MEDIA_SOURCE, MediaSource));
#line 610 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	tags = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection);
#line 611 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = tags;
#line 611 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp4_ != NULL) {
#line 3372 "MetadataWriter.c"
		GeeHashSet* _tmp5_ = NULL;
#line 612 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 612 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (keywords);
#line 612 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		keywords = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_SET, GeeSet);
#line 3380 "MetadataWriter.c"
		{
			GeeIterator* _tag_it = NULL;
			GeeCollection* _tmp6_ = NULL;
			GeeIterator* _tmp7_ = NULL;
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp6_ = tags;
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp7_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ITERABLE, GeeIterable));
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tag_it = _tmp7_;
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			while (TRUE) {
#line 3393 "MetadataWriter.c"
				GeeIterator* _tmp8_ = NULL;
				gboolean _tmp9_ = FALSE;
				Tag* tag = NULL;
				GeeIterator* _tmp10_ = NULL;
				gpointer _tmp11_ = NULL;
				GeeSet* _tmp12_ = NULL;
				Tag* _tmp13_ = NULL;
				gchar* _tmp14_ = NULL;
				gchar* _tmp15_ = NULL;
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp8_ = _tag_it;
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp9_ = gee_iterator_next (_tmp8_);
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (!_tmp9_) {
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					break;
#line 3411 "MetadataWriter.c"
				}
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp10_ = _tag_it;
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp11_ = gee_iterator_get (_tmp10_);
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				tag = (Tag*) _tmp11_;
#line 614 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp12_ = keywords;
#line 614 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp13_ = tag;
#line 614 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp14_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_OBJECT, DataObject));
#line 614 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp15_ = _tmp14_;
#line 614 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection), _tmp15_);
#line 614 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_free0 (_tmp15_);
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (tag);
#line 3433 "MetadataWriter.c"
			}
#line 613 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_tag_it);
#line 3437 "MetadataWriter.c"
		}
	}
#line 618 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp16_ = self->priv->pending;
#line 618 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp17_ = photo;
#line 618 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp18_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp17_);
#line 618 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp18_) {
#line 3448 "MetadataWriter.c"
		LibraryPhoto* _tmp19_ = NULL;
#line 619 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp19_ = photo;
#line 619 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_cancel_job (self, _tmp19_);
#line 3454 "MetadataWriter.c"
	}
#line 621 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp20_ = photo;
#line 621 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp21_ = keywords;
#line 621 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp22_ = metadata_writer_commit_job_new (self, _tmp20_, _tmp21_);
#line 621 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	job = _tmp22_;
#line 622 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp23_ = self->priv->pending;
#line 622 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp24_ = photo;
#line 622 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp25_ = job;
#line 622 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp24_, _tmp25_);
#line 628 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp26_ = self->priv->workers;
#line 628 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp27_ = job;
#line 628 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	workers_enqueue (_tmp26_, G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 602 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_background_job_unref0 (job);
#line 602 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (tags);
#line 602 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (keywords);
#line 3484 "MetadataWriter.c"
}


static gpointer _background_job_ref0 (gpointer self) {
#line 632 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return self ? background_job_ref (self) : NULL;
#line 3491 "MetadataWriter.c"
}


static void metadata_writer_on_update_completed (MetadataWriter* self, BackgroundJob* j) {
	MetadataWriterCommitJob* job = NULL;
	BackgroundJob* _tmp0_ = NULL;
	MetadataWriterCommitJob* _tmp1_ = NULL;
	MetadataWriterCommitJob* _tmp2_ = NULL;
	GError* _tmp3_ = NULL;
	gboolean removed = FALSE;
	GeeHashMap* _tmp44_ = NULL;
	MetadataWriterCommitJob* _tmp45_ = NULL;
	LibraryPhoto* _tmp46_ = NULL;
	gboolean _tmp47_ = FALSE;
	gboolean _tmp48_ = FALSE;
	LibraryPhotoSourceCollection* _tmp49_ = NULL;
	TransactionController* _tmp50_ = NULL;
	TransactionController* _tmp51_ = NULL;
	gboolean _tmp52_ = FALSE;
	MetadataWriterCommitJob* _tmp53_ = NULL;
	PhotoReimportMasterState* _tmp54_ = NULL;
	LibraryPhotoSourceCollection* _tmp86_ = NULL;
	TransactionController* _tmp87_ = NULL;
	TransactionController* _tmp88_ = NULL;
	GError * _inner_error_ = NULL;
#line 631 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 631 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_BACKGROUND_JOB (j));
#line 632 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = j;
#line 632 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = _background_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJob));
#line 632 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	job = _tmp1_;
#line 634 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = job;
#line 634 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = _tmp2_->err;
#line 634 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp3_ != NULL) {
#line 3533 "MetadataWriter.c"
		MetadataWriterCommitJob* _tmp4_ = NULL;
		LibraryPhoto* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		MetadataWriterCommitJob* _tmp8_ = NULL;
		GError* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = job;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = _tmp4_->photo;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp6_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_DATA_OBJECT, DataObject));
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp7_ = _tmp6_;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp8_ = job;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp9_ = _tmp8_->err;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp10_ = _tmp9_->message;
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_warning ("MetadataWriter.vala:635: Unable to write metadata to %s: %s", _tmp7_, _tmp10_);
#line 635 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_free0 (_tmp7_);
#line 3559 "MetadataWriter.c"
	} else {
		MetadataWriterCommitJob* _tmp11_ = NULL;
		gboolean _tmp12_ = FALSE;
		MetadataWriterCommitJob* _tmp25_ = NULL;
		LibraryPhoto* _tmp26_ = NULL;
		GFile* _tmp27_ = NULL;
		GFile* _tmp28_ = NULL;
		gboolean _tmp29_ = FALSE;
#line 637 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp11_ = job;
#line 637 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp12_ = _tmp11_->wrote_master;
#line 637 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (_tmp12_) {
#line 3574 "MetadataWriter.c"
			MetadataWriterCommitJob* _tmp13_ = NULL;
			LibraryPhoto* _tmp14_ = NULL;
			GFile* _tmp15_ = NULL;
			GFile* _tmp16_ = NULL;
			gchar* _tmp17_ = NULL;
			gchar* _tmp18_ = NULL;
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp13_ = job;
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp14_ = _tmp13_->photo;
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp15_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_MEDIA_SOURCE, MediaSource));
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp16_ = _tmp15_;
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp17_ = g_file_get_path (_tmp16_);
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp18_ = _tmp17_;
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_message ("MetadataWriter.vala:638: Completed writing metadata to %s", _tmp18_);
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_free0 (_tmp18_);
#line 638 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_tmp16_);
#line 3599 "MetadataWriter.c"
		} else {
			MetadataWriterCommitJob* _tmp19_ = NULL;
			LibraryPhoto* _tmp20_ = NULL;
			GFile* _tmp21_ = NULL;
			GFile* _tmp22_ = NULL;
			gchar* _tmp23_ = NULL;
			gchar* _tmp24_ = NULL;
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp19_ = job;
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp20_ = _tmp19_->photo;
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp21_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_MEDIA_SOURCE, MediaSource));
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp22_ = _tmp21_;
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp23_ = g_file_get_path (_tmp22_);
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp24_ = _tmp23_;
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_message ("MetadataWriter.vala:640: Unable to write metadata to %s", _tmp24_);
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_free0 (_tmp24_);
#line 640 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_tmp22_);
#line 3625 "MetadataWriter.c"
		}
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp25_ = job;
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp26_ = _tmp25_->photo;
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp27_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_PHOTO, Photo));
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp28_ = _tmp27_;
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp29_ = _tmp28_ != NULL;
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_tmp28_);
#line 642 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (_tmp29_) {
#line 3641 "MetadataWriter.c"
			MetadataWriterCommitJob* _tmp30_ = NULL;
			gboolean _tmp31_ = FALSE;
#line 643 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp30_ = job;
#line 643 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp31_ = _tmp30_->wrote_editable;
#line 643 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp31_) {
#line 3650 "MetadataWriter.c"
				MetadataWriterCommitJob* _tmp32_ = NULL;
				LibraryPhoto* _tmp33_ = NULL;
				GFile* _tmp34_ = NULL;
				GFile* _tmp35_ = NULL;
				gchar* _tmp36_ = NULL;
				gchar* _tmp37_ = NULL;
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp32_ = job;
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp33_ = _tmp32_->photo;
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp34_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, TYPE_PHOTO, Photo));
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp35_ = _tmp34_;
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp36_ = g_file_get_path (_tmp35_);
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp37_ = _tmp36_;
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				g_message ("MetadataWriter.vala:644: Completed writing metadata to %s", _tmp37_);
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_free0 (_tmp37_);
#line 644 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (_tmp35_);
#line 3675 "MetadataWriter.c"
			} else {
				MetadataWriterCommitJob* _tmp38_ = NULL;
				LibraryPhoto* _tmp39_ = NULL;
				GFile* _tmp40_ = NULL;
				GFile* _tmp41_ = NULL;
				gchar* _tmp42_ = NULL;
				gchar* _tmp43_ = NULL;
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp38_ = job;
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp39_ = _tmp38_->photo;
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp40_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, TYPE_PHOTO, Photo));
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp41_ = _tmp40_;
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp42_ = g_file_get_path (_tmp41_);
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp43_ = _tmp42_;
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				g_message ("MetadataWriter.vala:646: Unable to write metadata to %s", _tmp43_);
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_free0 (_tmp43_);
#line 646 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (_tmp41_);
#line 3701 "MetadataWriter.c"
			}
		}
	}
#line 650 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp44_ = self->priv->pending;
#line 650 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp45_ = job;
#line 650 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp46_ = _tmp45_->photo;
#line 650 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp47_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp46_, NULL);
#line 650 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	removed = _tmp47_;
#line 651 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp48_ = removed;
#line 651 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_vala_assert (_tmp48_, "removed");
#line 655 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp49_ = library_photo_global;
#line 655 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp50_ = media_source_collection_get_transaction_controller (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 655 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp51_ = _tmp50_;
#line 655 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	transaction_controller_begin (_tmp51_);
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp53_ = job;
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp54_ = _tmp53_->reimport_master_state;
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp54_ != NULL) {
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp52_ = TRUE;
#line 3735 "MetadataWriter.c"
	} else {
		MetadataWriterCommitJob* _tmp55_ = NULL;
		PhotoReimportEditableState* _tmp56_ = NULL;
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp55_ = job;
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp56_ = _tmp55_->reimport_editable_state;
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp52_ = _tmp56_ != NULL;
#line 3745 "MetadataWriter.c"
	}
#line 657 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp52_) {
#line 3749 "MetadataWriter.c"
		LibraryPhoto* _tmp57_ = NULL;
		MetadataWriterCommitJob* _tmp58_ = NULL;
		LibraryPhoto* _tmp59_ = NULL;
		LibraryPhoto* _tmp60_ = NULL;
#line 660 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp57_ = self->priv->ignore_photo_alteration;
#line 660 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_vala_assert (_tmp57_ == NULL, "ignore_photo_alteration == null");
#line 661 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp58_ = job;
#line 661 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp59_ = _tmp58_->photo;
#line 661 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp60_ = _g_object_ref0 (_tmp59_);
#line 661 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (self->priv->ignore_photo_alteration);
#line 661 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->priv->ignore_photo_alteration = _tmp60_;
#line 3768 "MetadataWriter.c"
		{
			MetadataWriterCommitJob* _tmp61_ = NULL;
			PhotoReimportMasterState* _tmp62_ = NULL;
			MetadataWriterCommitJob* _tmp70_ = NULL;
			PhotoReimportEditableState* _tmp71_ = NULL;
#line 663 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp61_ = job;
#line 663 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp62_ = _tmp61_->reimport_master_state;
#line 663 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp62_ != NULL) {
#line 3780 "MetadataWriter.c"
				MetadataWriterCommitJob* _tmp63_ = NULL;
				LibraryPhoto* _tmp64_ = NULL;
				MetadataWriterCommitJob* _tmp65_ = NULL;
				PhotoReimportMasterState* _tmp66_ = NULL;
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp63_ = job;
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp64_ = _tmp63_->photo;
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp65_ = job;
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp66_ = _tmp65_->reimport_master_state;
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				photo_finish_update_master_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, TYPE_PHOTO, Photo), _tmp66_, &_inner_error_);
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 3799 "MetadataWriter.c"
						goto __catch542_database_error;
					}
					{
						LibraryPhoto* _tmp67_ = NULL;
						MetadataWriterCommitJob* _tmp68_ = NULL;
						LibraryPhoto* _tmp69_ = NULL;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp67_ = self->priv->ignore_photo_alteration;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp68_ = job;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp69_ = _tmp68_->photo;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_vala_assert (_tmp67_ == _tmp69_, "ignore_photo_alteration == job.photo");
#line 673 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_g_object_unref0 (self->priv->ignore_photo_alteration);
#line 673 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						self->priv->ignore_photo_alteration = NULL;
#line 3818 "MetadataWriter.c"
					}
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_background_job_unref0 (job);
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.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 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					g_clear_error (&_inner_error_);
#line 664 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					return;
#line 3828 "MetadataWriter.c"
				}
			}
#line 666 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp70_ = job;
#line 666 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp71_ = _tmp70_->reimport_editable_state;
#line 666 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_tmp71_ != NULL) {
#line 3837 "MetadataWriter.c"
				MetadataWriterCommitJob* _tmp72_ = NULL;
				LibraryPhoto* _tmp73_ = NULL;
				MetadataWriterCommitJob* _tmp74_ = NULL;
				PhotoReimportEditableState* _tmp75_ = NULL;
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp72_ = job;
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp73_ = _tmp72_->photo;
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp74_ = job;
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp75_ = _tmp74_->reimport_editable_state;
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				photo_finish_update_editable_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp73_, TYPE_PHOTO, Photo), _tmp75_, &_inner_error_);
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					if (_inner_error_->domain == DATABASE_ERROR) {
#line 3856 "MetadataWriter.c"
						goto __catch542_database_error;
					}
					{
						LibraryPhoto* _tmp76_ = NULL;
						MetadataWriterCommitJob* _tmp77_ = NULL;
						LibraryPhoto* _tmp78_ = NULL;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp76_ = self->priv->ignore_photo_alteration;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp77_ = job;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_tmp78_ = _tmp77_->photo;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_vala_assert (_tmp76_ == _tmp78_, "ignore_photo_alteration == job.photo");
#line 673 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						_g_object_unref0 (self->priv->ignore_photo_alteration);
#line 673 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
						self->priv->ignore_photo_alteration = NULL;
#line 3875 "MetadataWriter.c"
					}
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					_background_job_unref0 (job);
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.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 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					g_clear_error (&_inner_error_);
#line 667 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					return;
#line 3885 "MetadataWriter.c"
				}
			}
		}
		goto __finally542;
		__catch542_database_error:
		{
			GError* err = NULL;
			GError* _tmp79_ = NULL;
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			err = _inner_error_;
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_inner_error_ = NULL;
#line 669 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp79_ = err;
#line 669 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			app_window_database_error (_tmp79_);
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_error_free0 (err);
#line 3904 "MetadataWriter.c"
		}
		__finally542:
		{
			LibraryPhoto* _tmp80_ = NULL;
			MetadataWriterCommitJob* _tmp81_ = NULL;
			LibraryPhoto* _tmp82_ = NULL;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp80_ = self->priv->ignore_photo_alteration;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp81_ = job;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp82_ = _tmp81_->photo;
#line 672 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_vala_assert (_tmp80_ == _tmp82_, "ignore_photo_alteration == job.photo");
#line 673 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (self->priv->ignore_photo_alteration);
#line 673 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			self->priv->ignore_photo_alteration = NULL;
#line 3923 "MetadataWriter.c"
		}
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_background_job_unref0 (job);
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.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 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_clear_error (&_inner_error_);
#line 662 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			return;
#line 3935 "MetadataWriter.c"
		}
	} else {
	}
	{
		MetadataWriterCommitJob* _tmp83_ = NULL;
		LibraryPhoto* _tmp84_ = NULL;
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp83_ = job;
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp84_ = _tmp83_->photo;
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_set_master_metadata_dirty (G_TYPE_CHECK_INSTANCE_CAST (_tmp84_, TYPE_PHOTO, Photo), FALSE, &_inner_error_);
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (_inner_error_->domain == DATABASE_ERROR) {
#line 3952 "MetadataWriter.c"
				goto __catch543_database_error;
			}
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_background_job_unref0 (job);
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.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 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_clear_error (&_inner_error_);
#line 683 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			return;
#line 3963 "MetadataWriter.c"
		}
	}
	goto __finally543;
	__catch543_database_error:
	{
		GError* err = NULL;
		GError* _tmp85_ = NULL;
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		err = _inner_error_;
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_inner_error_ = NULL;
#line 685 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp85_ = err;
#line 685 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		app_window_database_error (_tmp85_);
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_error_free0 (err);
#line 3981 "MetadataWriter.c"
	}
	__finally543:
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_background_job_unref0 (job);
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.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 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_clear_error (&_inner_error_);
#line 682 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 3994 "MetadataWriter.c"
	}
#line 688 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp86_ = library_photo_global;
#line 688 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp87_ = media_source_collection_get_transaction_controller (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
#line 688 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp88_ = _tmp87_;
#line 688 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	transaction_controller_commit (_tmp88_);
#line 690 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_count_completed_work (self, 1, TRUE);
#line 631 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_background_job_unref0 (job);
#line 4008 "MetadataWriter.c"
}


static void metadata_writer_on_update_cancelled (MetadataWriter* self, BackgroundJob* j) {
	gboolean removed = FALSE;
	GeeHashSet* _tmp0_ = NULL;
	BackgroundJob* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
#line 693 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_METADATA_WRITER (self));
#line 693 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (IS_BACKGROUND_JOB (j));
#line 694 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->priv->pending_cancel;
#line 694 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = j;
#line 694 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJob));
#line 694 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	removed = _tmp2_;
#line 695 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_vala_assert (removed, "removed");
#line 697 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_count_cancelled_work (self, 1, TRUE);
#line 4033 "MetadataWriter.c"
}


static void g_cclosure_user_marshal_VOID__UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer data1, guint arg_1, guint arg_2, gpointer data2);
	register GMarshalFunc_VOID__UINT_UINT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (n_param_values == 3);
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		data1 = closure->data;
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		data2 = param_values->data[0].v_pointer;
#line 4052 "MetadataWriter.c"
	} else {
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		data1 = param_values->data[0].v_pointer;
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		data2 = closure->data;
#line 4058 "MetadataWriter.c"
	}
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback);
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_uint (param_values + 2), data2);
#line 4064 "MetadataWriter.c"
}


static void _metadata_writer_on_update_completed_completion_callback (BackgroundJob* job, gpointer self) {
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_update_completed ((MetadataWriter*) self, job);
#line 4071 "MetadataWriter.c"
}


static void _metadata_writer_on_update_cancelled_cancellation_callback (BackgroundJob* job, gpointer self) {
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_on_update_cancelled ((MetadataWriter*) self, job);
#line 4078 "MetadataWriter.c"
}


static MetadataWriterCommitJob* metadata_writer_commit_job_construct (GType object_type, MetadataWriter* owner, LibraryPhoto* photo, GeeSet* keywords) {
	MetadataWriterCommitJob* self = NULL;
	MetadataWriter* _tmp0_ = NULL;
	MetadataWriter* _tmp1_ = NULL;
	GCancellable* _tmp2_ = NULL;
	GCancellable* _tmp3_ = NULL;
	MetadataWriter* _tmp4_ = NULL;
	LibraryPhoto* _tmp5_ = NULL;
	LibraryPhoto* _tmp6_ = NULL;
	GeeSet* _tmp7_ = NULL;
	GeeSet* _tmp8_ = NULL;
#line 29 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail (IS_METADATA_WRITER (owner), NULL);
#line 29 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail (IS_LIBRARY_PHOTO (photo), NULL);
#line 29 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail ((keywords == NULL) || GEE_IS_SET (keywords), NULL);
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = owner;
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = owner;
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = g_cancellable_new ();
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = _tmp2_;
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = owner;
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self = (MetadataWriterCommitJob*) background_job_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G_TYPE_OBJECT, GObject), _metadata_writer_on_update_completed_completion_callback, _tmp1_, _tmp3_, _metadata_writer_on_update_cancelled_cancellation_callback, _tmp4_, NULL);
#line 30 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp3_);
#line 32 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = photo;
#line 32 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 32 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->photo);
#line 32 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->photo = _tmp6_;
#line 33 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = keywords;
#line 33 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp8_ = _g_object_ref0 (_tmp7_);
#line 33 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->current_keywords);
#line 33 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->current_keywords = _tmp8_;
#line 29 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return self;
#line 4131 "MetadataWriter.c"
}


static MetadataWriterCommitJob* metadata_writer_commit_job_new (MetadataWriter* owner, LibraryPhoto* photo, GeeSet* keywords) {
#line 29 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return metadata_writer_commit_job_construct (METADATA_WRITER_TYPE_COMMIT_JOB, owner, photo, keywords);
#line 4138 "MetadataWriter.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 41 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return self ? g_error_copy (self) : NULL;
#line 4145 "MetadataWriter.c"
}


static void metadata_writer_commit_job_real_execute (BackgroundJob* base) {
	MetadataWriterCommitJob * self;
	GError * _inner_error_ = NULL;
#line 36 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJob);
#line 4154 "MetadataWriter.c"
	{
#line 38 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_commit_job_commit_master (self, &_inner_error_);
#line 38 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4160 "MetadataWriter.c"
			goto __catch544_g_error;
		}
#line 39 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_writer_commit_job_commit_editable (self, &_inner_error_);
#line 39 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4167 "MetadataWriter.c"
			goto __catch544_g_error;
		}
	}
	goto __finally544;
	__catch544_g_error:
	{
		GError* err = NULL;
		GError* _tmp0_ = NULL;
		GError* _tmp1_ = NULL;
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		err = _inner_error_;
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_inner_error_ = NULL;
#line 41 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = err;
#line 41 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp1_ = _g_error_copy0 (_tmp0_);
#line 41 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_error_free0 (self->err);
#line 41 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		self->err = _tmp1_;
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_error_free0 (err);
#line 4191 "MetadataWriter.c"
	}
	__finally544:
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_clear_error (&_inner_error_);
#line 37 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 4202 "MetadataWriter.c"
	}
}


static void metadata_writer_commit_job_commit_master (MetadataWriterCommitJob* self, GError** error) {
	gboolean skip_orientation = FALSE;
	LibraryPhoto* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	LibraryPhoto* _tmp2_ = NULL;
	PhotoFileFormat _tmp3_ = 0;
	gboolean _tmp4_ = FALSE;
	PhotoMetadata* metadata = NULL;
	LibraryPhoto* _tmp5_ = NULL;
	PhotoMetadata* _tmp6_ = NULL;
	PhotoMetadata* _tmp7_ = NULL;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	GError * _inner_error_ = NULL;
#line 45 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (METADATA_WRITER_IS_COMMIT_JOB (self));
#line 49 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->photo;
#line 49 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = photo_has_editable (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_PHOTO, Photo));
#line 49 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	skip_orientation = _tmp1_;
#line 51 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = self->photo;
#line 51 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = photo_get_master_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO, Photo));
#line 51 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = photo_file_format_can_write_metadata (_tmp3_);
#line 51 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (!_tmp4_) {
#line 52 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 4239 "MetadataWriter.c"
	}
#line 54 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = self->photo;
#line 54 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp6_ = photo_get_master_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PHOTO, Photo), &_inner_error_);
#line 54 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata = _tmp6_;
#line 54 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 54 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_propagate_error (error, _inner_error_);
#line 54 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 4253 "MetadataWriter.c"
	}
#line 55 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = metadata;
#line 55 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp8_ = skip_orientation;
#line 55 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp9_ = metadata_writer_commit_job_update_metadata (self, _tmp7_, _tmp8_);
#line 55 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp9_) {
#line 4263 "MetadataWriter.c"
		LibraryPhoto* _tmp10_ = NULL;
		GFile* _tmp11_ = NULL;
		GFile* _tmp12_ = NULL;
#line 56 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp10_ = self->photo;
#line 56 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp11_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_MEDIA_SOURCE, MediaSource));
#line 56 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp12_ = _tmp11_;
#line 56 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		library_monitor_blacklist_file (_tmp12_, "MetadataWriter.commit_master");
#line 56 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_tmp12_);
#line 4277 "MetadataWriter.c"
		{
			LibraryPhoto* _tmp13_ = NULL;
			PhotoMetadata* _tmp14_ = NULL;
			PhotoReimportMasterState* _tmp15_ = NULL;
#line 58 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp13_ = self->photo;
#line 58 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp14_ = metadata;
#line 58 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo_persist_master_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_PHOTO, Photo), _tmp14_, &_tmp15_, &_inner_error_);
#line 58 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_photo_reimport_master_state_unref0 (self->reimport_master_state);
#line 58 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			self->reimport_master_state = _tmp15_;
#line 58 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4294 "MetadataWriter.c"
				goto __finally545;
			}
		}
		__finally545:
		{
			LibraryPhoto* _tmp16_ = NULL;
			GFile* _tmp17_ = NULL;
			GFile* _tmp18_ = NULL;
#line 60 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp16_ = self->photo;
#line 60 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp17_ = media_source_get_master_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_MEDIA_SOURCE, MediaSource));
#line 60 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp18_ = _tmp17_;
#line 60 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			library_monitor_unblacklist_file (_tmp18_);
#line 60 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_tmp18_);
#line 4313 "MetadataWriter.c"
		}
#line 57 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 57 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_propagate_error (error, _inner_error_);
#line 57 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_media_metadata_unref0 (metadata);
#line 57 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			return;
#line 4323 "MetadataWriter.c"
		}
	}
#line 64 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->wrote_master = TRUE;
#line 45 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_media_metadata_unref0 (metadata);
#line 4330 "MetadataWriter.c"
}


static void metadata_writer_commit_job_commit_editable (MetadataWriterCommitJob* self, GError** error) {
	gboolean _tmp0_ = FALSE;
	LibraryPhoto* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	PhotoMetadata* metadata = NULL;
	LibraryPhoto* _tmp7_ = NULL;
	PhotoMetadata* _tmp8_ = NULL;
	PhotoMetadata* _tmp9_ = NULL;
	PhotoMetadata* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	GError * _inner_error_ = NULL;
#line 67 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_if_fail (METADATA_WRITER_IS_COMMIT_JOB (self));
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = self->photo;
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = photo_has_editable (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO, Photo));
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (!_tmp2_) {
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = TRUE;
#line 4355 "MetadataWriter.c"
	} else {
		LibraryPhoto* _tmp3_ = NULL;
		PhotoFileFormat* _tmp4_ = NULL;
		PhotoFileFormat* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp3_ = self->photo;
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp4_ = photo_get_editable_file_format (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_PHOTO, Photo));
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp5_ = _tmp4_;
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp6_ = photo_file_format_can_write_metadata (*_tmp5_);
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp0_ = !_tmp6_;
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_free0 (_tmp5_);
#line 4373 "MetadataWriter.c"
	}
#line 68 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp0_) {
#line 69 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 4379 "MetadataWriter.c"
	}
#line 71 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = self->photo;
#line 71 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp8_ = photo_get_editable_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_PHOTO, Photo), &_inner_error_);
#line 71 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata = _tmp8_;
#line 71 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 71 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		g_propagate_error (error, _inner_error_);
#line 71 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		return;
#line 4393 "MetadataWriter.c"
	}
#line 72 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp9_ = metadata;
#line 72 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_vala_assert (_tmp9_ != NULL, "metadata != null");
#line 74 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp10_ = metadata;
#line 74 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp11_ = metadata_writer_commit_job_update_metadata (self, _tmp10_, FALSE);
#line 74 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp11_) {
#line 4405 "MetadataWriter.c"
		LibraryPhoto* _tmp12_ = NULL;
		GFile* _tmp13_ = NULL;
		GFile* _tmp14_ = NULL;
#line 75 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp12_ = self->photo;
#line 75 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp13_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_PHOTO, Photo));
#line 75 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp14_ = _tmp13_;
#line 75 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		library_monitor_blacklist_file (_tmp14_, "MetadataWriter.commit_editable");
#line 75 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_g_object_unref0 (_tmp14_);
#line 4419 "MetadataWriter.c"
		{
			LibraryPhoto* _tmp15_ = NULL;
			PhotoMetadata* _tmp16_ = NULL;
			PhotoReimportEditableState* _tmp17_ = NULL;
#line 77 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp15_ = self->photo;
#line 77 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp16_ = metadata;
#line 77 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo_persist_editable_metadata (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_PHOTO, Photo), _tmp16_, &_tmp17_, &_inner_error_);
#line 77 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_photo_reimport_editable_state_unref0 (self->reimport_editable_state);
#line 77 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			self->reimport_editable_state = _tmp17_;
#line 77 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 4436 "MetadataWriter.c"
				goto __finally546;
			}
		}
		__finally546:
		{
			LibraryPhoto* _tmp18_ = NULL;
			GFile* _tmp19_ = NULL;
			GFile* _tmp20_ = NULL;
#line 79 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp18_ = self->photo;
#line 79 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp19_ = photo_get_editable_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_PHOTO, Photo));
#line 79 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp20_ = _tmp19_;
#line 79 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			library_monitor_unblacklist_file (_tmp20_);
#line 79 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_tmp20_);
#line 4455 "MetadataWriter.c"
		}
#line 76 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 76 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			g_propagate_error (error, _inner_error_);
#line 76 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_media_metadata_unref0 (metadata);
#line 76 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			return;
#line 4465 "MetadataWriter.c"
		}
	}
#line 83 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->wrote_editable = TRUE;
#line 67 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_media_metadata_unref0 (metadata);
#line 4472 "MetadataWriter.c"
}


static gboolean metadata_writer_commit_job_update_metadata (MetadataWriterCommitJob* self, PhotoMetadata* metadata, gboolean skip_orientation) {
	gboolean result = FALSE;
	gboolean changed = FALSE;
	gchar* current_title = NULL;
	LibraryPhoto* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	PhotoMetadata* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	gchar* current_comment = NULL;
	LibraryPhoto* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	PhotoMetadata* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	Rating current_rating = 0;
	LibraryPhoto* _tmp18_ = NULL;
	Rating _tmp19_ = 0;
	Rating _tmp20_ = 0;
	PhotoMetadata* _tmp21_ = NULL;
	Rating _tmp22_ = 0;
	time_t current_exposure_time = 0;
	LibraryPhoto* _tmp25_ = NULL;
	time_t _tmp26_ = 0;
	time_t metadata_exposure_time = 0;
	MetadataDateTime* metadata_exposure_date_time = NULL;
	PhotoMetadata* _tmp27_ = NULL;
	MetadataDateTime* _tmp28_ = NULL;
	MetadataDateTime* _tmp29_ = NULL;
	time_t _tmp32_ = 0;
	time_t _tmp33_ = 0;
	GeeSet* safe_keywords = NULL;
	GeeHashSet* _tmp39_ = NULL;
	GeeSet* _tmp40_ = NULL;
	GeeSet* _tmp53_ = NULL;
	PhotoMetadata* _tmp54_ = NULL;
	GeeSet* _tmp55_ = NULL;
	GeeSet* _tmp56_ = NULL;
	gboolean _tmp57_ = FALSE;
	gboolean _tmp58_ = FALSE;
	gboolean _tmp61_ = FALSE;
	gboolean _tmp69_ = FALSE;
#line 86 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail (METADATA_WRITER_IS_COMMIT_JOB (self), FALSE);
#line 86 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_return_val_if_fail (IS_PHOTO_METADATA (metadata), FALSE);
#line 87 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	changed = FALSE;
#line 90 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = self->photo;
#line 90 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = media_source_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_MEDIA_SOURCE, MediaSource));
#line 90 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	current_title = _tmp1_;
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = current_title;
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = metadata;
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = _tmp4_;
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp6_ = g_strcmp0 (_tmp2_, _tmp5_) != 0;
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_free0 (_tmp5_);
#line 91 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp6_) {
#line 4548 "MetadataWriter.c"
		PhotoMetadata* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
#line 92 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp7_ = metadata;
#line 92 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp8_ = current_title;
#line 92 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_metadata_set_title (_tmp7_, _tmp8_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 93 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		changed = TRUE;
#line 4559 "MetadataWriter.c"
	}
#line 97 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp9_ = self->photo;
#line 97 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp10_ = media_source_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_MEDIA_SOURCE, MediaSource));
#line 97 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	current_comment = _tmp10_;
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp11_ = current_comment;
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp12_ = metadata;
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp13_ = media_metadata_get_comment (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_MEDIA_METADATA, MediaMetadata));
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp14_ = _tmp13_;
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp15_ = g_strcmp0 (_tmp11_, _tmp14_) != 0;
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_free0 (_tmp14_);
#line 98 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp15_) {
#line 4581 "MetadataWriter.c"
		PhotoMetadata* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
#line 99 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp16_ = metadata;
#line 99 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp17_ = current_comment;
#line 99 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_metadata_set_comment (_tmp16_, _tmp17_);
#line 100 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		changed = TRUE;
#line 4592 "MetadataWriter.c"
	}
#line 104 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp18_ = self->photo;
#line 104 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp19_ = media_source_get_rating (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_MEDIA_SOURCE, MediaSource));
#line 104 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	current_rating = _tmp19_;
#line 105 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp20_ = current_rating;
#line 105 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp21_ = metadata;
#line 105 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp22_ = photo_metadata_get_rating (_tmp21_);
#line 105 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp20_ != _tmp22_) {
#line 4608 "MetadataWriter.c"
		PhotoMetadata* _tmp23_ = NULL;
		Rating _tmp24_ = 0;
#line 106 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp23_ = metadata;
#line 106 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp24_ = current_rating;
#line 106 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_metadata_set_rating (_tmp23_, _tmp24_);
#line 107 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		changed = TRUE;
#line 4619 "MetadataWriter.c"
	}
#line 111 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp25_ = self->photo;
#line 111 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp26_ = media_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TYPE_MEDIA_SOURCE, MediaSource));
#line 111 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	current_exposure_time = _tmp26_;
#line 112 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_exposure_time = (time_t) 0;
#line 113 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp27_ = metadata;
#line 113 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp28_ = photo_metadata_get_exposure_date_time (_tmp27_);
#line 113 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_exposure_date_time = _tmp28_;
#line 114 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp29_ = metadata_exposure_date_time;
#line 114 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp29_ != NULL) {
#line 4639 "MetadataWriter.c"
		MetadataDateTime* _tmp30_ = NULL;
		time_t _tmp31_ = 0;
#line 115 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp30_ = metadata_exposure_date_time;
#line 115 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp31_ = metadata_date_time_get_timestamp (_tmp30_);
#line 115 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		metadata_exposure_time = _tmp31_;
#line 4648 "MetadataWriter.c"
	}
#line 116 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp32_ = current_exposure_time;
#line 116 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp33_ = metadata_exposure_time;
#line 116 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp32_ != _tmp33_) {
#line 4656 "MetadataWriter.c"
		MetadataDateTime* _tmp34_ = NULL;
		time_t _tmp35_ = 0;
		PhotoMetadata* _tmp38_ = NULL;
#line 117 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp35_ = current_exposure_time;
#line 117 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (_tmp35_ != ((time_t) 0)) {
#line 4664 "MetadataWriter.c"
			time_t _tmp36_ = 0;
			MetadataDateTime* _tmp37_ = NULL;
#line 118 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp36_ = current_exposure_time;
#line 118 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp37_ = metadata_date_time_new (_tmp36_);
#line 118 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_metadata_date_time_unref0 (_tmp34_);
#line 118 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp34_ = _tmp37_;
#line 4675 "MetadataWriter.c"
		} else {
#line 119 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_metadata_date_time_unref0 (_tmp34_);
#line 119 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp34_ = NULL;
#line 4681 "MetadataWriter.c"
		}
#line 117 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp38_ = metadata;
#line 117 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_metadata_set_exposure_date_time (_tmp38_, _tmp34_, PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 120 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		changed = TRUE;
#line 116 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_metadata_date_time_unref0 (_tmp34_);
#line 4691 "MetadataWriter.c"
	}
#line 124 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp39_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 124 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	safe_keywords = G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, GEE_TYPE_SET, GeeSet);
#line 133 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp40_ = self->current_keywords;
#line 133 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp40_ != NULL) {
#line 4701 "MetadataWriter.c"
		{
			GeeIterator* _tmp_it = NULL;
			GeeSet* _tmp41_ = NULL;
			GeeIterator* _tmp42_ = NULL;
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp41_ = self->current_keywords;
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp42_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GEE_TYPE_ITERABLE, GeeIterable));
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp_it = _tmp42_;
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			while (TRUE) {
#line 4714 "MetadataWriter.c"
				GeeIterator* _tmp43_ = NULL;
				gboolean _tmp44_ = FALSE;
				gchar* tmp = NULL;
				GeeIterator* _tmp45_ = NULL;
				gpointer _tmp46_ = NULL;
				Tag* tag = NULL;
				const gchar* _tmp47_ = NULL;
				Tag* _tmp48_ = NULL;
				GeeSet* _tmp49_ = NULL;
				Tag* _tmp50_ = NULL;
				gchar* _tmp51_ = NULL;
				gchar* _tmp52_ = NULL;
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp43_ = _tmp_it;
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp44_ = gee_iterator_next (_tmp43_);
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				if (!_tmp44_) {
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
					break;
#line 4735 "MetadataWriter.c"
				}
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp45_ = _tmp_it;
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp46_ = gee_iterator_get (_tmp45_);
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				tmp = (gchar*) _tmp46_;
#line 135 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp47_ = tmp;
#line 135 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp48_ = tag_for_path (_tmp47_);
#line 135 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				tag = _tmp48_;
#line 136 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp49_ = safe_keywords;
#line 136 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp50_ = tag;
#line 136 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp51_ = tag_get_user_visible_name (_tmp50_);
#line 136 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_tmp52_ = _tmp51_;
#line 136 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, GEE_TYPE_COLLECTION, GeeCollection), _tmp52_);
#line 136 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_free0 (_tmp52_);
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_object_unref0 (tag);
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
				_g_free0 (tmp);
#line 4765 "MetadataWriter.c"
			}
#line 134 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_g_object_unref0 (_tmp_it);
#line 4769 "MetadataWriter.c"
		}
	}
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp53_ = safe_keywords;
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp54_ = metadata;
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp55_ = photo_metadata_get_keywords (_tmp54_, NULL, NULL, NULL);
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp56_ = _tmp55_;
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp57_ = equal_sets (_tmp53_, _tmp56_);
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp58_ = !_tmp57_;
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp56_);
#line 140 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp58_) {
#line 4788 "MetadataWriter.c"
		PhotoMetadata* _tmp59_ = NULL;
		GeeSet* _tmp60_ = NULL;
#line 141 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp59_ = metadata;
#line 141 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp60_ = self->current_keywords;
#line 141 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_metadata_set_keywords (_tmp59_, G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, GEE_TYPE_COLLECTION, GeeCollection), PHOTO_METADATA_SET_OPTION_ALL_DOMAINS);
#line 142 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		changed = TRUE;
#line 4799 "MetadataWriter.c"
	}
#line 146 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp61_ = skip_orientation;
#line 146 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (!_tmp61_) {
#line 4805 "MetadataWriter.c"
		Orientation current_orientation = 0;
		LibraryPhoto* _tmp62_ = NULL;
		Orientation _tmp63_ = 0;
		Orientation _tmp64_ = 0;
		PhotoMetadata* _tmp65_ = NULL;
		Orientation _tmp66_ = 0;
#line 147 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp62_ = self->photo;
#line 147 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp63_ = photo_get_orientation (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, TYPE_PHOTO, Photo));
#line 147 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		current_orientation = _tmp63_;
#line 148 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp64_ = current_orientation;
#line 148 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp65_ = metadata;
#line 148 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp66_ = photo_metadata_get_orientation (_tmp65_);
#line 148 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		if (_tmp64_ != _tmp66_) {
#line 4826 "MetadataWriter.c"
			PhotoMetadata* _tmp67_ = NULL;
			Orientation _tmp68_ = 0;
#line 149 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp67_ = metadata;
#line 149 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			_tmp68_ = current_orientation;
#line 149 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			photo_metadata_set_orientation (_tmp67_, _tmp68_);
#line 150 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
			changed = TRUE;
#line 4837 "MetadataWriter.c"
		}
	}
#line 155 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp69_ = changed;
#line 155 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	if (_tmp69_) {
#line 4844 "MetadataWriter.c"
		PhotoMetadata* _tmp70_ = NULL;
#line 156 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		_tmp70_ = metadata;
#line 156 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
		photo_metadata_set_software (_tmp70_, RESOURCES_APP_TITLE, RESOURCES_APP_VERSION);
#line 4850 "MetadataWriter.c"
	}
#line 158 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	result = changed;
#line 158 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (safe_keywords);
#line 158 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_metadata_date_time_unref0 (metadata_exposure_date_time);
#line 158 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_free0 (current_comment);
#line 158 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_free0 (current_title);
#line 158 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	return result;
#line 4864 "MetadataWriter.c"
}


static void metadata_writer_commit_job_class_init (MetadataWriterCommitJobClass * klass) {
#line 20 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_commit_job_parent_class = g_type_class_peek_parent (klass);
#line 20 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	((BackgroundJobClass *) klass)->finalize = metadata_writer_commit_job_finalize;
#line 20 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	((BackgroundJobClass *) klass)->execute = metadata_writer_commit_job_real_execute;
#line 4875 "MetadataWriter.c"
}


static void metadata_writer_commit_job_instance_init (MetadataWriterCommitJob * self) {
#line 23 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->reimport_master_state = NULL;
#line 24 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->reimport_editable_state = NULL;
#line 25 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->err = NULL;
#line 26 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->wrote_master = FALSE;
#line 27 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->wrote_editable = FALSE;
#line 4890 "MetadataWriter.c"
}


static void metadata_writer_commit_job_finalize (BackgroundJob* obj) {
	MetadataWriterCommitJob * self;
#line 20 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, METADATA_WRITER_TYPE_COMMIT_JOB, MetadataWriterCommitJob);
#line 21 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->photo);
#line 22 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->current_keywords);
#line 23 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_photo_reimport_master_state_unref0 (self->reimport_master_state);
#line 24 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_photo_reimport_editable_state_unref0 (self->reimport_editable_state);
#line 25 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_error_free0 (self->err);
#line 20 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	BACKGROUND_JOB_CLASS (metadata_writer_commit_job_parent_class)->finalize (obj);
#line 4910 "MetadataWriter.c"
}


static GType metadata_writer_commit_job_get_type (void) {
	static volatile gsize metadata_writer_commit_job_type_id__volatile = 0;
	if (g_once_init_enter (&metadata_writer_commit_job_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MetadataWriterCommitJobClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) metadata_writer_commit_job_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MetadataWriterCommitJob), 0, (GInstanceInitFunc) metadata_writer_commit_job_instance_init, NULL };
		GType metadata_writer_commit_job_type_id;
		metadata_writer_commit_job_type_id = g_type_register_static (TYPE_BACKGROUND_JOB, "MetadataWriterCommitJob", &g_define_type_info, 0);
		g_once_init_leave (&metadata_writer_commit_job_type_id__volatile, metadata_writer_commit_job_type_id);
	}
	return metadata_writer_commit_job_type_id__volatile;
}


static void metadata_writer_class_init (MetadataWriterClass * klass) {
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	metadata_writer_parent_class = g_type_class_peek_parent (klass);
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_type_class_add_private (klass, sizeof (MetadataWriterPrivate));
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	G_OBJECT_CLASS (klass)->finalize = metadata_writer_finalize;
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_new ("progress", TYPE_METADATA_WRITER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
#line 4935 "MetadataWriter.c"
}


static void metadata_writer_instance_init (MetadataWriter * self) {
	Workers* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
	GeeHashSet* _tmp2_ = NULL;
	GeeHashSet* _tmp3_ = NULL;
	GeeHashSet* _tmp4_ = NULL;
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv = METADATA_WRITER_GET_PRIVATE (self);
#line 164 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = workers_new ((guint) 1, FALSE);
#line 164 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->workers = _tmp0_;
#line 165 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->enabled = FALSE;
#line 167 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = gee_hash_map_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, METADATA_WRITER_TYPE_COMMIT_JOB, (GBoxedCopyFunc) background_job_ref, background_job_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 167 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->pending = _tmp1_;
#line 168 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp2_ = gee_hash_set_new (METADATA_WRITER_TYPE_COMMIT_JOB, (GBoxedCopyFunc) background_job_ref, background_job_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 168 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->pending_cancel = _tmp2_;
#line 169 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
#line 169 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->interested_photo_details = _tmp3_;
#line 170 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->ignore_photo_alteration = NULL;
#line 171 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->outstanding_total = (guint) 0;
#line 172 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->outstanding_completed = (guint) 0;
#line 173 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->closed = FALSE;
#line 174 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->pause_count = 0;
#line 175 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp4_ = gee_hash_set_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
#line 175 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self->priv->importing_photos = _tmp4_;
#line 4979 "MetadataWriter.c"
}


static void metadata_writer_finalize (GObject* obj) {
	MetadataWriter * self;
	ConfigFacade* _tmp0_ = NULL;
	ConfigFacade* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	LibraryPhotoSourceCollection* _tmp3_ = NULL;
	guint _tmp4_ = 0U;
	LibraryPhotoSourceCollection* _tmp5_ = NULL;
	guint _tmp6_ = 0U;
	LibraryPhotoSourceCollection* _tmp7_ = NULL;
	guint _tmp8_ = 0U;
	LibraryPhotoSourceCollection* _tmp9_ = NULL;
	guint _tmp10_ = 0U;
	LibraryPhotoSourceCollection* _tmp11_ = NULL;
	guint _tmp12_ = 0U;
	LibraryPhotoSourceCollection* _tmp13_ = NULL;
	guint _tmp14_ = 0U;
	LibraryPhotoSourceCollection* _tmp15_ = NULL;
	guint _tmp16_ = 0U;
	TagSourceCollection* _tmp17_ = NULL;
	guint _tmp18_ = 0U;
	TagSourceCollection* _tmp19_ = NULL;
	guint _tmp20_ = 0U;
	TagSourceCollection* _tmp21_ = NULL;
	guint _tmp22_ = 0U;
	TagSourceCollection* _tmp23_ = NULL;
	guint _tmp24_ = 0U;
	TagSourceCollection* _tmp25_ = NULL;
	guint _tmp26_ = 0U;
	Application* _tmp27_ = NULL;
	Application* _tmp28_ = NULL;
	guint _tmp29_ = 0U;
	LibraryMonitorPool* _tmp30_ = NULL;
	LibraryMonitorPool* _tmp31_ = NULL;
	guint _tmp32_ = 0U;
	LibraryMonitorPool* _tmp33_ = NULL;
	LibraryMonitorPool* _tmp34_ = NULL;
	guint _tmp35_ = 0U;
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_METADATA_WRITER, MetadataWriter);
#line 220 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp0_ = config_facade_get_instance ();
#line 220 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp1_ = _tmp0_;
#line 220 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("commit-metadata-to-masters-changed", TYPE_CONFIGURATION_FACADE, &_tmp2_, NULL, FALSE);
#line 220 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _metadata_writer_on_config_changed_configuration_facade_commit_metadata_to_masters_changed, self);
#line 220 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (_tmp1_);
#line 222 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp3_ = library_photo_global;
#line 222 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("media-import-starting", TYPE_MEDIA_SOURCE_COLLECTION, &_tmp4_, NULL, FALSE);
#line 222 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _metadata_writer_on_importing_photos_media_source_collection_media_import_starting, self);
#line 223 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp5_ = library_photo_global;
#line 223 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("media-import-completed", TYPE_MEDIA_SOURCE_COLLECTION, &_tmp6_, NULL, FALSE);
#line 223 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _metadata_writer_on_photos_imported_media_source_collection_media_import_completed, self);
#line 224 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp7_ = library_photo_global;
#line 224 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("contents-altered", TYPE_DATA_COLLECTION, &_tmp8_, NULL, FALSE);
#line 224 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) _metadata_writer_on_photos_added_removed_data_collection_contents_altered, self);
#line 225 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp9_ = library_photo_global;
#line 225 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp10_, NULL, FALSE);
#line 225 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp10_, 0, NULL, (GCallback) _metadata_writer_on_photos_altered_data_collection_items_altered, self);
#line 226 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp11_ = library_photo_global;
#line 226 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("frozen", TYPE_DATA_COLLECTION, &_tmp12_, NULL, FALSE);
#line 226 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp12_, 0, NULL, (GCallback) _metadata_writer_on_collection_frozen_data_collection_frozen, self);
#line 227 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp13_ = library_photo_global;
#line 227 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("thawed", TYPE_DATA_COLLECTION, &_tmp14_, NULL, FALSE);
#line 227 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp14_, 0, NULL, (GCallback) _metadata_writer_on_collection_thawed_data_collection_thawed, self);
#line 228 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp15_ = library_photo_global;
#line 228 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("items-destroyed", TYPE_SOURCE_COLLECTION, &_tmp16_, NULL, FALSE);
#line 228 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_SOURCE_COLLECTION, SourceCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp16_, 0, NULL, (GCallback) _metadata_writer_on_photos_destroyed_source_collection_items_destroyed, self);
#line 230 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp17_ = tag_global;
#line 230 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp18_, NULL, FALSE);
#line 230 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp18_, 0, NULL, (GCallback) _metadata_writer_on_tags_altered_data_collection_items_altered, self);
#line 231 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp19_ = tag_global;
#line 231 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("container-contents-altered", TYPE_CONTAINER_SOURCE_COLLECTION, &_tmp20_, NULL, FALSE);
#line 231 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp20_, 0, NULL, (GCallback) _metadata_writer_on_tag_contents_altered_container_source_collection_container_contents_altered, self);
#line 232 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp21_ = tag_global;
#line 232 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("backlink-to-container-removed", TYPE_CONTAINER_SOURCE_COLLECTION, &_tmp22_, NULL, FALSE);
#line 232 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp22_, 0, NULL, (GCallback) _metadata_writer_on_tag_backlink_removed_container_source_collection_backlink_to_container_removed, self);
#line 233 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp23_ = tag_global;
#line 233 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("frozen", TYPE_DATA_COLLECTION, &_tmp24_, NULL, FALSE);
#line 233 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp24_, 0, NULL, (GCallback) _metadata_writer_on_collection_frozen_data_collection_frozen, self);
#line 234 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp25_ = tag_global;
#line 234 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("thawed", TYPE_DATA_COLLECTION, &_tmp26_, NULL, FALSE);
#line 234 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp26_, 0, NULL, (GCallback) _metadata_writer_on_collection_thawed_data_collection_thawed, self);
#line 236 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp27_ = application_get_instance ();
#line 236 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp28_ = _tmp27_;
#line 236 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("exiting", TYPE_APPLICATION, &_tmp29_, NULL, FALSE);
#line 236 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (_tmp28_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp29_, 0, NULL, (GCallback) _metadata_writer_on_application_exiting_application_exiting, self);
#line 236 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_application_unref0 (_tmp28_);
#line 238 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp30_ = library_monitor_pool_get_instance ();
#line 238 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp31_ = _tmp30_;
#line 238 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("monitor-installed", TYPE_LIBRARY_MONITOR_POOL, &_tmp32_, NULL, FALSE);
#line 238 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (_tmp31_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp32_, 0, NULL, (GCallback) _metadata_writer_on_monitor_installed_library_monitor_pool_monitor_installed, self);
#line 238 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_library_monitor_pool_unref0 (_tmp31_);
#line 239 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp33_ = library_monitor_pool_get_instance ();
#line 239 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_tmp34_ = _tmp33_;
#line 239 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_parse_name ("monitor-destroyed", TYPE_LIBRARY_MONITOR_POOL, &_tmp35_, NULL, FALSE);
#line 239 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	g_signal_handlers_disconnect_matched (_tmp34_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp35_, 0, NULL, (GCallback) _metadata_writer_on_monitor_destroyed_library_monitor_pool_monitor_destroyed, self);
#line 239 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_library_monitor_pool_unref0 (_tmp34_);
#line 164 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_workers_unref0 (self->priv->workers);
#line 166 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_timed_queue_unref0 (self->priv->dirty);
#line 167 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->priv->pending);
#line 168 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->priv->pending_cancel);
#line 169 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->priv->interested_photo_details);
#line 170 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->priv->ignore_photo_alteration);
#line 175 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	_g_object_unref0 (self->priv->importing_photos);
#line 14 "/home/jens/Source/shotwell/src/MetadataWriter.vala"
	G_OBJECT_CLASS (metadata_writer_parent_class)->finalize (obj);
#line 5151 "MetadataWriter.c"
}


GType metadata_writer_get_type (void) {
	static volatile gsize metadata_writer_type_id__volatile = 0;
	if (g_once_init_enter (&metadata_writer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MetadataWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) metadata_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MetadataWriter), 0, (GInstanceInitFunc) metadata_writer_instance_init, NULL };
		GType metadata_writer_type_id;
		metadata_writer_type_id = g_type_register_static (G_TYPE_OBJECT, "MetadataWriter", &g_define_type_info, 0);
		g_once_init_leave (&metadata_writer_type_id__volatile, metadata_writer_type_id);
	}
	return metadata_writer_type_id__volatile;
}