You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
[Windows, FileDialog] Prepend drive letter to the absolute paths without drive letter.
This commit is contained in:
@@ -410,7 +410,14 @@ void EditorFileDialog::update_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EditorFileDialog::_dir_submitted(const String &p_dir) {
|
void EditorFileDialog::_dir_submitted(const String &p_dir) {
|
||||||
dir_access->change_dir(p_dir);
|
String new_dir = p_dir;
|
||||||
|
#ifdef WINDOWS_ENABLED
|
||||||
|
if (drives->is_visible() && !new_dir.is_network_share_path() && new_dir.is_absolute_path() && new_dir.find(":/") == -1 && new_dir.find(":\\") == -1) {
|
||||||
|
// Non network path without X:/ prefix on Windows, add drive letter.
|
||||||
|
new_dir = drives->get_item_text(drives->get_selected()).path_join(new_dir);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
dir_access->change_dir(new_dir);
|
||||||
invalidate();
|
invalidate();
|
||||||
update_dir();
|
update_dir();
|
||||||
_push_history();
|
_push_history();
|
||||||
|
|||||||
@@ -398,7 +398,17 @@ void FileDialog::update_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FileDialog::_dir_submitted(String p_dir) {
|
void FileDialog::_dir_submitted(String p_dir) {
|
||||||
_change_dir(root_prefix.path_join(p_dir));
|
String new_dir = p_dir;
|
||||||
|
#ifdef WINDOWS_ENABLED
|
||||||
|
if (root_prefix.is_empty() && drives->is_visible() && !new_dir.is_network_share_path() && new_dir.is_absolute_path() && new_dir.find(":/") == -1 && new_dir.find(":\\") == -1) {
|
||||||
|
// Non network path without X:/ prefix on Windows, add drive letter.
|
||||||
|
new_dir = drives->get_item_text(drives->get_selected()).path_join(new_dir);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!root_prefix.is_empty()) {
|
||||||
|
new_dir = root_prefix.path_join(new_dir);
|
||||||
|
}
|
||||||
|
_change_dir(new_dir);
|
||||||
file->set_text("");
|
file->set_text("");
|
||||||
_push_history();
|
_push_history();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user