Commit 67d3c3e2 authored by Rob Swindell's avatar Rob Swindell 💬
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
Pipeline #2963 failed with stage
in 9 minutes and 51 seconds
...@@ -294,7 +294,7 @@ static int file_compare_date_a(const void* v1, const void* v2) ...@@ -294,7 +294,7 @@ static int file_compare_date_a(const void* v1, const void* v2)
file_t* f1 = (file_t*)v1; file_t* f1 = (file_t*)v1;
file_t* f2 = (file_t*)v2; 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) 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) ...@@ -302,7 +302,7 @@ static int file_compare_date_d(const void* v1, const void* v2)
file_t* f1 = (file_t*)v1; file_t* f1 = (file_t*)v1;
file_t* f2 = (file_t*)v2; 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) static int file_compare_size_a(const void* v1, const void* v2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment