summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorshahriarlabib000 <shahriarlabib000@gmail.com>2024-09-08 18:51:01 +0600
committerRémi Verschelde <rverschelde@gmail.com>2024-09-17 08:57:44 +0200
commitc7a173aa60faf9908cd5e3fe02ef1b0dd7834394 (patch)
tree7d537b3464a362825d3c8785dd9fa85cf7cfaa63 /editor
parente7e723b3e39a9fa2be3f79f1c8e96606b2644d96 (diff)
downloadredot-engine-c7a173aa60faf9908cd5e3fe02ef1b0dd7834394.tar.gz
Fix directory empty bug on Android
(cherry picked from commit 8f66513badf286795c54b4677ec19a7e2f151f69)
Diffstat (limited to 'editor')
-rw-r--r--editor/project_manager/project_dialog.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp
index b4aa00ee0a..afbb223eb5 100644
--- a/editor/project_manager/project_dialog.cpp
+++ b/editor/project_manager/project_dialog.cpp
@@ -162,7 +162,7 @@ void ProjectDialog::_validate_path() {
}
}
- if (target_path.is_empty() || target_path.is_relative_path()) {
+ if (target_path.is_relative_path()) {
_set_message(TTR("The path specified is invalid."), MESSAGE_ERROR, target_path_input_type);
return;
}
@@ -352,7 +352,7 @@ void ProjectDialog::_install_path_changed() {
void ProjectDialog::_browse_project_path() {
String path = project_path->get_text();
- if (path.is_empty()) {
+ if (path.is_relative_path()) {
path = EDITOR_GET("filesystem/directories/default_project_path");
}
if (mode == MODE_IMPORT && install_path->is_visible_in_tree()) {
@@ -382,12 +382,16 @@ void ProjectDialog::_browse_project_path() {
void ProjectDialog::_browse_install_path() {
ERR_FAIL_COND_MSG(mode != MODE_IMPORT, "Install path is only used for MODE_IMPORT.");
+ String path = install_path->get_text();
+ if (path.is_relative_path() || !DirAccess::dir_exists_absolute(path)) {
+ path = EDITOR_GET("filesystem/directories/default_project_path");
+ }
if (create_dir->is_pressed()) {
// Select parent directory of install path.
- fdialog_install->set_current_dir(install_path->get_text().get_base_dir());
+ fdialog_install->set_current_dir(path.get_base_dir());
} else {
// Select install path.
- fdialog_install->set_current_dir(install_path->get_text());
+ fdialog_install->set_current_dir(path);
}
fdialog_install->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_DIR);