Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/BatchImport.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@ private class FileToPrepare {
}

private class WorkSniffer : BackgroundImportJob {
private const uint MIN_SIZE = 64;
public Gee.List<FileToPrepare> files_to_prepare = new Gee.ArrayList<FileToPrepare> ();
public uint64 total_bytes = 0;

Expand Down Expand Up @@ -1551,7 +1552,7 @@ private class WorkSniffer : BackgroundImportJob {
}

private void sniff_job (BatchImportJob job) throws Error {
uint64 size;
uint64 size = 0;
File file_or_dir;
bool determined_size = job.determine_file_size (out size, out file_or_dir);
if (determined_size)
Expand All @@ -1578,8 +1579,15 @@ private class WorkSniffer : BackgroundImportJob {
}
} else {
// if did not get the file size, do so now
if (!determined_size)
total_bytes += query_total_file_size (file_or_dir, get_cancellable ());
if (!determined_size) {
size = query_total_file_size (file_or_dir, get_cancellable ());
}

if (size < MIN_SIZE) {
return;
}

total_bytes += size;

// job is a direct file, so no need to search, prepare it directly
if ((file_or_dir != null) && skipset != null && skipset.contains (file_or_dir))
Expand Down