DolphinQT/Netplay: Make variables constant

This commit is contained in:
Dr. Dystopia
2025-03-26 17:00:13 +01:00
parent b2e5d6df25
commit cb30862cfb
6 changed files with 51 additions and 51 deletions

View File

@ -36,19 +36,19 @@ NetPlaySetupDialog::NetPlaySetupDialog(const GameListModel& game_list_model, QWi
CreateMainLayout();
bool use_index = Config::Get(Config::NETPLAY_USE_INDEX);
std::string index_region = Config::Get(Config::NETPLAY_INDEX_REGION);
std::string index_name = Config::Get(Config::NETPLAY_INDEX_NAME);
std::string index_password = Config::Get(Config::NETPLAY_INDEX_PASSWORD);
std::string nickname = Config::Get(Config::NETPLAY_NICKNAME);
std::string traversal_choice = Config::Get(Config::NETPLAY_TRAVERSAL_CHOICE);
int connect_port = Config::Get(Config::NETPLAY_CONNECT_PORT);
int host_port = Config::Get(Config::NETPLAY_HOST_PORT);
int host_listen_port = Config::Get(Config::NETPLAY_LISTEN_PORT);
bool enable_chunked_upload_limit = Config::Get(Config::NETPLAY_ENABLE_CHUNKED_UPLOAD_LIMIT);
u32 chunked_upload_limit = Config::Get(Config::NETPLAY_CHUNKED_UPLOAD_LIMIT);
const bool use_index = Config::Get(Config::NETPLAY_USE_INDEX);
const std::string index_region = Config::Get(Config::NETPLAY_INDEX_REGION);
const std::string index_name = Config::Get(Config::NETPLAY_INDEX_NAME);
const std::string index_password = Config::Get(Config::NETPLAY_INDEX_PASSWORD);
const std::string nickname = Config::Get(Config::NETPLAY_NICKNAME);
const std::string traversal_choice = Config::Get(Config::NETPLAY_TRAVERSAL_CHOICE);
const int connect_port = Config::Get(Config::NETPLAY_CONNECT_PORT);
const int host_port = Config::Get(Config::NETPLAY_HOST_PORT);
const int host_listen_port = Config::Get(Config::NETPLAY_LISTEN_PORT);
const bool enable_chunked_upload_limit = Config::Get(Config::NETPLAY_ENABLE_CHUNKED_UPLOAD_LIMIT);
const u32 chunked_upload_limit = Config::Get(Config::NETPLAY_CHUNKED_UPLOAD_LIMIT);
#ifdef USE_UPNP
bool use_upnp = Config::Get(Config::NETPLAY_USE_UPNP);
const bool use_upnp = Config::Get(Config::NETPLAY_USE_UPNP);
m_host_upnp->setChecked(use_upnp);
#endif
@ -305,7 +305,7 @@ void NetPlaySetupDialog::OnConnectionTypeChanged(int index)
m_reset_traversal_button->setHidden(index == 0);
std::string address =
const std::string address =
index == 0 ? Config::Get(Config::NETPLAY_ADDRESS) : Config::Get(Config::NETPLAY_HOST_CODE);
m_ip_label->setText(index == 0 ? tr("IP Address:") : tr("Host Code:"));