summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-09 12:45:00 +0200
committerGitHub <noreply@github.com>2017-10-09 12:45:00 +0200
commitd98947974439b1ef28df11972be053b9591ec55a (patch)
treed0e8e616544e15bb45486557d278bd6f48c5ad07
parent321ae21d5fb0b4cef63b0515dcdee60766ae304f (diff)
parent5e67a3bca731352a991fcc56f10521c47925ec20 (diff)
Merge pull request #11884 from Noshyaar/pr-fd2
FileDialog: fix select index out of range [ci skip]
-rw-r--r--scene/gui/file_dialog.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 320dad9301..d8ff048dfb 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -115,7 +115,9 @@ Vector<String> FileDialog::get_selected_files() const {
void FileDialog::update_dir() {
dir->set_text(dir_access->get_current_dir());
- drives->select(dir_access->get_current_drive());
+ if (drives->is_visible()) {
+ drives->select(dir_access->get_current_drive());
+ }
}
void FileDialog::_dir_entered(String p_dir) {
@@ -667,7 +669,6 @@ void FileDialog::_update_drives() {
drives->show();
for (int i = 0; i < dir_access->get_drive_count(); i++) {
- String d = dir_access->get_drive(i);
drives->add_item(dir_access->get_drive(i));
}