fix: make dialog_file_browser_set_basic_options initialize all fields (#2756)
* fix: make `dialog_file_browser_set_basic_options` initialize all fields * fix(GH-2756): use alternative test for `test_dialog_file_browser_set_basic_options_should_init_all_fields` Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
co-authored by
Aleksandr Kutuzov
parent
168fa72d53
commit
75354ec5ba
@@ -9,12 +9,13 @@ void dialog_file_browser_set_basic_options(
|
||||
const char* extension,
|
||||
const Icon* icon) {
|
||||
options->extension = extension;
|
||||
options->base_path = NULL;
|
||||
options->skip_assets = true;
|
||||
options->hide_dot_files = true;
|
||||
options->icon = icon;
|
||||
options->hide_ext = true;
|
||||
options->item_loader_callback = NULL;
|
||||
options->item_loader_context = NULL;
|
||||
options->base_path = NULL;
|
||||
}
|
||||
|
||||
static DialogsApp* dialogs_app_alloc() {
|
||||
|
||||
@@ -16,7 +16,8 @@ typedef struct DialogsApp DialogsApp;
|
||||
/****************** FILE BROWSER ******************/
|
||||
|
||||
/**
|
||||
* File browser dialog extra options
|
||||
* File browser dialog extra options.
|
||||
* This can be default-initialized using {@link dialog_file_browser_set_basic_options}.
|
||||
* @param extension file extension to be offered for selection
|
||||
* @param base_path root folder path for navigation with back key
|
||||
* @param skip_assets true - do not show assets folders
|
||||
@@ -38,8 +39,10 @@ typedef struct {
|
||||
} DialogsFileBrowserOptions;
|
||||
|
||||
/**
|
||||
* Initialize file browser dialog options
|
||||
* and set default values
|
||||
* Initialize file browser dialog options and set default values.
|
||||
* This is guaranteed to initialize all fields
|
||||
* so it is safe to pass pointer to uninitialized {@code options}
|
||||
* and assume that the data behind it becomes fully initialized after the call.
|
||||
* @param options pointer to options structure
|
||||
* @param extension file extension to filter
|
||||
* @param icon file icon pointer, NULL for default icon
|
||||
|
||||
Reference in New Issue
Block a user