mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
Fix archive sorting (skip on big folders)
This commit is contained in:
parent
fbf99d6cb3
commit
cb89bb9628
4 changed files with 7 additions and 3 deletions
|
@ -74,7 +74,9 @@ static void archive_list_item_cb(
|
||||||
browser->view,
|
browser->view,
|
||||||
ArchiveBrowserViewModel * model,
|
ArchiveBrowserViewModel * model,
|
||||||
{
|
{
|
||||||
files_array_sort(model->files);
|
if(model->item_cnt <= BROWSER_SORT_THRESHOLD) {
|
||||||
|
files_array_sort(model->files);
|
||||||
|
}
|
||||||
model->list_loading = false;
|
model->list_loading = false;
|
||||||
},
|
},
|
||||||
true);
|
true);
|
||||||
|
|
|
@ -478,7 +478,7 @@ static void browser_list_item_cb(
|
||||||
browser->view,
|
browser->view,
|
||||||
FileBrowserModel * model,
|
FileBrowserModel * model,
|
||||||
{
|
{
|
||||||
if(model->item_cnt < 430) {
|
if(model->item_cnt <= BROWSER_SORT_THRESHOLD) {
|
||||||
FuriString* selected = NULL;
|
FuriString* selected = NULL;
|
||||||
if(model->item_idx > 0) {
|
if(model->item_idx > 0) {
|
||||||
selected = furi_string_alloc_set(
|
selected = furi_string_alloc_set(
|
||||||
|
|
|
@ -418,7 +418,7 @@ static int32_t browser_worker(void* context) {
|
||||||
if(flags & WorkerEvtLoad) {
|
if(flags & WorkerEvtLoad) {
|
||||||
FURI_LOG_D(
|
FURI_LOG_D(
|
||||||
TAG, "Load offset: %lu cnt: %lu", browser->load_offset, browser->load_count);
|
TAG, "Load offset: %lu cnt: %lu", browser->load_offset, browser->load_count);
|
||||||
if(items_cnt > 430) {
|
if(items_cnt > BROWSER_SORT_THRESHOLD) {
|
||||||
browser_folder_load_chunked(
|
browser_folder_load_chunked(
|
||||||
browser, path, browser->load_offset, browser->load_count);
|
browser, path, browser->load_offset, browser->load_count);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define BROWSER_SORT_THRESHOLD 400
|
||||||
|
|
||||||
typedef struct BrowserWorker BrowserWorker;
|
typedef struct BrowserWorker BrowserWorker;
|
||||||
typedef void (*BrowserWorkerFolderOpenCallback)(
|
typedef void (*BrowserWorkerFolderOpenCallback)(
|
||||||
void* context,
|
void* context,
|
||||||
|
|
Loading…
Reference in a new issue