FileDialog: add Back/Forward buttons, add message for inaccessible folders.

This commit is contained in:
bruvzg 2021-03-19 14:01:03 +02:00
parent 0339200972
commit b202a0dd2a
No known key found for this signature in database
GPG key ID: 009E1BFE42239B95
8 changed files with 134 additions and 0 deletions

View file

@ -102,6 +102,28 @@ bool DirAccessUnix::dir_exists(String p_dir) {
return (success && S_ISDIR(flags.st_mode));
}
bool DirAccessUnix::is_readable(String p_dir) {
GLOBAL_LOCK_FUNCTION
if (p_dir.is_rel_path()) {
p_dir = get_current_dir().plus_file(p_dir);
}
p_dir = fix_path(p_dir);
return (access(p_dir.utf8().get_data(), R_OK) == 0);
}
bool DirAccessUnix::is_writable(String p_dir) {
GLOBAL_LOCK_FUNCTION
if (p_dir.is_rel_path()) {
p_dir = get_current_dir().plus_file(p_dir);
}
p_dir = fix_path(p_dir);
return (access(p_dir.utf8().get_data(), W_OK) == 0);
}
uint64_t DirAccessUnix::get_modified_time(String p_file) {
if (p_file.is_rel_path()) {
p_file = current_dir.plus_file(p_file);