@@ -113,7 +113,7 @@ NetPlayDialog::NetPlayDialog(const GameListModel& game_list_model,
113
113
LoadSettings ();
114
114
ConnectWidgets ();
115
115
116
- auto & settings = Settings::Instance ().GetQSettings ();
116
+ const auto & settings = Settings::Instance ().GetQSettings ();
117
117
118
118
restoreGeometry (settings.value (QStringLiteral (" netplaydialog/geometry" )).toByteArray ());
119
119
m_splitter->restoreState (settings.value (QStringLiteral (" netplaydialog/splitter" )).toByteArray ());
@@ -330,12 +330,12 @@ void NetPlayDialog::ConnectWidgets()
330
330
QApplication::clipboard ()->setText (m_hostcode_label->text ());
331
331
});
332
332
connect (m_players_list, &QTableWidget::itemSelectionChanged, [this ] {
333
- int row = m_players_list->currentRow ();
333
+ const int row = m_players_list->currentRow ();
334
334
m_kick_button->setEnabled (row > 0 &&
335
335
!m_players_list->currentItem ()->data (Qt::UserRole).isNull ());
336
336
});
337
337
connect (m_kick_button, &QPushButton::clicked, [this ] {
338
- auto id = m_players_list->currentItem ()->data (Qt::UserRole).toInt ();
338
+ const auto id = m_players_list->currentItem ()->data (Qt::UserRole).toInt ();
339
339
Settings::Instance ().GetNetPlayServer ()->KickPlayer (id);
340
340
});
341
341
connect (m_assign_ports_button, &QPushButton::clicked, [this ] {
@@ -358,8 +358,8 @@ void NetPlayDialog::ConnectWidgets()
358
358
if (value == m_buffer_size)
359
359
return ;
360
360
361
- auto client = Settings::Instance ().GetNetPlayClient ();
362
- auto server = Settings::Instance ().GetNetPlayServer ();
361
+ const auto client = Settings::Instance ().GetNetPlayClient ();
362
+ const auto server = Settings::Instance ().GetNetPlayServer ();
363
363
if (server && !m_host_input_authority)
364
364
server->AdjustPadBufferSize (value);
365
365
else
@@ -369,7 +369,7 @@ void NetPlayDialog::ConnectWidgets()
369
369
const auto hia_function = [this ](bool enable) {
370
370
if (m_host_input_authority != enable)
371
371
{
372
- auto server = Settings::Instance ().GetNetPlayServer ();
372
+ const auto server = Settings::Instance ().GetNetPlayServer ();
373
373
if (server)
374
374
server->SetHostInputAuthority (enable);
375
375
}
@@ -442,7 +442,7 @@ void NetPlayDialog::SendMessage(const std::string& msg)
442
442
void NetPlayDialog::OnChat ()
443
443
{
444
444
QueueOnObject (this , [this ] {
445
- auto msg = m_chat_type_edit->text ().toStdString ();
445
+ const auto msg = m_chat_type_edit->text ().toStdString ();
446
446
447
447
if (msg.empty ())
448
448
return ;
@@ -516,7 +516,7 @@ void NetPlayDialog::show(std::string nickname, bool use_traversal)
516
516
m_chat_edit->clear ();
517
517
m_chat_type_edit->clear ();
518
518
519
- bool is_hosting = Settings::Instance ().GetNetPlayServer () != nullptr ;
519
+ const bool is_hosting = Settings::Instance ().GetNetPlayServer () != nullptr ;
520
520
521
521
if (is_hosting)
522
522
{
@@ -616,8 +616,8 @@ void NetPlayDialog::UpdateDiscordPresence()
616
616
617
617
void NetPlayDialog::UpdateGUI ()
618
618
{
619
- auto client = Settings::Instance ().GetNetPlayClient ();
620
- auto server = Settings::Instance ().GetNetPlayServer ();
619
+ const auto client = Settings::Instance ().GetNetPlayClient ();
620
+ const auto server = Settings::Instance ().GetNetPlayServer ();
621
621
if (!client)
622
622
return ;
623
623
@@ -629,9 +629,9 @@ void NetPlayDialog::UpdateGUI()
629
629
630
630
m_player_count = static_cast <int >(players.size ());
631
631
632
- int selection_pid = m_players_list->currentItem () ?
633
- m_players_list->currentItem ()->data (Qt::UserRole).toInt () :
634
- -1 ;
632
+ const int selection_pid = m_players_list->currentItem () ?
633
+ m_players_list->currentItem ()->data (Qt::UserRole).toInt () :
634
+ -1 ;
635
635
636
636
m_players_list->clear ();
637
637
m_players_list->setHorizontalHeaderLabels (
@@ -803,7 +803,7 @@ void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color,
803
803
.arg (QString::fromStdString (color), msg.toHtmlEscaped ()));
804
804
});
805
805
806
- QColor c (color.empty () ? QStringLiteral (" white" ) : QString::fromStdString (color));
806
+ const QColor c (color.empty () ? QStringLiteral (" white" ) : QString::fromStdString (color));
807
807
808
808
if (Config::Get (Config::GFX_SHOW_NETPLAY_MESSAGES) &&
809
809
Core::IsRunning (Core::System::GetInstance ()))
@@ -886,11 +886,11 @@ void NetPlayDialog::OnMsgStartGame()
886
886
}
887
887
888
888
QueueOnObject (this , [this ] {
889
- auto client = Settings::Instance ().GetNetPlayClient ();
889
+ const auto client = Settings::Instance ().GetNetPlayClient ();
890
890
891
891
if (client)
892
892
{
893
- if (auto game = FindGameFile (m_current_game_identifier))
893
+ if (const auto game = FindGameFile (m_current_game_identifier))
894
894
client->StartGame (game->GetFilePath ());
895
895
else
896
896
PanicAlertFmtT (" Selected game doesn't exist in game list!" );
@@ -1052,7 +1052,7 @@ void NetPlayDialog::OnTtlDetermined(u8 ttl)
1052
1052
1053
1053
bool NetPlayDialog::IsRecording ()
1054
1054
{
1055
- std::optional<bool > is_recording = RunOnObject (m_record_input_action, &QAction::isChecked);
1055
+ const std::optional<bool > is_recording = RunOnObject (m_record_input_action, &QAction::isChecked);
1056
1056
if (is_recording)
1057
1057
return *is_recording;
1058
1058
return false ;
@@ -1068,7 +1068,7 @@ NetPlayDialog::FindGameFile(const NetPlay::SyncIdentifier& sync_identifier,
1068
1068
1069
1069
*found = NetPlay::SyncIdentifierComparison::DifferentGame;
1070
1070
1071
- std::optional<std::shared_ptr<const UICommon::GameFile>> game_file =
1071
+ const std::optional<std::shared_ptr<const UICommon::GameFile>> game_file =
1072
1072
RunOnObject (this , [this , &sync_identifier, found] {
1073
1073
for (int i = 0 ; i < m_game_list_model.rowCount (QModelIndex ()); i++)
1074
1074
{
@@ -1088,7 +1088,7 @@ std::string NetPlayDialog::FindGBARomPath(const std::array<u8, 20>& hash, std::s
1088
1088
int device_number)
1089
1089
{
1090
1090
#ifdef HAS_LIBMGBA
1091
- auto result = RunOnObject (this , [&, this ] {
1091
+ const auto result = RunOnObject (this , [&, this ] {
1092
1092
std::string rom_path;
1093
1093
std::array<u8, 20 > rom_hash;
1094
1094
std::string rom_title;
@@ -1279,7 +1279,7 @@ void NetPlayDialog::SetChunkedProgress(const int pid, const u64 progress)
1279
1279
1280
1280
void NetPlayDialog::SetHostWiiSyncData (std::vector<u64> titles, std::string redirect_folder)
1281
1281
{
1282
- auto client = Settings::Instance ().GetNetPlayClient ();
1282
+ const auto client = Settings::Instance ().GetNetPlayClient ();
1283
1283
if (client)
1284
1284
client->SetWiiSyncData (nullptr , std::move (titles), std::move (redirect_folder));
1285
1285
}
0 commit comments