Fix override_path usage in FileDialog.
authorCarl Hetherington <cth@carlh.net>
Fri, 17 Jan 2025 02:00:14 +0000 (03:00 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 22 Jan 2025 13:34:25 +0000 (14:34 +0100)
The override_path is a file, so the initial path for the file picker
must be the parent.

src/wx/file_dialog.cc

index 9f547f85a5648890155dd17f7be97efa85ca839b..a726b306aee5b24afbccf4ad4a74258866682b05 100644 (file)
@@ -38,7 +38,7 @@ wxString initial_path(
        )
 {
        if (override_path) {
-               return std_to_wx(override_path->string());
+               return std_to_wx(override_path->parent_path().string());
        }
 
        return std_to_wx(Config::instance()->initial_path(initial_path_key).get_value_or(home_directory()).string());