summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorYing-Ruei Liang(KK) <thumbd03803@gmail.com>2016-09-26 15:38:15 +0800
committerYing-Ruei Liang(KK) <thumbd03803@gmail.com>2016-09-26 16:05:22 +0800
commitef1bfd3f2e2a5ee071c1c8a7f474629ac98d9c74 (patch)
treebb988210568e8d3da0589cbef362f8ade4b55776 /tools
parent241e2594f1ea9e051876dea0e4217890359dc50b (diff)
Show "." in item_list of EditorFiledialog
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_file_dialog.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp
index b8abd1d32c..cbf678d6bb 100644
--- a/tools/editor/editor_file_dialog.cpp
+++ b/tools/editor/editor_file_dialog.cpp
@@ -571,25 +571,26 @@ void EditorFileDialog::update_file_list() {
files.sort_custom<NoCaseComparator>();
while(!dirs.empty()) {
+ const String& dir_name=dirs.front()->get();
- if (dirs.front()->get()!=".") {
- item_list->add_item(dirs.front()->get()+"/");
- if (display_mode==DISPLAY_THUMBNAILS) {
+ item_list->add_item(dir_name+"/");
- item_list->set_item_icon(item_list->get_item_count()-1,folder_thumbnail);
- } else {
+ if (display_mode==DISPLAY_THUMBNAILS) {
- item_list->set_item_icon(item_list->get_item_count()-1,folder);
- }
+ item_list->set_item_icon(item_list->get_item_count()-1,folder_thumbnail);
+ } else {
- Dictionary d;
- d["name"]=dirs.front()->get();
- d["path"]=String();
- d["dir"]=true;
- item_list->set_item_metadata( item_list->get_item_count() -1, d);
+ item_list->set_item_icon(item_list->get_item_count()-1,folder);
}
- dirs.pop_front();
+ Dictionary d;
+ d["name"]=dir_name;
+ d["path"]=String();
+ d["dir"]=true;
+
+ item_list->set_item_metadata( item_list->get_item_count() -1, d);
+
+ dirs.pop_front();
}
dirs.clear();