summaryrefslogtreecommitdiff
path: root/src/util/file.c
blob: 3f4b228e6095a4d5374630adc2f946f2c95fa5e8 (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
/* file.c generated by valac 0.34.7, the Vala compiler
 * generated from file.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.
 */
/* Returns true if the file is claimed, false if it exists, and throws an Error otherwise.  The file*/
/* will be created when the function exits and should be overwritten.  Note that the file is not*/
/* held open; claiming a file is merely based on its existence.*/
/**/
/* This function is thread-safe.*/

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

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, void* user_data);


gboolean claim_file (GFile* file, GError** error);
GFile* generate_unique_file (GFile* dir, const gchar* basename, gboolean* collision, GError** error);
void disassemble_filename (const gchar* basename, gchar** name, gchar** ext);
glong find_last_offset (const gchar* str, gchar c);
guint64 query_total_file_size (GFile* file_or_dir, GCancellable* cancellable, GError** error);
void delete_all_files (GFile* dir, GeeSet* exceptions, ProgressMonitor monitor, void* monitor_target, guint64 file_count, GCancellable* cancellable, GError** error);
time_t query_file_modified (GFile* file, GError** error);
gboolean query_is_directory (GFile* file);
gboolean query_is_directory_empty (GFile* dir, GError** error);
gchar* get_display_pathname (GFile* file);
gchar* strip_pretty_path (const gchar* path);
gchar* get_file_info_id (GFileInfo* info);
void skip_uint64 (GInputStream* input, guint64 skip_amount, GError** error);
guint64 count_files_in_directory (GFile* dir, GError** error);
gboolean file_equal (GFile* a, GFile* b);
guint file_hash (GFile* file);


static gpointer _g_error_copy0 (gpointer self) {
#line 23 "/home/jens/Source/shotwell/src/util/file.vala"
	return self ? g_error_copy (self) : NULL;
#line 52 "file.c"
}


gboolean claim_file (GFile* file, GError** error) {
	gboolean result = FALSE;
	gboolean _tmp11_ = FALSE;
	GError * _inner_error_ = NULL;
#line 12 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 62 "file.c"
	{
		GFile* _tmp0_ = NULL;
		GFileOutputStream* _tmp1_ = NULL;
		GFileOutputStream* _tmp2_ = NULL;
#line 14 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp0_ = file;
#line 14 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp1_ = g_file_create (_tmp0_, G_FILE_CREATE_NONE, NULL, &_inner_error_);
#line 14 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp2_ = _tmp1_;
#line 14 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (_tmp2_);
#line 14 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 77 "file.c"
			goto __catch0_g_error;
		}
#line 17 "/home/jens/Source/shotwell/src/util/file.vala"
		result = TRUE;
#line 17 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 84 "file.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp3_ = NULL;
#line 13 "/home/jens/Source/shotwell/src/util/file.vala"
		err = _inner_error_;
#line 13 "/home/jens/Source/shotwell/src/util/file.vala"
		_inner_error_ = NULL;
#line 20 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp3_ = err;
#line 20 "/home/jens/Source/shotwell/src/util/file.vala"
		if (!g_error_matches (_tmp3_, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
#line 99 "file.c"
			GFile* _tmp4_ = NULL;
			gchar* _tmp5_ = NULL;
			gchar* _tmp6_ = NULL;
			GError* _tmp7_ = NULL;
			const gchar* _tmp8_ = NULL;
			GError* _tmp9_ = NULL;
			GError* _tmp10_ = NULL;
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp4_ = file;
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp5_ = g_file_get_path (_tmp4_);
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp6_ = _tmp5_;
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp7_ = err;
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp8_ = _tmp7_->message;
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			g_warning ("file.vala:21: claim_file %s: %s", _tmp6_, _tmp8_);
#line 21 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_free0 (_tmp6_);
#line 23 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp9_ = err;
#line 23 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp10_ = _g_error_copy0 (_tmp9_);
#line 23 "/home/jens/Source/shotwell/src/util/file.vala"
			_inner_error_ = _tmp10_;
#line 23 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_error_free0 (err);
#line 129 "file.c"
			goto __finally0;
		}
#line 26 "/home/jens/Source/shotwell/src/util/file.vala"
		result = FALSE;
#line 26 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_error_free0 (err);
#line 26 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 138 "file.c"
	}
	__finally0:
#line 13 "/home/jens/Source/shotwell/src/util/file.vala"
	g_propagate_error (error, _inner_error_);
#line 13 "/home/jens/Source/shotwell/src/util/file.vala"
	return _tmp11_;
#line 145 "file.c"
}


GFile* generate_unique_file (GFile* dir, const gchar* basename, gboolean* collision, GError** error) {
	gboolean _vala_collision = FALSE;
	GFile* result = NULL;
	GFile* file = NULL;
	GFile* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	GFile* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gchar* name = NULL;
	gchar* ext = NULL;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	GFile* _tmp28_ = NULL;
	gchar* _tmp29_ = NULL;
	gchar* _tmp30_ = NULL;
	const gchar* _tmp31_ = NULL;
	GError * _inner_error_ = NULL;
#line 36 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (dir), NULL);
#line 36 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (basename != NULL, NULL);
#line 38 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = dir;
#line 38 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = basename;
#line 38 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = g_file_get_child (_tmp0_, _tmp1_);
#line 38 "/home/jens/Source/shotwell/src/util/file.vala"
	file = _tmp2_;
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp4_ = file;
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp5_ = claim_file (_tmp4_, &_inner_error_);
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp3_ = _tmp5_;
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (file);
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
		return NULL;
#line 195 "file.c"
	}
#line 39 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp3_) {
#line 40 "/home/jens/Source/shotwell/src/util/file.vala"
		_vala_collision = FALSE;
#line 42 "/home/jens/Source/shotwell/src/util/file.vala"
		result = file;
#line 42 "/home/jens/Source/shotwell/src/util/file.vala"
		if (collision) {
#line 42 "/home/jens/Source/shotwell/src/util/file.vala"
			*collision = _vala_collision;
#line 207 "file.c"
		}
#line 42 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 211 "file.c"
	}
#line 46 "/home/jens/Source/shotwell/src/util/file.vala"
	_vala_collision = TRUE;
#line 49 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp6_ = basename;
#line 49 "/home/jens/Source/shotwell/src/util/file.vala"
	disassemble_filename (_tmp6_, &_tmp7_, &_tmp8_);
#line 49 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (name);
#line 49 "/home/jens/Source/shotwell/src/util/file.vala"
	name = _tmp7_;
#line 49 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (ext);
#line 49 "/home/jens/Source/shotwell/src/util/file.vala"
	ext = _tmp8_;
#line 227 "file.c"
	{
		gint ctr = 0;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
		ctr = 1;
#line 232 "file.c"
		{
			gboolean _tmp9_ = FALSE;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp9_ = TRUE;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
			while (TRUE) {
#line 239 "file.c"
				gint _tmp11_ = 0;
				gchar* _tmp12_ = NULL;
				const gchar* _tmp13_ = NULL;
				gchar* new_name = NULL;
				gchar* _tmp21_ = NULL;
				GFile* _tmp22_ = NULL;
				const gchar* _tmp23_ = NULL;
				GFile* _tmp24_ = NULL;
				gboolean _tmp25_ = FALSE;
				GFile* _tmp26_ = NULL;
				gboolean _tmp27_ = FALSE;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
				if (!_tmp9_) {
#line 253 "file.c"
					gint _tmp10_ = 0;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp10_ = ctr;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
					ctr = _tmp10_ + 1;
#line 259 "file.c"
				}
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp9_ = FALSE;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp11_ = ctr;
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
				if (!(_tmp11_ < G_MAXINT)) {
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
					break;
#line 269 "file.c"
				}
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp13_ = ext;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
				if (_tmp13_ != NULL) {
#line 275 "file.c"
					const gchar* _tmp14_ = NULL;
					gint _tmp15_ = 0;
					const gchar* _tmp16_ = NULL;
					gchar* _tmp17_ = NULL;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp14_ = name;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp15_ = ctr;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp16_ = ext;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp17_ = g_strdup_printf ("%s_%d.%s", _tmp14_, _tmp15_, _tmp16_);
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (_tmp12_);
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp12_ = _tmp17_;
#line 292 "file.c"
				} else {
					const gchar* _tmp18_ = NULL;
					gint _tmp19_ = 0;
					gchar* _tmp20_ = NULL;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp18_ = name;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp19_ = ctr;
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp20_ = g_strdup_printf ("%s_%d", _tmp18_, _tmp19_);
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (_tmp12_);
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
					_tmp12_ = _tmp20_;
#line 307 "file.c"
				}
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp21_ = g_strdup (_tmp12_);
#line 53 "/home/jens/Source/shotwell/src/util/file.vala"
				new_name = _tmp21_;
#line 55 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp22_ = dir;
#line 55 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp23_ = new_name;
#line 55 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp24_ = g_file_get_child (_tmp22_, _tmp23_);
#line 55 "/home/jens/Source/shotwell/src/util/file.vala"
				_g_object_unref0 (file);
#line 55 "/home/jens/Source/shotwell/src/util/file.vala"
				file = _tmp24_;
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp26_ = file;
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp27_ = claim_file (_tmp26_, &_inner_error_);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp25_ = _tmp27_;
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					g_propagate_error (error, _inner_error_);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (new_name);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (_tmp12_);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (ext);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (name);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_object_unref0 (file);
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
					return NULL;
#line 345 "file.c"
				}
#line 56 "/home/jens/Source/shotwell/src/util/file.vala"
				if (_tmp25_) {
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					result = file;
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (new_name);
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (_tmp12_);
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (ext);
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					_g_free0 (name);
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					if (collision) {
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
						*collision = _vala_collision;
#line 363 "file.c"
					}
#line 57 "/home/jens/Source/shotwell/src/util/file.vala"
					return result;
#line 367 "file.c"
				}
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
				_g_free0 (new_name);
#line 52 "/home/jens/Source/shotwell/src/util/file.vala"
				_g_free0 (_tmp12_);
#line 373 "file.c"
			}
		}
	}
#line 60 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp28_ = dir;
#line 60 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp29_ = g_file_get_path (_tmp28_);
#line 60 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp30_ = _tmp29_;
#line 60 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp31_ = basename;
#line 60 "/home/jens/Source/shotwell/src/util/file.vala"
	g_warning ("file.vala:60: generate_unique_filename %s for %s: unable to claim file", _tmp30_, _tmp31_);
#line 60 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (_tmp30_);
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
	result = NULL;
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (ext);
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (name);
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (file);
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
	if (collision) {
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
		*collision = _vala_collision;
#line 401 "file.c"
	}
#line 62 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 405 "file.c"
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_ = NULL;
	glong _tmp1_ = 0L;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = maxlen;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	end = _tmp2_;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp3_ = end;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp3_ == NULL) {
#line 428 "file.c"
		glong _tmp4_ = 0L;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = maxlen;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp4_;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 436 "file.c"
	} else {
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = end;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = str;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = (glong) (_tmp5_ - _tmp6_);
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 448 "file.c"
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_ = 0L;
	glong _tmp8_ = 0L;
	glong _tmp14_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	glong _tmp21_ = 0L;
	gchar* _tmp22_ = NULL;
#line 1306 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = offset;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp1_ >= ((glong) 0)) {
#line 472 "file.c"
		glong _tmp2_ = 0L;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp2_ = len;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = _tmp2_ >= ((glong) 0);
#line 478 "file.c"
	} else {
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 482 "file.c"
	}
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 486 "file.c"
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		glong _tmp5_ = 0L;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp3_ = offset;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = len;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = _tmp5_;
#line 498 "file.c"
	} else {
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = strlen (self);
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp6_;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp7_;
#line 508 "file.c"
	}
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp8_ = offset;
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp8_ < ((glong) 0)) {
#line 514 "file.c"
		glong _tmp9_ = 0L;
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp9_ = string_length;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp10_ = offset;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		offset = _tmp9_ + _tmp10_;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp11_ = offset;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
#line 528 "file.c"
	} else {
		glong _tmp12_ = 0L;
		glong _tmp13_ = 0L;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp12_ = offset;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp13_ = string_length;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
#line 538 "file.c"
	}
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp14_ = len;
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp14_ < ((glong) 0)) {
#line 544 "file.c"
		glong _tmp15_ = 0L;
		glong _tmp16_ = 0L;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp16_ = offset;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		len = _tmp15_ - _tmp16_;
#line 553 "file.c"
	}
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp17_ = offset;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp18_ = len;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp19_ = string_length;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp20_ = offset;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp21_ = len;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _tmp22_;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 573 "file.c"
}


void disassemble_filename (const gchar* basename, gchar** name, gchar** ext) {
	gchar* _vala_name = NULL;
	gchar* _vala_ext = NULL;
	glong offset = 0L;
	const gchar* _tmp0_ = NULL;
	glong _tmp1_ = 0L;
	glong _tmp2_ = 0L;
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_if_fail (basename != NULL);
#line 66 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = basename;
#line 66 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = find_last_offset (_tmp0_, '.');
#line 66 "/home/jens/Source/shotwell/src/util/file.vala"
	offset = _tmp1_;
#line 67 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = offset;
#line 67 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp2_ <= ((glong) 0)) {
#line 596 "file.c"
		const gchar* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
#line 68 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp3_ = basename;
#line 68 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp4_ = g_strdup (_tmp3_);
#line 68 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_vala_name);
#line 68 "/home/jens/Source/shotwell/src/util/file.vala"
		_vala_name = _tmp4_;
#line 69 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_vala_ext);
#line 69 "/home/jens/Source/shotwell/src/util/file.vala"
		_vala_ext = NULL;
#line 611 "file.c"
	} else {
		const gchar* _tmp5_ = NULL;
		glong _tmp6_ = 0L;
		gchar* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		glong _tmp9_ = 0L;
		gchar* _tmp10_ = NULL;
#line 71 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp5_ = basename;
#line 71 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp6_ = offset;
#line 71 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp7_ = string_substring (_tmp5_, (glong) 0, _tmp6_);
#line 71 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_vala_name);
#line 71 "/home/jens/Source/shotwell/src/util/file.vala"
		_vala_name = _tmp7_;
#line 72 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp8_ = basename;
#line 72 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp9_ = offset;
#line 72 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp10_ = string_substring (_tmp8_, _tmp9_ + 1, (glong) -1);
#line 72 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_vala_ext);
#line 72 "/home/jens/Source/shotwell/src/util/file.vala"
		_vala_ext = _tmp10_;
#line 639 "file.c"
	}
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
	if (name) {
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
		*name = _vala_name;
#line 645 "file.c"
	} else {
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_vala_name);
#line 649 "file.c"
	}
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
	if (ext) {
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
		*ext = _vala_ext;
#line 655 "file.c"
	} else {
#line 65 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_vala_ext);
#line 659 "file.c"
	}
}


guint64 query_total_file_size (GFile* file_or_dir, GCancellable* cancellable, GError** error) {
	guint64 result = 0ULL;
	GFileType type = 0;
	GFile* _tmp0_ = NULL;
	GFileType _tmp1_ = 0;
	GFileType _tmp2_ = 0;
	GFileEnumerator* enumerator = NULL;
	guint64 total_bytes = 0ULL;
	GFileInfo* info = NULL;
	GError * _inner_error_ = NULL;
#line 77 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (file_or_dir), 0ULL);
#line 77 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail ((cancellable == NULL) || G_IS_CANCELLABLE (cancellable), 0ULL);
#line 78 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = file_or_dir;
#line 78 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL);
#line 78 "/home/jens/Source/shotwell/src/util/file.vala"
	type = _tmp1_;
#line 79 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = type;
#line 79 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp2_ == G_FILE_TYPE_REGULAR) {
#line 688 "file.c"
		GFileInfo* info = NULL;
		GFileInfo* _tmp17_ = NULL;
		gint64 _tmp18_ = 0LL;
#line 80 "/home/jens/Source/shotwell/src/util/file.vala"
		info = NULL;
#line 694 "file.c"
		{
			GFileInfo* _tmp3_ = NULL;
			GFile* _tmp4_ = NULL;
			GCancellable* _tmp5_ = NULL;
			GFileInfo* _tmp6_ = NULL;
			GFileInfo* _tmp7_ = NULL;
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp4_ = file_or_dir;
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp5_ = cancellable;
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp6_ = g_file_query_info (_tmp4_, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, _tmp5_, &_inner_error_);
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp3_ = _tmp6_;
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 711 "file.c"
				goto __catch1_g_error;
			}
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp7_ = _tmp3_;
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp3_ = NULL;
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 82 "/home/jens/Source/shotwell/src/util/file.vala"
			info = _tmp7_;
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp3_);
#line 724 "file.c"
		}
		goto __finally1;
		__catch1_g_error:
		{
			GError* err = NULL;
			GError* _tmp8_ = NULL;
			GFile* _tmp11_ = NULL;
			gchar* _tmp12_ = NULL;
			gchar* _tmp13_ = NULL;
			GError* _tmp14_ = NULL;
			const gchar* _tmp15_ = NULL;
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
			err = _inner_error_;
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
			_inner_error_ = NULL;
#line 85 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp8_ = err;
#line 85 "/home/jens/Source/shotwell/src/util/file.vala"
			if (g_error_matches (_tmp8_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
#line 744 "file.c"
				GError* _tmp9_ = NULL;
				GError* _tmp10_ = NULL;
#line 86 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp9_ = err;
#line 86 "/home/jens/Source/shotwell/src/util/file.vala"
				_tmp10_ = _g_error_copy0 (_tmp9_);
#line 86 "/home/jens/Source/shotwell/src/util/file.vala"
				_inner_error_ = _tmp10_;
#line 86 "/home/jens/Source/shotwell/src/util/file.vala"
				_g_error_free0 (err);
#line 755 "file.c"
				goto __finally1;
			}
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp11_ = file_or_dir;
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp12_ = g_file_get_path (_tmp11_);
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp13_ = _tmp12_;
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp14_ = err;
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp15_ = _tmp14_->message;
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			g_debug ("file.vala:88: Unable to query filesize for %s: %s", _tmp13_, _tmp15_);
#line 88 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_free0 (_tmp13_);
#line 90 "/home/jens/Source/shotwell/src/util/file.vala"
			result = (guint64) 0;
#line 90 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_error_free0 (err);
#line 90 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 90 "/home/jens/Source/shotwell/src/util/file.vala"
			return result;
#line 780 "file.c"
		}
		__finally1:
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 785 "file.c"
			guint64 _tmp16_ = 0ULL;
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
			g_propagate_error (error, _inner_error_);
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 81 "/home/jens/Source/shotwell/src/util/file.vala"
			return _tmp16_;
#line 793 "file.c"
		}
#line 93 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp17_ = info;
#line 93 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp18_ = g_file_info_get_size (_tmp17_);
#line 93 "/home/jens/Source/shotwell/src/util/file.vala"
		result = (guint64) _tmp18_;
#line 93 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (info);
#line 93 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 805 "file.c"
	} else {
		GFileType _tmp19_ = 0;
#line 94 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp19_ = type;
#line 94 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp19_ != G_FILE_TYPE_DIRECTORY) {
#line 95 "/home/jens/Source/shotwell/src/util/file.vala"
			result = (guint64) 0;
#line 95 "/home/jens/Source/shotwell/src/util/file.vala"
			return result;
#line 816 "file.c"
		}
	}
	{
		GFileEnumerator* _tmp20_ = NULL;
		GFile* _tmp21_ = NULL;
		GCancellable* _tmp22_ = NULL;
		GFileEnumerator* _tmp23_ = NULL;
		GFileEnumerator* _tmp24_ = NULL;
		GFileEnumerator* _tmp25_ = NULL;
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp21_ = file_or_dir;
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp22_ = cancellable;
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp23_ = g_file_enumerate_children (_tmp21_, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, _tmp22_, &_inner_error_);
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp20_ = _tmp23_;
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 836 "file.c"
			goto __catch2_g_error;
		}
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp24_ = _tmp20_;
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp20_ = NULL;
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (enumerator);
#line 100 "/home/jens/Source/shotwell/src/util/file.vala"
		enumerator = _tmp24_;
#line 102 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp25_ = enumerator;
#line 102 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp25_ == NULL) {
#line 103 "/home/jens/Source/shotwell/src/util/file.vala"
			result = (guint64) 0;
#line 103 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp20_);
#line 103 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 103 "/home/jens/Source/shotwell/src/util/file.vala"
			return result;
#line 859 "file.c"
		}
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (_tmp20_);
#line 863 "file.c"
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* err = NULL;
		gboolean _tmp26_ = FALSE;
		GError* _tmp27_ = NULL;
		GError* _tmp29_ = NULL;
		GError* _tmp30_ = NULL;
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
		err = _inner_error_;
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
		_inner_error_ = NULL;
#line 106 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp27_ = err;
#line 106 "/home/jens/Source/shotwell/src/util/file.vala"
		if (g_error_matches (_tmp27_, G_FILE_ERROR, G_FILE_ERROR_PERM)) {
#line 106 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp26_ = TRUE;
#line 883 "file.c"
		} else {
			GError* _tmp28_ = NULL;
#line 106 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp28_ = err;
#line 106 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp26_ = g_error_matches (_tmp28_, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED);
#line 890 "file.c"
		}
#line 106 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp26_) {
#line 107 "/home/jens/Source/shotwell/src/util/file.vala"
			result = (guint64) 0;
#line 107 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_error_free0 (err);
#line 107 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 107 "/home/jens/Source/shotwell/src/util/file.vala"
			return result;
#line 902 "file.c"
		}
#line 109 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp29_ = err;
#line 109 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp30_ = _g_error_copy0 (_tmp29_);
#line 109 "/home/jens/Source/shotwell/src/util/file.vala"
		_inner_error_ = _tmp30_;
#line 109 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_error_free0 (err);
#line 912 "file.c"
		goto __finally2;
	}
	__finally2:
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 918 "file.c"
		guint64 _tmp31_ = 0ULL;
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (enumerator);
#line 99 "/home/jens/Source/shotwell/src/util/file.vala"
		return _tmp31_;
#line 926 "file.c"
	}
#line 112 "/home/jens/Source/shotwell/src/util/file.vala"
	total_bytes = (guint64) 0;
#line 114 "/home/jens/Source/shotwell/src/util/file.vala"
	info = NULL;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
	while (TRUE) {
#line 934 "file.c"
		GFileInfo* _tmp32_ = NULL;
		GFileEnumerator* _tmp33_ = NULL;
		GCancellable* _tmp34_ = NULL;
		GFileInfo* _tmp35_ = NULL;
		GFileInfo* _tmp37_ = NULL;
		GFileInfo* _tmp38_ = NULL;
		guint64 _tmp39_ = 0ULL;
		GFile* _tmp40_ = NULL;
		GFileInfo* _tmp41_ = NULL;
		const gchar* _tmp42_ = NULL;
		GFile* _tmp43_ = NULL;
		GFile* _tmp44_ = NULL;
		GCancellable* _tmp45_ = NULL;
		guint64 _tmp46_ = 0ULL;
		guint64 _tmp47_ = 0ULL;
		guint64 _tmp49_ = 0ULL;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp33_ = enumerator;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp34_ = cancellable;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp35_ = g_file_enumerator_next_file (_tmp33_, _tmp34_, &_inner_error_);
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp32_ = _tmp35_;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 961 "file.c"
			guint64 _tmp36_ = 0ULL;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
			g_propagate_error (error, _inner_error_);
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
			return _tmp36_;
#line 971 "file.c"
		}
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp37_ = _tmp32_;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp32_ = NULL;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (info);
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		info = _tmp37_;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp38_ = info;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		if (!(_tmp38_ != NULL)) {
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp32_);
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
			break;
#line 989 "file.c"
		}
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp40_ = file_or_dir;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp41_ = info;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp42_ = g_file_info_get_name (_tmp41_);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp43_ = g_file_get_child (_tmp40_, _tmp42_);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp44_ = _tmp43_;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp45_ = cancellable;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp46_ = query_total_file_size (_tmp44_, _tmp45_, &_inner_error_);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp47_ = _tmp46_;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (_tmp44_);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp39_ = _tmp47_;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1013 "file.c"
			guint64 _tmp48_ = 0ULL;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
			g_propagate_error (error, _inner_error_);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp32_);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
			return _tmp48_;
#line 1025 "file.c"
		}
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp49_ = total_bytes;
#line 116 "/home/jens/Source/shotwell/src/util/file.vala"
		total_bytes = _tmp49_ + _tmp39_;
#line 115 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (_tmp32_);
#line 1033 "file.c"
	}
#line 118 "/home/jens/Source/shotwell/src/util/file.vala"
	result = total_bytes;
#line 118 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (info);
#line 118 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (enumerator);
#line 118 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1043 "file.c"
}


void delete_all_files (GFile* dir, GeeSet* exceptions, ProgressMonitor monitor, void* monitor_target, guint64 file_count, GCancellable* cancellable, GError** error) {
	GFileType type = 0;
	GFile* _tmp0_ = NULL;
	GFileType _tmp1_ = 0;
	GFileType _tmp2_ = 0;
	GFileEnumerator* enumerator = NULL;
	GFile* _tmp10_ = NULL;
	GCancellable* _tmp11_ = NULL;
	GFileEnumerator* _tmp12_ = NULL;
	GFileInfo* info = NULL;
	guint64 i = 0ULL;
	GError * _inner_error_ = NULL;
#line 125 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_if_fail (G_IS_FILE (dir));
#line 125 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_if_fail ((exceptions == NULL) || GEE_IS_SET (exceptions));
#line 125 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_if_fail ((cancellable == NULL) || G_IS_CANCELLABLE (cancellable));
#line 127 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = dir;
#line 127 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL);
#line 127 "/home/jens/Source/shotwell/src/util/file.vala"
	type = _tmp1_;
#line 128 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = type;
#line 128 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp2_ != G_FILE_TYPE_DIRECTORY) {
#line 1075 "file.c"
		GFile* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		GError* _tmp8_ = NULL;
		GError* _tmp9_ = NULL;
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp3_ = dir;
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp4_ = g_file_get_path (_tmp3_);
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp5_ = _tmp4_;
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp6_ = g_strdup_printf ("%s is not a directory", _tmp5_);
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp7_ = _tmp6_;
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp8_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY, _tmp7_);
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp9_ = _tmp8_;
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_tmp7_);
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_tmp5_);
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		_inner_error_ = _tmp9_;
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 129 "/home/jens/Source/shotwell/src/util/file.vala"
		return;
#line 1107 "file.c"
	}
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp10_ = dir;
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp11_ = cancellable;
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp12_ = g_file_enumerate_children (_tmp10_, "standard::name,standard::type", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, _tmp11_, &_inner_error_);
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
	enumerator = _tmp12_;
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 131 "/home/jens/Source/shotwell/src/util/file.vala"
		return;
#line 1123 "file.c"
	}
#line 133 "/home/jens/Source/shotwell/src/util/file.vala"
	info = NULL;
#line 134 "/home/jens/Source/shotwell/src/util/file.vala"
	i = (guint64) 0;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
	while (TRUE) {
#line 1131 "file.c"
		GFileInfo* _tmp13_ = NULL;
		GFileEnumerator* _tmp14_ = NULL;
		GCancellable* _tmp15_ = NULL;
		GFileInfo* _tmp16_ = NULL;
		GFileInfo* _tmp17_ = NULL;
		GFileInfo* _tmp18_ = NULL;
		GFileInfo* _tmp19_ = NULL;
		GFileType _tmp20_ = 0;
		gboolean _tmp21_ = FALSE;
		GeeSet* _tmp22_ = NULL;
		GFile* file = NULL;
		GFile* _tmp27_ = NULL;
		GFileInfo* _tmp28_ = NULL;
		const gchar* _tmp29_ = NULL;
		GFile* _tmp30_ = NULL;
		gboolean _tmp38_ = FALSE;
		ProgressMonitor _tmp39_ = NULL;
		void* _tmp39__target = NULL;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp14_ = enumerator;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp15_ = cancellable;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp16_ = g_file_enumerator_next_file (_tmp14_, _tmp15_, &_inner_error_);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp13_ = _tmp16_;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
			g_propagate_error (error, _inner_error_);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
			return;
#line 1168 "file.c"
		}
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp17_ = _tmp13_;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp13_ = NULL;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (info);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		info = _tmp17_;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp18_ = info;
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		if (!(_tmp18_ != NULL)) {
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp13_);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
			break;
#line 1186 "file.c"
		}
#line 136 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp19_ = info;
#line 136 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp20_ = g_file_info_get_file_type (_tmp19_);
#line 136 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp20_ != G_FILE_TYPE_REGULAR) {
#line 137 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp13_);
#line 137 "/home/jens/Source/shotwell/src/util/file.vala"
			continue;
#line 1198 "file.c"
		}
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp22_ = exceptions;
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp22_ != NULL) {
#line 1204 "file.c"
			GeeSet* _tmp23_ = NULL;
			GFileInfo* _tmp24_ = NULL;
			const gchar* _tmp25_ = NULL;
			gboolean _tmp26_ = FALSE;
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp23_ = exceptions;
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp24_ = info;
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp25_ = g_file_info_get_name (_tmp24_);
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp26_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_COLLECTION, GeeCollection), _tmp25_);
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp21_ = _tmp26_;
#line 1219 "file.c"
		} else {
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp21_ = FALSE;
#line 1223 "file.c"
		}
#line 139 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp21_) {
#line 140 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp13_);
#line 140 "/home/jens/Source/shotwell/src/util/file.vala"
			continue;
#line 1231 "file.c"
		}
#line 142 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp27_ = dir;
#line 142 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp28_ = info;
#line 142 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp29_ = g_file_info_get_name (_tmp28_);
#line 142 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp30_ = g_file_get_child (_tmp27_, _tmp29_);
#line 142 "/home/jens/Source/shotwell/src/util/file.vala"
		file = _tmp30_;
#line 1243 "file.c"
		{
			GFile* _tmp31_ = NULL;
			GCancellable* _tmp32_ = NULL;
#line 144 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp31_ = file;
#line 144 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp32_ = cancellable;
#line 144 "/home/jens/Source/shotwell/src/util/file.vala"
			g_file_delete (_tmp31_, _tmp32_, &_inner_error_);
#line 144 "/home/jens/Source/shotwell/src/util/file.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1255 "file.c"
				goto __catch3_g_error;
			}
		}
		goto __finally3;
		__catch3_g_error:
		{
			GError* err = NULL;
			GFile* _tmp33_ = NULL;
			gchar* _tmp34_ = NULL;
			gchar* _tmp35_ = NULL;
			GError* _tmp36_ = NULL;
			const gchar* _tmp37_ = NULL;
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			err = _inner_error_;
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			_inner_error_ = NULL;
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp33_ = file;
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp34_ = g_file_get_path (_tmp33_);
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp35_ = _tmp34_;
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp36_ = err;
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp37_ = _tmp36_->message;
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			g_warning ("file.vala:146: Unable to delete file %s: %s", _tmp35_, _tmp37_);
#line 146 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_free0 (_tmp35_);
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_error_free0 (err);
#line 1288 "file.c"
		}
		__finally3:
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			g_propagate_error (error, _inner_error_);
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (file);
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp13_);
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 143 "/home/jens/Source/shotwell/src/util/file.vala"
			return;
#line 1305 "file.c"
		}
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp39_ = monitor;
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp39__target = monitor_target;
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp39_ != NULL) {
#line 1313 "file.c"
			guint64 _tmp40_ = 0ULL;
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp40_ = file_count;
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp38_ = _tmp40_ > ((guint64) 0);
#line 1319 "file.c"
		} else {
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp38_ = FALSE;
#line 1323 "file.c"
		}
#line 149 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp38_) {
#line 1327 "file.c"
			ProgressMonitor _tmp41_ = NULL;
			void* _tmp41__target = NULL;
			guint64 _tmp42_ = 0ULL;
			guint64 _tmp43_ = 0ULL;
			guint64 _tmp44_ = 0ULL;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp41_ = monitor;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp41__target = monitor_target;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp42_ = file_count;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp43_ = i;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			i = _tmp43_ + 1;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp44_ = i;
#line 150 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp41_ (_tmp42_, _tmp44_, TRUE, _tmp41__target);
#line 1347 "file.c"
		}
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (file);
#line 135 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (_tmp13_);
#line 1353 "file.c"
	}
#line 125 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (info);
#line 125 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (enumerator);
#line 1359 "file.c"
}


time_t query_file_modified (GFile* file, GError** error) {
	time_t result = 0;
	GFileInfo* info = NULL;
	GFile* _tmp0_ = NULL;
	GFileInfo* _tmp1_ = NULL;
	GTimeVal _tmp3_ = {0};
	glong _tmp4_ = 0L;
	GError * _inner_error_ = NULL;
#line 154 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (file), 0);
#line 155 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = file;
#line 155 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_query_info (_tmp0_, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 155 "/home/jens/Source/shotwell/src/util/file.vala"
	info = _tmp1_;
#line 155 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1381 "file.c"
		time_t _tmp2_ = 0;
#line 155 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 155 "/home/jens/Source/shotwell/src/util/file.vala"
		return _tmp2_;
#line 1387 "file.c"
	}
#line 158 "/home/jens/Source/shotwell/src/util/file.vala"
	g_file_info_get_modification_time (info, &_tmp3_);
#line 158 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp4_ = _tmp3_.tv_sec;
#line 158 "/home/jens/Source/shotwell/src/util/file.vala"
	result = (time_t) _tmp4_;
#line 158 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (info);
#line 158 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1399 "file.c"
}


gboolean query_is_directory (GFile* file) {
	gboolean result = FALSE;
	GFile* _tmp0_ = NULL;
	GFileType _tmp1_ = 0;
#line 161 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 162 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = file;
#line 162 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL);
#line 162 "/home/jens/Source/shotwell/src/util/file.vala"
	result = _tmp1_ == G_FILE_TYPE_DIRECTORY;
#line 162 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1417 "file.c"
}


gboolean query_is_directory_empty (GFile* dir, GError** error) {
	gboolean result = FALSE;
	GFile* _tmp0_ = NULL;
	GFileType _tmp1_ = 0;
	GFileEnumerator* enumerator = NULL;
	GFile* _tmp2_ = NULL;
	GFileEnumerator* _tmp3_ = NULL;
	GFileEnumerator* _tmp5_ = NULL;
	GFileInfo* _tmp6_ = NULL;
	GFileEnumerator* _tmp7_ = NULL;
	GFileInfo* _tmp8_ = NULL;
	GFileInfo* _tmp10_ = NULL;
	GFileInfo* _tmp11_ = NULL;
	gboolean _tmp12_ = FALSE;
	GError * _inner_error_ = NULL;
#line 165 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (dir), FALSE);
#line 166 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = dir;
#line 166 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL);
#line 166 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp1_ != G_FILE_TYPE_DIRECTORY) {
#line 167 "/home/jens/Source/shotwell/src/util/file.vala"
		result = FALSE;
#line 167 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 1448 "file.c"
	}
#line 169 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = dir;
#line 169 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp3_ = g_file_enumerate_children (_tmp2_, "standard::name", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 169 "/home/jens/Source/shotwell/src/util/file.vala"
	enumerator = _tmp3_;
#line 169 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1458 "file.c"
		gboolean _tmp4_ = FALSE;
#line 169 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 169 "/home/jens/Source/shotwell/src/util/file.vala"
		return _tmp4_;
#line 1464 "file.c"
	}
#line 171 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp5_ = enumerator;
#line 171 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp5_ == NULL) {
#line 172 "/home/jens/Source/shotwell/src/util/file.vala"
		result = FALSE;
#line 172 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (enumerator);
#line 172 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 1476 "file.c"
	}
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp7_ = enumerator;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp8_ = g_file_enumerator_next_file (_tmp7_, NULL, &_inner_error_);
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp6_ = _tmp8_;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1486 "file.c"
		gboolean _tmp9_ = FALSE;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (enumerator);
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
		return _tmp9_;
#line 1494 "file.c"
	}
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp10_ = _tmp6_;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp6_ = NULL;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp11_ = _tmp10_;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp12_ = _tmp11_ == NULL;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (_tmp11_);
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	result = _tmp12_;
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (_tmp6_);
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (enumerator);
#line 174 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1514 "file.c"
}


gchar* get_display_pathname (GFile* file) {
	gchar* result = NULL;
	gchar* path = NULL;
	GFile* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* home = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
#line 177 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 179 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = file;
#line 179 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_get_parse_name (_tmp0_);
#line 179 "/home/jens/Source/shotwell/src/util/file.vala"
	path = _tmp1_;
#line 180 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = g_get_home_dir ();
#line 180 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp3_ = g_strdup (_tmp2_);
#line 180 "/home/jens/Source/shotwell/src/util/file.vala"
	home = _tmp3_;
#line 182 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp4_ = path;
#line 182 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp5_ = home;
#line 182 "/home/jens/Source/shotwell/src/util/file.vala"
	if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
#line 1551 "file.c"
		gchar* _tmp6_ = NULL;
#line 183 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp6_ = g_strdup ("~");
#line 183 "/home/jens/Source/shotwell/src/util/file.vala"
		result = _tmp6_;
#line 183 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (home);
#line 183 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (path);
#line 183 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 1563 "file.c"
	}
#line 185 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp7_ = path;
#line 185 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp8_ = home;
#line 185 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp9_ = g_str_has_prefix (_tmp7_, _tmp8_);
#line 185 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp9_) {
#line 1573 "file.c"
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		gint _tmp12_ = 0;
		gint _tmp13_ = 0;
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp10_ = path;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp11_ = home;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp12_ = strlen (_tmp11_);
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp13_ = _tmp12_;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp14_ = string_substring (_tmp10_, (glong) _tmp13_, (glong) -1);
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp15_ = _tmp14_;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp16_ = g_strdup_printf ("~%s", _tmp15_);
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp17_ = _tmp16_;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (_tmp15_);
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		result = _tmp17_;
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (home);
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_free0 (path);
#line 186 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 1608 "file.c"
	}
#line 188 "/home/jens/Source/shotwell/src/util/file.vala"
	result = path;
#line 188 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (home);
#line 188 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1616 "file.c"
}


gchar* strip_pretty_path (const gchar* path) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
#line 191 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (path != NULL, NULL);
#line 192 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = path;
#line 192 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_str_has_prefix (_tmp0_, "~");
#line 192 "/home/jens/Source/shotwell/src/util/file.vala"
	if (!_tmp1_) {
#line 1638 "file.c"
		const gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
#line 193 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp2_ = path;
#line 193 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp3_ = g_strdup (_tmp2_);
#line 193 "/home/jens/Source/shotwell/src/util/file.vala"
		result = _tmp3_;
#line 193 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 1649 "file.c"
	}
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp4_ = g_get_home_dir ();
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp5_ = path;
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp6_ = string_substring (_tmp5_, (glong) 1, (glong) -1);
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp7_ = _tmp6_;
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp8_ = g_strconcat (_tmp4_, _tmp7_, NULL);
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp9_ = _tmp8_;
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_free0 (_tmp7_);
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	result = _tmp9_;
#line 195 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1669 "file.c"
}


gchar* get_file_info_id (GFileInfo* info) {
	gchar* result = NULL;
	GFileInfo* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
#line 198 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE_INFO (info), NULL);
#line 199 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = info;
#line 199 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = g_file_info_get_attribute_string (_tmp0_, G_FILE_ATTRIBUTE_ID_FILE);
#line 199 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 199 "/home/jens/Source/shotwell/src/util/file.vala"
	result = _tmp2_;
#line 199 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1690 "file.c"
}


void skip_uint64 (GInputStream* input, guint64 skip_amount, GError** error) {
	GError * _inner_error_ = NULL;
#line 203 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_if_fail (G_IS_INPUT_STREAM (input));
#line 204 "/home/jens/Source/shotwell/src/util/file.vala"
	while (TRUE) {
#line 1700 "file.c"
		guint64 _tmp0_ = 0ULL;
		guint64 _tmp1_ = 0ULL;
#line 204 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp0_ = skip_amount;
#line 204 "/home/jens/Source/shotwell/src/util/file.vala"
		if (!(_tmp0_ > ((guint64) 0))) {
#line 204 "/home/jens/Source/shotwell/src/util/file.vala"
			break;
#line 1709 "file.c"
		}
#line 206 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp1_ = skip_amount;
#line 206 "/home/jens/Source/shotwell/src/util/file.vala"
		if (_tmp1_ >= ((guint64) G_MAXSSIZE)) {
#line 1715 "file.c"
			GInputStream* _tmp2_ = NULL;
			guint64 _tmp3_ = 0ULL;
#line 207 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp2_ = input;
#line 207 "/home/jens/Source/shotwell/src/util/file.vala"
			g_input_stream_skip (_tmp2_, (gsize) G_MAXSSIZE, NULL, &_inner_error_);
#line 207 "/home/jens/Source/shotwell/src/util/file.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 207 "/home/jens/Source/shotwell/src/util/file.vala"
				g_propagate_error (error, _inner_error_);
#line 207 "/home/jens/Source/shotwell/src/util/file.vala"
				return;
#line 1728 "file.c"
			}
#line 208 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp3_ = skip_amount;
#line 208 "/home/jens/Source/shotwell/src/util/file.vala"
			skip_amount = _tmp3_ - G_MAXSSIZE;
#line 1734 "file.c"
		} else {
			GInputStream* _tmp4_ = NULL;
			guint64 _tmp5_ = 0ULL;
#line 210 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp4_ = input;
#line 210 "/home/jens/Source/shotwell/src/util/file.vala"
			_tmp5_ = skip_amount;
#line 210 "/home/jens/Source/shotwell/src/util/file.vala"
			g_input_stream_skip (_tmp4_, (gsize) _tmp5_, NULL, &_inner_error_);
#line 210 "/home/jens/Source/shotwell/src/util/file.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 210 "/home/jens/Source/shotwell/src/util/file.vala"
				g_propagate_error (error, _inner_error_);
#line 210 "/home/jens/Source/shotwell/src/util/file.vala"
				return;
#line 1750 "file.c"
			}
#line 211 "/home/jens/Source/shotwell/src/util/file.vala"
			skip_amount = (guint64) 0;
#line 1754 "file.c"
		}
	}
}


guint64 count_files_in_directory (GFile* dir, GError** error) {
	guint64 result = 0ULL;
	GFile* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	guint64 count = 0ULL;
	GFileEnumerator* enumerator = NULL;
	GFile* _tmp2_ = NULL;
	GFileEnumerator* _tmp3_ = NULL;
	GFileInfo* info = NULL;
	GError * _inner_error_ = NULL;
#line 217 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail (G_IS_FILE (dir), 0ULL);
#line 218 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp0_ = dir;
#line 218 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = query_is_directory (_tmp0_);
#line 218 "/home/jens/Source/shotwell/src/util/file.vala"
	if (!_tmp1_) {
#line 219 "/home/jens/Source/shotwell/src/util/file.vala"
		result = (guint64) 0;
#line 219 "/home/jens/Source/shotwell/src/util/file.vala"
		return result;
#line 1782 "file.c"
	}
#line 221 "/home/jens/Source/shotwell/src/util/file.vala"
	count = (guint64) 0;
#line 222 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = dir;
#line 222 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp3_ = g_file_enumerate_children (_tmp2_, "standard::*", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_);
#line 222 "/home/jens/Source/shotwell/src/util/file.vala"
	enumerator = _tmp3_;
#line 222 "/home/jens/Source/shotwell/src/util/file.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1794 "file.c"
		guint64 _tmp4_ = 0ULL;
#line 222 "/home/jens/Source/shotwell/src/util/file.vala"
		g_propagate_error (error, _inner_error_);
#line 222 "/home/jens/Source/shotwell/src/util/file.vala"
		return _tmp4_;
#line 1800 "file.c"
	}
#line 225 "/home/jens/Source/shotwell/src/util/file.vala"
	info = NULL;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
	while (TRUE) {
#line 1806 "file.c"
		GFileInfo* _tmp5_ = NULL;
		GFileEnumerator* _tmp6_ = NULL;
		GFileInfo* _tmp7_ = NULL;
		GFileInfo* _tmp9_ = NULL;
		GFileInfo* _tmp10_ = NULL;
		guint64 _tmp11_ = 0ULL;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp6_ = enumerator;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp7_ = g_file_enumerator_next_file (_tmp6_, NULL, &_inner_error_);
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp5_ = _tmp7_;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1821 "file.c"
			guint64 _tmp8_ = 0ULL;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
			g_propagate_error (error, _inner_error_);
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (info);
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (enumerator);
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
			return _tmp8_;
#line 1831 "file.c"
		}
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp9_ = _tmp5_;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp5_ = NULL;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (info);
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		info = _tmp9_;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp10_ = info;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		if (!(_tmp10_ != NULL)) {
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
			_g_object_unref0 (_tmp5_);
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
			break;
#line 1849 "file.c"
		}
#line 227 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp11_ = count;
#line 227 "/home/jens/Source/shotwell/src/util/file.vala"
		count = _tmp11_ + 1;
#line 226 "/home/jens/Source/shotwell/src/util/file.vala"
		_g_object_unref0 (_tmp5_);
#line 1857 "file.c"
	}
#line 229 "/home/jens/Source/shotwell/src/util/file.vala"
	result = count;
#line 229 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (info);
#line 229 "/home/jens/Source/shotwell/src/util/file.vala"
	_g_object_unref0 (enumerator);
#line 229 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1867 "file.c"
}


gboolean file_equal (GFile* a, GFile* b) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GFile* _tmp2_ = NULL;
#line 233 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail ((a == NULL) || G_IS_FILE (a), FALSE);
#line 233 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail ((b == NULL) || G_IS_FILE (b), FALSE);
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp2_ = a;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp2_ != NULL) {
#line 1884 "file.c"
		GFile* _tmp3_ = NULL;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp3_ = b;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp1_ = _tmp3_ != NULL;
#line 1890 "file.c"
	} else {
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp1_ = FALSE;
#line 1894 "file.c"
	}
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp1_) {
#line 1898 "file.c"
		GFile* _tmp4_ = NULL;
		GFile* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp4_ = a;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp5_ = b;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp6_ = g_file_equal (_tmp4_, _tmp5_);
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp0_ = _tmp6_;
#line 1910 "file.c"
	} else {
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp0_ = FALSE;
#line 1914 "file.c"
	}
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
	result = _tmp0_;
#line 234 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1920 "file.c"
}


guint file_hash (GFile* file) {
	guint result = 0U;
	guint _tmp0_ = 0U;
	GFile* _tmp1_ = NULL;
#line 238 "/home/jens/Source/shotwell/src/util/file.vala"
	g_return_val_if_fail ((file == NULL) || G_IS_FILE (file), 0U);
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
	_tmp1_ = file;
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
	if (_tmp1_ != NULL) {
#line 1934 "file.c"
		GFile* _tmp2_ = NULL;
		guint _tmp3_ = 0U;
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp2_ = file;
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp3_ = g_file_hash (_tmp2_);
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp0_ = _tmp3_;
#line 1943 "file.c"
	} else {
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
		_tmp0_ = (guint) 0;
#line 1947 "file.c"
	}
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
	result = _tmp0_;
#line 239 "/home/jens/Source/shotwell/src/util/file.vala"
	return result;
#line 1953 "file.c"
}