Merge pull request #13121 from Krakean/change_filedialog_removedot

Remove the "." and "/" (at the end of folders name) from file manage dialog (open scene, open file, ...)
This commit is contained in:
George Marques 2017-11-21 12:30:20 -02:00 committed by GitHub
commit 20b07a1fb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -541,6 +541,9 @@ void EditorFileDialog::update_file_list() {
while ((item = dir_access->get_next(&isdir)) != "") { while ((item = dir_access->get_next(&isdir)) != "") {
if (item == ".")
continue;
ishidden = dir_access->current_is_hidden(); ishidden = dir_access->current_is_hidden();
if (show_hidden || !ishidden) { if (show_hidden || !ishidden) {
@ -562,7 +565,7 @@ void EditorFileDialog::update_file_list() {
while (!dirs.empty()) { while (!dirs.empty()) {
const String &dir_name = dirs.front()->get(); const String &dir_name = dirs.front()->get();
item_list->add_item(dir_name + "/"); item_list->add_item(dir_name);
if (display_mode == DISPLAY_THUMBNAILS) { if (display_mode == DISPLAY_THUMBNAILS) {

View File

@ -323,6 +323,9 @@ void FileDialog::update_file_list() {
while ((item = dir_access->get_next(&isdir)) != "") { while ((item = dir_access->get_next(&isdir)) != "") {
if (item == ".")
continue;
ishidden = dir_access->current_is_hidden(); ishidden = dir_access->current_is_hidden();
if (show_hidden || !ishidden) { if (show_hidden || !ishidden) {
@ -344,7 +347,7 @@ void FileDialog::update_file_list() {
while (!dirs.empty()) { while (!dirs.empty()) {
String &dir_name = dirs.front()->get(); String &dir_name = dirs.front()->get();
TreeItem *ti = tree->create_item(root); TreeItem *ti = tree->create_item(root);
ti->set_text(0, dir_name + "/"); ti->set_text(0, dir_name);
ti->set_icon(0, folder); ti->set_icon(0, folder);
Dictionary d; Dictionary d;