diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-07-25 11:09:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-07-25 11:09:57 +0200 |
commit | 43238bb59af7a0b7e98540a2786d006dad8747c9 (patch) | |
tree | 67b640f9b898f0d2879b4e7eb2205dd33ebca6be /editor | |
parent | 1481d299ea97fa1311a75a9ee39eb97d624a8619 (diff) |
DirAccess: Drop compat get_next(bool *is_dir) which was hidden
Fixes this warning:
```
./core/os/dir_access.h:74:17: warning: 'virtual String DirAccess::get_next(bool*)' was hidden [-Woverloaded-virtual]
```
Part of #30790.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc/doc_data.cpp | 14 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 11 | ||||
-rw-r--r-- | editor/editor_file_system.cpp | 10 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 20 |
4 files changed, 21 insertions, 34 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 6f09e73fab..5b8c8fffb8 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -741,10 +741,9 @@ Error DocData::load_classes(const String &p_dir) { da->list_dir_begin(); String path; - bool isdir; - path = da->get_next(&isdir); + path = da->get_next(); while (path != String()) { - if (!isdir && path.ends_with("xml")) { + if (!da->current_is_dir() && path.ends_with("xml")) { Ref<XMLParser> parser = memnew(XMLParser); Error err2 = parser->open(p_dir.plus_file(path)); if (err2) @@ -752,7 +751,7 @@ Error DocData::load_classes(const String &p_dir) { _load(parser); } - path = da->get_next(&isdir); + path = da->get_next(); } da->list_dir_end(); @@ -771,13 +770,12 @@ Error DocData::erase_classes(const String &p_dir) { da->list_dir_begin(); String path; - bool isdir; - path = da->get_next(&isdir); + path = da->get_next(); while (path != String()) { - if (!isdir && path.ends_with("xml")) { + if (!da->current_is_dir() && path.ends_with("xml")) { to_erase.push_back(path); } - path = da->get_next(&isdir); + path = da->get_next(); } da->list_dir_end(); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 24c5a788b6..46518d387b 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "editor_file_dialog.h" + #include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" @@ -731,19 +732,15 @@ void EditorFileDialog::update_file_list() { List<String> files; List<String> dirs; - bool is_dir; - bool is_hidden; String item; - while ((item = dir_access->get_next(&is_dir)) != "") { + while ((item = dir_access->get_next()) != "") { if (item == "." || item == "..") continue; - is_hidden = dir_access->current_is_hidden(); - - if (show_hidden_files || !is_hidden) { - if (!is_dir) + if (show_hidden_files || !dir_access->current_is_hidden()) { + if (!dir_access->current_is_dir()) files.push_back(item); else dirs.push_back(item); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 87a37acac6..be3df2815e 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -673,12 +673,11 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess da->list_dir_begin(); while (true) { - bool isdir; - String f = da->get_next(&isdir); + String f = da->get_next(); if (f == "") break; - if (isdir) { + if (da->current_is_dir()) { if (f.begins_with(".")) //ignore hidden and . / .. continue; @@ -870,12 +869,11 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const da->list_dir_begin(); while (true) { - bool isdir; - String f = da->get_next(&isdir); + String f = da->get_next(); if (f == "") break; - if (isdir) { + if (da->current_is_dir()) { if (f.begins_with(".")) //ignore hidden and . / .. continue; diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index bd61e6182c..ecfad4d146 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -52,18 +52,16 @@ void ExportTemplateManager::_update_template_list() { DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); Error err = d->change_dir(EditorSettings::get_singleton()->get_templates_dir()); - d->list_dir_begin(); Set<String> templates; - + d->list_dir_begin(); if (err == OK) { - bool isdir; - String c = d->get_next(&isdir); + String c = d->get_next(); while (c != String()) { - if (isdir && !c.begins_with(".")) { + if (d->current_is_dir() && !c.begins_with(".")) { templates.insert(c); } - c = d->get_next(&isdir); + c = d->get_next(); } } d->list_dir_end(); @@ -154,18 +152,14 @@ void ExportTemplateManager::_uninstall_template_confirm() { ERR_FAIL_COND(err != OK); Vector<String> files; - d->list_dir_begin(); - - bool isdir; - String c = d->get_next(&isdir); + String c = d->get_next(); while (c != String()) { - if (!isdir) { + if (!d->current_is_dir()) { files.push_back(c); } - c = d->get_next(&isdir); + c = d->get_next(); } - d->list_dir_end(); for (int i = 0; i < files.size(); i++) { |