@@ -162,7 +162,7 @@ void ProjectDialog::_validate_path() {
162
162
}
163
163
}
164
164
165
- if (target_path.is_empty () || target_path. is_relative_path ()) {
165
+ if (target_path.is_relative_path ()) {
166
166
_set_message (TTR (" The path specified is invalid." ), MESSAGE_ERROR, target_path_input_type);
167
167
return ;
168
168
}
@@ -352,7 +352,7 @@ void ProjectDialog::_install_path_changed() {
352
352
353
353
void ProjectDialog::_browse_project_path () {
354
354
String path = project_path->get_text ();
355
- if (path.is_empty ()) {
355
+ if (path.is_relative_path ()) {
356
356
path = EDITOR_GET (" filesystem/directories/default_project_path" );
357
357
}
358
358
if (mode == MODE_IMPORT && install_path->is_visible_in_tree ()) {
@@ -382,12 +382,16 @@ void ProjectDialog::_browse_project_path() {
382
382
void ProjectDialog::_browse_install_path () {
383
383
ERR_FAIL_COND_MSG (mode != MODE_IMPORT, " Install path is only used for MODE_IMPORT." );
384
384
385
+ String path = install_path->get_text ();
386
+ if (path.is_relative_path () || !DirAccess::dir_exists_absolute (path)) {
387
+ path = EDITOR_GET (" filesystem/directories/default_project_path" );
388
+ }
385
389
if (create_dir->is_pressed ()) {
386
390
// Select parent directory of install path.
387
- fdialog_install->set_current_dir (install_path-> get_text () .get_base_dir ());
391
+ fdialog_install->set_current_dir (path .get_base_dir ());
388
392
} else {
389
393
// Select install path.
390
- fdialog_install->set_current_dir (install_path-> get_text () );
394
+ fdialog_install->set_current_dir (path );
391
395
}
392
396
393
397
fdialog_install->set_file_mode (EditorFileDialog::FILE_MODE_OPEN_DIR);
0 commit comments