Skip to content
Snippets Groups Projects
Commit 67d3c3e2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix file list sorting by date, need to use the index not the header

When loadfiles() calls sortfiles(), only the file's index records have been
read in, so trying to sort on any header field won't work.

This bug wasn't observable when sorting by date ascending, since that's the
natural index order of the files already (order imported/added), only
observed when sorting by date descending (newest at the top).
parent 3ff57242
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2963 failed
......@@ -294,7 +294,7 @@ static int file_compare_date_a(const void* v1, const void* v2)
file_t* f1 = (file_t*)v1;
file_t* f2 = (file_t*)v2;
return f1->hdr.when_imported.time - f2->hdr.when_imported.time;
return f1->idx.time - f2->idx.time;
}
static int file_compare_date_d(const void* v1, const void* v2)
......@@ -302,7 +302,7 @@ static int file_compare_date_d(const void* v1, const void* v2)
file_t* f1 = (file_t*)v1;
file_t* f2 = (file_t*)v2;
return f2->hdr.when_imported.time - f1->hdr.when_imported.time;
return f2->idx.time - f1->idx.time;
}
static int file_compare_size_a(const void* v1, const void* v2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment