From 20bda9a2badc4545cf061a1b4da32328b4caff15 Mon Sep 17 00:00:00 2001 From: Dmitry Koteroff Date: Tue, 21 Nov 2017 02:58:07 +0300 Subject: [PATCH] Remove the "." from file manage dialog (open scene, open file, ...) Also removed the "." from game control's FileDialog component. Also remove the "/" at the end of folders name. --- editor/editor_file_dialog.cpp | 5 ++++- scene/gui/file_dialog.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index a0ca9b88e00..f8b9425a4e2 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -541,6 +541,9 @@ void EditorFileDialog::update_file_list() { while ((item = dir_access->get_next(&isdir)) != "") { + if (item == ".") + continue; + ishidden = dir_access->current_is_hidden(); if (show_hidden || !ishidden) { @@ -562,7 +565,7 @@ void EditorFileDialog::update_file_list() { while (!dirs.empty()) { const String &dir_name = dirs.front()->get(); - item_list->add_item(dir_name + "/"); + item_list->add_item(dir_name); if (display_mode == DISPLAY_THUMBNAILS) { diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 6ade4fcc38d..6aba535572a 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -323,6 +323,9 @@ void FileDialog::update_file_list() { while ((item = dir_access->get_next(&isdir)) != "") { + if (item == ".") + continue; + ishidden = dir_access->current_is_hidden(); if (show_hidden || !ishidden) { @@ -344,7 +347,7 @@ void FileDialog::update_file_list() { while (!dirs.empty()) { String &dir_name = dirs.front()->get(); TreeItem *ti = tree->create_item(root); - ti->set_text(0, dir_name + "/"); + ti->set_text(0, dir_name); ti->set_icon(0, folder); Dictionary d;