summaryrefslogtreecommitdiff
path: root/tools/editor/editor_dir_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_dir_dialog.cpp')
-rw-r--r--tools/editor/editor_dir_dialog.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp
index 5e6bad41aa..a8421acff8 100644
--- a/tools/editor/editor_dir_dialog.cpp
+++ b/tools/editor/editor_dir_dialog.cpp
@@ -43,6 +43,7 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) {
da->list_dir_begin();
String p=da->get_next();
+ List<String> dirs;
bool ishidden;
bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
@@ -52,16 +53,22 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) {
if (show_hidden || !ishidden) {
if (da->current_is_dir() && !p.begins_with(".")) {
- TreeItem *ti = tree->create_item(p_item);
- ti->set_text(0,p);
- ti->set_icon(0,get_icon("Folder","EditorIcons"));
- ti->set_collapsed(true);
+ dirs.push_back(p);
}
}
-
p=da->get_next();
}
+ dirs.sort();
+
+ for(List<String>::Element *E=dirs.front();E;E=E->next()) {
+ TreeItem *ti = tree->create_item(p_item);
+ ti->set_text(0,E->get());
+ ti->set_icon(0,get_icon("Folder","EditorIcons"));
+ ti->set_collapsed(true);
+
+ }
+
memdelete(da);
updating=false;