Enforce "show hidden files" in dialogs and not archive

Archive "file" tabs (like SubGHz and so on) hide dot files
Archive "browser" tabs (like /ext) follow user choice
Dialogs (everything else) follow dev choice, unless user chose to show hidden files
This commit is contained in:
Willy-JL
2024-05-17 08:08:05 +01:00
parent 44155eb851
commit 7135b021cd
3 changed files with 7 additions and 4 deletions

View File

@@ -585,7 +585,9 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
bool is_browser = !strcmp(archive_get_tab_ext(tab), "*");
bool skip_assets = !is_browser;
// Hide dot files everywhere except Browser if in debug mode
bool hide_dot_files = !is_browser ? true : tab == ArchiveTabInternal ? false : true;
bool hide_dot_files = !is_browser ? true :
tab == ArchiveTabInternal ? false :
!momentum_settings.show_hidden_files;
archive_file_browser_set_path(
browser, browser->path, archive_get_tab_ext(tab), skip_assets, hide_dot_files);
tab_empty = false; // Empty check will be performed later

View File

@@ -3,6 +3,7 @@
#include <toolbox/api_lock.h>
#include <assets_icons.h>
#include <storage/storage.h>
#include <momentum/momentum.h>
/****************** File browser ******************/
@@ -37,7 +38,8 @@ bool dialog_file_browser_show(
.file_icon = options ? options->icon : NULL,
.hide_ext = options ? options->hide_ext : true,
.skip_assets = options ? options->skip_assets : true,
.hide_dot_files = options ? options->hide_dot_files : true,
.hide_dot_files =
(options ? options->hide_dot_files : true && !momentum_settings.show_hidden_files),
.preselected_filename = path,
.item_callback = options ? options->item_loader_callback : NULL,
.item_callback_context = options ? options->item_loader_context : NULL,

View File

@@ -7,7 +7,6 @@
#include <core/check.h>
#include <core/common_defines.h>
#include <furi.h>
#include <momentum/momentum.h>
#include <m-array.h>
#include <stdbool.h>
@@ -112,7 +111,7 @@ static void browser_parse_ext_filter(ExtFilterArray_t ext_filter, const char* fi
static bool browser_filter_by_name(BrowserWorker* browser, FuriString* name, bool is_folder) {
// Skip dot files if enabled
if(browser->hide_dot_files && !momentum_settings.show_hidden_files) {
if(browser->hide_dot_files) {
if(furi_string_start_with_str(name, ".")) {
return false;
}