aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/yuzu/multiplayer
diff options
context:
space:
mode:
authorlat9nq <[email protected]>2023-06-05 20:45:33 -0400
committerlat9nq <[email protected]>2023-07-21 10:56:07 -0400
commite7543e8b84c5520e09d5703bc8b191a1a76195b7 (patch)
tree41e99f891257a377e1c3b314f61671d546304f10 /src/yuzu/multiplayer
parent413316560784348b8ea2684d272b974fd0428267 (diff)
downloadyuzu-android-e7543e8b84c5520e09d5703bc8b191a1a76195b7.tar.gz
yuzu-android-e7543e8b84c5520e09d5703bc8b191a1a76195b7.zip
uisettings: Fix typings
Diffstat (limited to 'src/yuzu/multiplayer')
-rw-r--r--src/yuzu/multiplayer/direct_connect.cpp9
-rw-r--r--src/yuzu/multiplayer/host_room.cpp16
-rw-r--r--src/yuzu/multiplayer/lobby.cpp7
3 files changed, 19 insertions, 13 deletions
diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp
index d71cc23a7..a415a953f 100644
--- a/src/yuzu/multiplayer/direct_connect.cpp
+++ b/src/yuzu/multiplayer/direct_connect.cpp
@@ -34,13 +34,14 @@ DirectConnectWindow::DirectConnectWindow(Core::System& system_, QWidget* parent)
connect(watcher, &QFutureWatcher<void>::finished, this, &DirectConnectWindow::OnConnection);
ui->nickname->setValidator(validation.GetNickname());
- ui->nickname->setText(UISettings::values.multiplayer_nickname.GetValue());
+ ui->nickname->setText(
+ QString::fromStdString(UISettings::values.multiplayer_nickname.GetValue()));
if (ui->nickname->text().isEmpty() && !Settings::values.yuzu_username.GetValue().empty()) {
// Use yuzu Web Service user name as nickname by default
ui->nickname->setText(QString::fromStdString(Settings::values.yuzu_username.GetValue()));
}
ui->ip->setValidator(validation.GetIP());
- ui->ip->setText(UISettings::values.multiplayer_ip.GetValue());
+ ui->ip->setText(QString::fromStdString(UISettings::values.multiplayer_ip.GetValue()));
ui->port->setValidator(validation.GetPort());
ui->port->setText(QString::number(UISettings::values.multiplayer_port.GetValue()));
@@ -91,8 +92,8 @@ void DirectConnectWindow::Connect() {
}
// Store settings
- UISettings::values.multiplayer_nickname = ui->nickname->text();
- UISettings::values.multiplayer_ip = ui->ip->text();
+ UISettings::values.multiplayer_nickname = ui->nickname->text().toStdString();
+ UISettings::values.multiplayer_ip = ui->ip->text().toStdString();
if (ui->port->isModified() && !ui->port->text().isEmpty()) {
UISettings::values.multiplayer_port = ui->port->text().toInt();
} else {
diff --git a/src/yuzu/multiplayer/host_room.cpp b/src/yuzu/multiplayer/host_room.cpp
index a8faa5b24..ef364ee43 100644
--- a/src/yuzu/multiplayer/host_room.cpp
+++ b/src/yuzu/multiplayer/host_room.cpp
@@ -55,12 +55,14 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
connect(ui->host, &QPushButton::clicked, this, &HostRoomWindow::Host);
// Restore the settings:
- ui->username->setText(UISettings::values.multiplayer_room_nickname.GetValue());
+ ui->username->setText(
+ QString::fromStdString(UISettings::values.multiplayer_room_nickname.GetValue()));
if (ui->username->text().isEmpty() && !Settings::values.yuzu_username.GetValue().empty()) {
// Use yuzu Web Service user name as nickname by default
ui->username->setText(QString::fromStdString(Settings::values.yuzu_username.GetValue()));
}
- ui->room_name->setText(UISettings::values.multiplayer_room_name.GetValue());
+ ui->room_name->setText(
+ QString::fromStdString(UISettings::values.multiplayer_room_name.GetValue()));
ui->port->setText(QString::number(UISettings::values.multiplayer_room_port.GetValue()));
ui->max_player->setValue(UISettings::values.multiplayer_max_player.GetValue());
int index = UISettings::values.multiplayer_host_type.GetValue();
@@ -72,7 +74,8 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
if (index != -1) {
ui->game_list->setCurrentIndex(index);
}
- ui->room_description->setText(UISettings::values.multiplayer_room_description.GetValue());
+ ui->room_description->setText(
+ QString::fromStdString(UISettings::values.multiplayer_room_description.GetValue()));
}
HostRoomWindow::~HostRoomWindow() = default;
@@ -218,8 +221,8 @@ void HostRoomWindow::Host() {
Network::NoPreferredIP, password, token);
// Store settings
- UISettings::values.multiplayer_room_nickname = ui->username->text();
- UISettings::values.multiplayer_room_name = ui->room_name->text();
+ UISettings::values.multiplayer_room_nickname = ui->username->text().toStdString();
+ UISettings::values.multiplayer_room_name = ui->room_name->text().toStdString();
UISettings::values.multiplayer_game_id =
ui->game_list->currentData(GameListItemPath::ProgramIdRole).toLongLong();
UISettings::values.multiplayer_max_player = ui->max_player->value();
@@ -230,7 +233,8 @@ void HostRoomWindow::Host() {
} else {
UISettings::values.multiplayer_room_port = Network::DefaultRoomPort;
}
- UISettings::values.multiplayer_room_description = ui->room_description->toPlainText();
+ UISettings::values.multiplayer_room_description =
+ ui->room_description->toPlainText().toStdString();
ui->host->setEnabled(true);
emit SaveConfig();
close();
diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp
index 387f6f7c9..603e9ae3d 100644
--- a/src/yuzu/multiplayer/lobby.cpp
+++ b/src/yuzu/multiplayer/lobby.cpp
@@ -60,7 +60,8 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
ui->room_list->setContextMenuPolicy(Qt::CustomContextMenu);
ui->nickname->setValidator(validation.GetNickname());
- ui->nickname->setText(UISettings::values.multiplayer_nickname.GetValue());
+ ui->nickname->setText(
+ QString::fromStdString(UISettings::values.multiplayer_nickname.GetValue()));
// Try find the best nickname by default
if (ui->nickname->text().isEmpty() || ui->nickname->text() == QStringLiteral("yuzu")) {
@@ -202,9 +203,9 @@ void Lobby::OnJoinRoom(const QModelIndex& source) {
// TODO(jroweboy): disable widgets and display a connecting while we wait
// Save settings
- UISettings::values.multiplayer_nickname = ui->nickname->text();
+ UISettings::values.multiplayer_nickname = ui->nickname->text().toStdString();
UISettings::values.multiplayer_ip =
- proxy->data(connection_index, LobbyItemHost::HostIPRole).toString();
+ proxy->data(connection_index, LobbyItemHost::HostIPRole).value<QString>().toStdString();
UISettings::values.multiplayer_port =
proxy->data(connection_index, LobbyItemHost::HostPortRole).toInt();
emit SaveConfig();