Fix initial folder for File > Save with the last one visited (fix #3996)

Regression added in 056073b3f1a7d54cdf9a113110f50947b9b4d525 in the
custom file selector. Every time you saved a new sprite the dialog
started at the root path (e.g. Desktop) instead of the last used
directory.
This commit is contained in:
Gaspar Capello 2023-08-30 16:46:23 -03:00 committed by David Capello
parent 4b716255e8
commit 6c34be5eb6

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2022 Igara Studio S.A.
// Copyright (C) 2019-2023 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -411,13 +411,9 @@ bool FileSelector::show(
fs->refresh();
// We have to find where the user should begin to browse files
std::string start_folder_path;
if (initialPath.empty()) {
start_folder_path = get_initial_path_to_select_filename(initialPath);
}
else {
start_folder_path = base::get_file_path(initialPath);
}
std::string start_folder_path =
base::get_file_path(
get_initial_path_to_select_filename(initialPath));
IFileItem* start_folder = fs->getFileItemFromPath(start_folder_path);
if (!start_folder) {