summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorrollenrolm <rollenrolm@users.noreply.github.com>2015-03-21 18:33:32 +0100
committerrollenrolm <rollenrolm@users.noreply.github.com>2015-03-21 18:33:32 +0100
commitdb0a71fc58137da99137e9fbea3ee982679c9afd (patch)
tree2f5231a6e20f12d9fcc9e9799d986b4ecac38699 /scene/gui
parent40496dd76ae53c93ef5ea7e56671682a7cae9def (diff)
New option to show/hide hidden files
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/file_dialog.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index fbcfdb69bb..47f862a58d 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -29,6 +29,8 @@
#include "file_dialog.h"
#include "scene/gui/label.h"
#include "print_string.h"
+#include "os/keyboard.h"
+#include "tools/editor/editor_settings.h"
FileDialog::GetIconFunc FileDialog::get_icon_func=NULL;
@@ -278,13 +280,20 @@ void FileDialog::update_file_list() {
List<String> dirs;
bool isdir;
+ bool ishidden;
+ bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
String item;
+
while ((item=dir_access->get_next(&isdir))!="") {
-
- if (!isdir)
- files.push_back(item);
- else
- dirs.push_back(item);
+
+ ishidden = dir_access->current_is_hidden();
+
+ if (show_hidden || !ishidden) {
+ if (!isdir)
+ files.push_back(item);
+ else
+ dirs.push_back(item);
+ }
}
dirs.sort_custom<NoCaseComparator>();