From 6206b8993e6ef7058bee82cbdc2561f869989ed1 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sat, 18 Oct 2025 10:50:57 +0000 Subject: [PATCH] j 2 git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@405 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/filechooser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/filechooser.c b/src/filechooser.c index d5304a0..e23961e 100644 --- a/src/filechooser.c +++ b/src/filechooser.c @@ -7,6 +7,7 @@ typedef struct filechooser { char* path; MwDirectoryEntry** entries; + MwDirectoryEntry** sorted_entries; MwWidget nav; MwWidget files; @@ -31,6 +32,7 @@ static void destroy(MwWidget handle) { filechooser_t* fc = handle->opaque; int i; + arrfree(fc->sorted_entries); for(i = 0; i < arrlen(fc->entries); i++) MwDirectoryFreeEntry(fc->entries[i]); arrfree(fc->entries); @@ -267,6 +269,7 @@ static void scan(MwWidget handle, const char* path) { char** sizes = NULL; MwLLPixmap* icons = NULL; + arrfree(fc->sorted_entries); for(i = 0; i < arrlen(fc->entries); i++) MwDirectoryFreeEntry(fc->entries[i]); arrfree(fc->entries); @@ -306,6 +309,8 @@ static void scan(MwWidget handle, const char* path) { arrput(dates, date); arrput(sizes, NULL); arrput(icons, fc->dir); + + arrput(fc->sorted_entries, fc->entries[i]); } } for(i = 0; i < arrlen(fc->entries); i++) { @@ -320,6 +325,8 @@ static void scan(MwWidget handle, const char* path) { arrput(dates, date); arrput(sizes, size); arrput(icons, fc->file); + + arrput(fc->sorted_entries, fc->entries[i]); } } MwListBoxInsertMultiple(fc->files, -1, arrlen(names), icons, names, dates, sizes, NULL);