Display the number of results for global search

(cherry picked from commit 7c0d682951)
This commit is contained in:
Yuri Sizov 2020-12-11 19:13:33 +03:00 committed by Rémi Verschelde
parent 1a64f5d2ec
commit 4d66d2aebd
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -732,8 +732,19 @@ void FindInFilesPanel::_on_item_edited() {
} }
void FindInFilesPanel::_on_finished() { void FindInFilesPanel::_on_finished() {
String results_text;
int result_count = _result_items.size();
int file_count = _file_items.size();
_status_label->set_text(TTR("Search complete")); if (result_count == 1 && file_count == 1) {
results_text = vformat(TTR("%d match in %d file."), result_count, file_count);
} else if (result_count != 1 && file_count == 1) {
results_text = vformat(TTR("%d matches in %d file."), result_count, file_count);
} else {
results_text = vformat(TTR("%d matches in %d files."), result_count, file_count);
}
_status_label->set_text(results_text);
update_replace_buttons(); update_replace_buttons();
set_progress_visible(false); set_progress_visible(false);
_refresh_button->show(); _refresh_button->show();