Port yuzu-emu/yuzu#4700: "game_list: Eliminate redundant argument copies" (#5571)

* game_list: Eliminate redundant argument copies

Several functions can be taken by const reference to avoid copies

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>

* game_list: Make game list function naming consistent

Makes the naming consistent with the rest of the functions that are
present.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>

Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
This commit is contained in:
Tobias 2020-12-07 16:05:13 +01:00 committed by GitHub
parent c557b290af
commit 702af87f0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 53 deletions

View file

@ -619,7 +619,7 @@ void GMainWindow::RestoreUIState() {
OnDisplayTitleBars(ui->action_Display_Dock_Widget_Headers->isChecked());
ui->action_Show_Filter_Bar->setChecked(UISettings::values.show_filter_bar);
game_list->setFilterVisible(ui->action_Show_Filter_Bar->isChecked());
game_list->SetFilterVisible(ui->action_Show_Filter_Bar->isChecked());
ui->action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar);
statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
@ -1143,11 +1143,11 @@ void GMainWindow::ShutdownGame() {
render_window->hide();
loading_screen->hide();
loading_screen->Clear();
if (game_list->isEmpty())
if (game_list->IsEmpty())
game_list_placeholder->show();
else
game_list->show();
game_list->setFilterFocus();
game_list->SetFilterFocus();
setMouseTracking(false);
@ -1449,7 +1449,7 @@ void GMainWindow::OnMenuInstallCIA() {
void GMainWindow::InstallCIA(QStringList filepaths) {
ui->action_Install_CIA->setEnabled(false);
game_list->setDirectoryWatcherEnabled(false);
game_list->SetDirectoryWatcherEnabled(false);
progress_bar->show();
progress_bar->setMaximum(INT_MAX);
@ -1503,7 +1503,7 @@ void GMainWindow::OnCIAInstallReport(Service::AM::InstallStatus status, QString
void GMainWindow::OnCIAInstallFinished() {
progress_bar->hide();
progress_bar->setValue(0);
game_list->setDirectoryWatcherEnabled(true);
game_list->SetDirectoryWatcherEnabled(true);
ui->action_Install_CIA->setEnabled(true);
game_list->PopulateAsync(UISettings::values.game_dirs);
}
@ -1818,11 +1818,11 @@ void GMainWindow::OnOpenCitraFolder() {
}
void GMainWindow::OnToggleFilterBar() {
game_list->setFilterVisible(ui->action_Show_Filter_Bar->isChecked());
game_list->SetFilterVisible(ui->action_Show_Filter_Bar->isChecked());
if (ui->action_Show_Filter_Bar->isChecked()) {
game_list->setFilterFocus();
game_list->SetFilterFocus();
} else {
game_list->clearFilter();
game_list->ClearFilter();
}
}