Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
matt
MegaGRRL
Commits
1015d222
Commit
1015d222
authored
Apr 17, 2021
by
natalie
💜
Browse files
Graceful handling of directories larger than cache area
parent
26e69e94
Changes
1
Hide whitespace changes
Inline
Side-by-side
firmware/main/ui/filebrowser.c
View file @
1015d222
...
...
@@ -114,15 +114,10 @@ static void cachedir(char *dir_name) {
strcpy
(
&
direntry_cache
[
off
],
ent
->
d_name
);
off
+=
strlen
(
ent
->
d_name
)
+
1
;
direntry_count
++
;
if
(
off
>
FILEBROWSER_CACHE_SIZE
)
{
ESP_LOGE
(
TAG
,
"filebrowser cache area over !!"
);
closedir
(
dir
);
return
;
}
if
(
direntry_count
>
FILEBROWSER_CACHE_MAXENTRIES
)
{
ESP_LOGE
(
TAG
,
"filebrowser cache over !!"
);
closedir
(
dir
);
return
;
if
(
off
>
FILEBROWSER_CACHE_SIZE
||
direntry_count
>
FILEBROWSER_CACHE_MAXENTRIES
)
{
ESP_LOGE
(
TAG
,
"filebrowser cache over! off=%d direntry_count=%d"
,
off
,
direntry_count
);
modal_show_simple
(
TAG
,
"Directory Too Large"
,
"There are too many files or directories inside this directory. Not all will be shown."
,
LV_SYMBOL_OK
" OK"
);
break
;
}
}
if
(
errno
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment