diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-07 15:11:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 15:11:32 +0100 |
commit | c2e96c65b375def81fc13e737d1be02093951c44 (patch) | |
tree | f793e781b8505d35a1382edb08a9ba2e5ac7a2cf /editor/find_in_files.cpp | |
parent | e4a2003b9860db00452e4a65f8cc55d7f525c463 (diff) | |
parent | f6d137d3d0cdf97f8ecd7b79fbeb1779684552a8 (diff) | |
download | redot-engine-c2e96c65b375def81fc13e737d1be02093951c44.tar.gz |
Merge pull request #23327 from YeldhamDev/search_shaders
Added "shader" filter to "Find in Files"
Diffstat (limited to 'editor/find_in_files.cpp')
-rw-r--r-- | editor/find_in_files.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 705bb1d9c5..6ebe8cfe2c 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -44,8 +44,6 @@ #include "scene/gui/progress_bar.h" #include "scene/gui/tree.h" -#define ROOT_PREFIX "res://" - const char *FindInFiles::SIGNAL_RESULT_FOUND = "result_found"; const char *FindInFiles::SIGNAL_FINISHED = "finished"; @@ -89,7 +87,6 @@ static bool find_next(const String &line, String pattern, int from, bool match_c //-------------------------------------------------------------------------------- FindInFiles::FindInFiles() { - _root_prefix = ROOT_PREFIX; _searching = false; _whole_words = true; _match_case = true; @@ -182,7 +179,7 @@ void FindInFiles::_iterate() { _current_dir = _current_dir.plus_file(folder_name); PoolStringArray sub_dirs; - _scan_dir(_root_prefix + _current_dir, sub_dirs); + _scan_dir("res://" + _current_dir, sub_dirs); _folders_stack.push_back(sub_dirs); @@ -348,7 +345,7 @@ FindInFilesDialog::FindInFilesDialog() { HBoxContainer *hbc = memnew(HBoxContainer); Label *prefix_label = memnew(Label); - prefix_label->set_text(ROOT_PREFIX); + prefix_label->set_text("res://"); hbc->add_child(prefix_label); _folder_line_edit = memnew(LineEdit); @@ -375,10 +372,12 @@ FindInFilesDialog::FindInFilesDialog() { { HBoxContainer *hbc = memnew(HBoxContainer); + // TODO: Unhardcode this. Vector<String> exts; exts.push_back("gd"); if (Engine::get_singleton()->has_singleton("GodotSharp")) exts.push_back("cs"); + exts.push_back("shader"); for (int i = 0; i < exts.size(); ++i) { CheckBox *cb = memnew(CheckBox); |