Route dialog work directory picker through platform services
This commit is contained in:
@@ -449,6 +449,24 @@ public:
|
||||
invoke_selected_path(path, callback);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool supports_working_directory_picker() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string format_working_directory_path(std::string_view path) override
|
||||
{
|
||||
char path_buffer[MAX_PATH] = {};
|
||||
const auto length = GetFullPathNameA(
|
||||
std::string(path).c_str(),
|
||||
static_cast<DWORD>(sizeof(path_buffer)),
|
||||
path_buffer,
|
||||
nullptr);
|
||||
if (length > 0 && length < sizeof(path_buffer))
|
||||
return path_buffer;
|
||||
return std::string(path);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool uses_prepared_file_writes() override
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user