diff --git a/src/direct/DirectPhoto.vala b/src/direct/DirectPhoto.vala index 4016ee23..6726e50b 100644 --- a/src/direct/DirectPhoto.vala +++ b/src/direct/DirectPhoto.vala @@ -173,8 +173,6 @@ public class DirectPhoto : Photo { } public class DirectPhotoSourceCollection : DatabaseSourceCollection { - private const int DISCOVERED_FILES_BATCH_ADD = 500; - private Gee.Collection prepared_photos = new Gee.ArrayList(); private Gee.HashMap file_map = new Gee.HashMap(file_hash, file_equal); private DirectoryMonitor monitor; @@ -185,7 +183,6 @@ public class DirectPhotoSourceCollection : DatabaseSourceCollection { // only use the monitor for discovery in the specified directory, not its children monitor = new DirectoryMonitor(initial_file.get_parent(), false, false); monitor.file_discovered.connect(on_file_discovered); - monitor.discovery_completed.connect(on_discovery_completed); monitor.start_discovery(); } @@ -243,18 +240,7 @@ public class DirectPhotoSourceCollection : DatabaseSourceCollection { string? reason = fetch(file, out photo, false); if (reason != null) warning("Error fetching file: %s", reason); - prepared_photos.add(photo); - if (prepared_photos.size >= DISCOVERED_FILES_BATCH_ADD) - flush_prepared_photos(); - } - - private void on_discovery_completed() { - flush_prepared_photos(); - } - - private void flush_prepared_photos() { - add_many(prepared_photos); - prepared_photos.clear(); + add(photo); } public bool has_file(File file) {