implemented settings functionallity
This commit is contained in:
@ -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++) {
|
||||
|
Reference in New Issue
Block a user