From 6dde7419270585745dc86558805931fe905983cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Hamil?= Date: Sat, 14 Feb 2026 22:56:18 +0300 Subject: [PATCH] Refactor update_list: Extract repeated strings into variables for clarity --- rpcs3/rpcs3qt/wiimote_settings_dialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp b/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp index a491418586..8cb56be8f2 100644 --- a/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/wiimote_settings_dialog.cpp @@ -238,10 +238,12 @@ void wiimote_settings_dialog::update_list() auto* wm = wiimote_handler::get_instance(); if (!wm || !wm->is_running()) { - if (ui->wiimoteList->count() != 1 || ui->wiimoteList->item(0)->text() != tr("Wiimote Manager not initialized.")) + const QString text = tr("Wiimote Manager not initialized."); + + if (ui->wiimoteList->count() != 1 || ui->wiimoteList->item(0)->text() != text) { ui->wiimoteList->clear(); - ui->wiimoteList->addItem(tr("Wiimote Manager not initialized.")); + ui->wiimoteList->addItem(text); } return; } @@ -250,10 +252,11 @@ void wiimote_settings_dialog::update_list() if (states.empty()) { - if (ui->wiimoteList->count() != 1 || ui->wiimoteList->item(0)->text() != tr("No Wiimotes found.")) + const QString text = tr("No Wiimotes found."); + if (ui->wiimoteList->count() != 1 || ui->wiimoteList->item(0)->text() != text) { ui->wiimoteList->clear(); - ui->wiimoteList->addItem(tr("No Wiimotes found.")); + ui->wiimoteList->addItem(text); } return; }