Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When loading save file, state, and screenshot directories, attempt to… #16421

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 9 additions & 6 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -3923,9 +3923,10 @@ static bool config_load_file(global_t *global,
{
if (string_is_equal(settings->paths.directory_screenshot, "default"))
*settings->paths.directory_screenshot = '\0';
else if (!path_is_directory(settings->paths.directory_screenshot))
else if (!path_is_directory(settings->paths.directory_screenshot)
&& !path_mkdir(settings->paths.directory_screenshot))
Nargash marked this conversation as resolved.
Show resolved Hide resolved
{
RARCH_WARN("[Config]: 'screenshot_directory' is not an existing directory, ignoring..\n");
RARCH_WARN("[Config]: 'screenshot_directory' is not an existing directory, screenshots will save to the content directory..\n");
*settings->paths.directory_screenshot = '\0';
}
}
Expand Down Expand Up @@ -4072,7 +4073,8 @@ static bool config_load_file(global_t *global,
{
if (string_is_equal(tmp_str, "default"))
dir_set(RARCH_DIR_SAVEFILE, g_defaults.dirs[DEFAULT_DIR_SRAM]);
else if (path_is_directory(tmp_str))
else if (path_is_directory(tmp_str)
|| path_mkdir(tmp_str))
Nargash marked this conversation as resolved.
Show resolved Hide resolved
{
dir_set(RARCH_DIR_SAVEFILE, tmp_str);

Expand All @@ -4084,15 +4086,16 @@ static bool config_load_file(global_t *global,
sizeof(runloop_st->name.savefile));
}
else
RARCH_WARN("[Config]: 'savefile_directory' is not a directory, ignoring..\n");
RARCH_WARN("[Config]: 'savefile_directory' is not a directory, falling back to \"%s\" \n",dir_get_ptr(RARCH_DIR_SAVEFILE));
Nargash marked this conversation as resolved.
Show resolved Hide resolved
}

if ( !retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL)
&& config_get_path(conf, "savestate_directory", tmp_str, sizeof(tmp_str)))
{
if (string_is_equal(tmp_str, "default"))
dir_set(RARCH_DIR_SAVESTATE, g_defaults.dirs[DEFAULT_DIR_SAVESTATE]);
else if (path_is_directory(tmp_str))
else if (path_is_directory(tmp_str)
|| path_mkdir(tmp_str))
Nargash marked this conversation as resolved.
Show resolved Hide resolved
{
dir_set(RARCH_DIR_SAVESTATE, tmp_str);

Expand All @@ -4110,7 +4113,7 @@ static bool config_load_file(global_t *global,
sizeof(runloop_st->name.replay));
}
else
RARCH_WARN("[Config]: 'savestate_directory' is not a directory, ignoring..\n");
RARCH_WARN("[Config]: 'savestate_directory' is not a directory, falling back to \"%s\" \n",dir_get_ptr(RARCH_DIR_SAVESTATE));
Nargash marked this conversation as resolved.
Show resolved Hide resolved
}

config_read_keybinds_conf(conf);
Expand Down