implemented settings functionallity

This commit is contained in:
nova
2025-02-27 19:47:35 +01:00
parent 965351968f
commit 26d3dc9bc8
4 changed files with 19 additions and 8 deletions

View File

@ -67,7 +67,8 @@ void *populate_dir(void *which){ // 0=left, 1=main, 2=right
unsigned long longest_name = 0;
if (wh) {
if (wh==1) {
if (wh == 1) {
free(content_m);
get_dir_size(path, &file_count, &longest_name);
content_m = calloc(file_count+1, sizeof(*content_m)); //index 0 is used for metadata like file count in dir
for (unsigned long i = 0; i<file_count+1; i++) {
@ -76,6 +77,7 @@ void *populate_dir(void *which){ // 0=left, 1=main, 2=right
*content_m[0] = file_count;
get_dir_content(path, file_count, longest_name, content_m);
} else {
free(content_r);
get_dir_size(path, &file_count, &longest_name);
content_r = calloc(file_count+1, sizeof(*content_r));
for (unsigned long i = 0; i<file_count+1; i++) {
@ -85,6 +87,7 @@ void *populate_dir(void *which){ // 0=left, 1=main, 2=right
get_dir_content(path, file_count, longest_name, content_r);
}
} else {
free(content_l);
get_dir_size(path, &file_count, &longest_name);
content_l = calloc(file_count+1, sizeof(*content_l));
for (unsigned long i = 0; i<file_count+1; i++) {