You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Merge pull request #18338 from Zylann/fix_find_in_files
Fix Find in Files
This commit is contained in:
@@ -154,9 +154,7 @@ void FindInFiles::_iterate() {
|
|||||||
PoolStringArray sub_dirs;
|
PoolStringArray sub_dirs;
|
||||||
_scan_dir(_root_prefix + _current_dir, sub_dirs);
|
_scan_dir(_root_prefix + _current_dir, sub_dirs);
|
||||||
|
|
||||||
if (sub_dirs.size() != 0) {
|
|
||||||
_folders_stack.push_back(sub_dirs);
|
_folders_stack.push_back(sub_dirs);
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Go back one level
|
// Go back one level
|
||||||
@@ -176,7 +174,7 @@ void FindInFiles::_iterate() {
|
|||||||
|
|
||||||
String fpath = _files_to_scan[_files_to_scan.size() - 1];
|
String fpath = _files_to_scan[_files_to_scan.size() - 1];
|
||||||
pop_back(_files_to_scan);
|
pop_back(_files_to_scan);
|
||||||
_scan_file(_root_prefix + fpath);
|
_scan_file(fpath);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
print_line("Search complete");
|
print_line("Search complete");
|
||||||
@@ -202,8 +200,6 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//print_line(String("Scanning ") + path);
|
|
||||||
|
|
||||||
dir->list_dir_begin();
|
dir->list_dir_begin();
|
||||||
|
|
||||||
for (int i = 0; i < 1000; ++i) {
|
for (int i = 0; i < 1000; ++i) {
|
||||||
@@ -222,7 +218,7 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
|
|||||||
else {
|
else {
|
||||||
String file_ext = file.get_extension();
|
String file_ext = file.get_extension();
|
||||||
if (_extension_filter.has(file_ext)) {
|
if (_extension_filter.has(file_ext)) {
|
||||||
_files_to_scan.push_back(file);
|
_files_to_scan.push_back(path.plus_file(file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,7 +228,6 @@ void FindInFiles::_scan_file(String fpath) {
|
|||||||
|
|
||||||
FileAccess *f = FileAccess::open(fpath, FileAccess::READ);
|
FileAccess *f = FileAccess::open(fpath, FileAccess::READ);
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
f->close();
|
|
||||||
print_line(String("Cannot open file ") + fpath);
|
print_line(String("Cannot open file ") + fpath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user