From beb2176399370a7519d45253ccb95d2b7036b1e2 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Jun 2016 12:49:58 -0300 Subject: [PATCH] Make ".." always appear even if dir is unlistable (likely lacking permissions), closes #1938 (cherry picked from commit adc13e902722d62555d112a74c5b8ce39348aceb) --- scene/gui/file_dialog.cpp | 5 +++++ tools/editor/editor_file_dialog.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 127c78f72a1..1b16973a7f9 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -341,6 +341,11 @@ void FileDialog::update_file_list() { } } + if (dirs.find("..")==NULL) { + //may happen if lacking permissions + dirs.push_back(".."); + } + dirs.sort_custom(); files.sort_custom(); diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 9a1da65bb95..62102df3987 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -509,6 +509,11 @@ void EditorFileDialog::update_file_list() { } } + if (dirs.find("..")==NULL) { + //may happen if lacking permissions + dirs.push_back(".."); + } + dirs.sort_custom(); files.sort_custom();