diff options
| author | 2019-05-19 13:05:06 -0400 | |
|---|---|---|
| committer | 2019-05-19 13:05:09 -0400 | |
| commit | 2318c394a805cbd58e6087a144456d3980e1de36 (patch) | |
| tree | 2dfdbb68e493fc5008c3fd77805de5c197325268 | |
| parent | yuzu/configuration/configure_system: Specify string conversions explicitly (diff) | |
| download | yuzu-2318c394a805cbd58e6087a144456d3980e1de36.tar.gz yuzu-2318c394a805cbd58e6087a144456d3980e1de36.tar.xz yuzu-2318c394a805cbd58e6087a144456d3980e1de36.zip | |
yuzu/configuration/configure_web: Specify string conversions explicitly
Allows the web config code to compile with implicit string conversions
disabled. We can also deduplicate the calls to create the pixmap.
| -rw-r--r-- | src/yuzu/configuration/configure_web.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp index 18566d028..9dc34412d 100644 --- a/src/yuzu/configuration/configure_web.cpp +++ b/src/yuzu/configuration/configure_web.cpp | |||
| @@ -78,12 +78,16 @@ void ConfigureWeb::RefreshTelemetryID() { | |||
| 78 | void ConfigureWeb::OnLoginChanged() { | 78 | void ConfigureWeb::OnLoginChanged() { |
| 79 | if (ui->edit_username->text().isEmpty() && ui->edit_token->text().isEmpty()) { | 79 | if (ui->edit_username->text().isEmpty() && ui->edit_token->text().isEmpty()) { |
| 80 | user_verified = true; | 80 | user_verified = true; |
| 81 | ui->label_username_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); | 81 | |
| 82 | ui->label_token_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); | 82 | const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("checked")).pixmap(16); |
| 83 | ui->label_username_verified->setPixmap(pixmap); | ||
| 84 | ui->label_token_verified->setPixmap(pixmap); | ||
| 83 | } else { | 85 | } else { |
| 84 | user_verified = false; | 86 | user_verified = false; |
| 85 | ui->label_username_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); | 87 | |
| 86 | ui->label_token_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); | 88 | const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("failed")).pixmap(16); |
| 89 | ui->label_username_verified->setPixmap(pixmap); | ||
| 90 | ui->label_token_verified->setPixmap(pixmap); | ||
| 87 | } | 91 | } |
| 88 | } | 92 | } |
| 89 | 93 | ||
| @@ -101,11 +105,15 @@ void ConfigureWeb::OnLoginVerified() { | |||
| 101 | ui->button_verify_login->setText(tr("Verify")); | 105 | ui->button_verify_login->setText(tr("Verify")); |
| 102 | if (verify_watcher.result()) { | 106 | if (verify_watcher.result()) { |
| 103 | user_verified = true; | 107 | user_verified = true; |
| 104 | ui->label_username_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); | 108 | |
| 105 | ui->label_token_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); | 109 | const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("checked")).pixmap(16); |
| 110 | ui->label_username_verified->setPixmap(pixmap); | ||
| 111 | ui->label_token_verified->setPixmap(pixmap); | ||
| 106 | } else { | 112 | } else { |
| 107 | ui->label_username_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); | 113 | const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("failed")).pixmap(16); |
| 108 | ui->label_token_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); | 114 | ui->label_username_verified->setPixmap(pixmap); |
| 115 | ui->label_token_verified->setPixmap(pixmap); | ||
| 116 | |||
| 109 | QMessageBox::critical( | 117 | QMessageBox::critical( |
| 110 | this, tr("Verification failed"), | 118 | this, tr("Verification failed"), |
| 111 | tr("Verification failed. Check that you have entered your username and token " | 119 | tr("Verification failed. Check that you have entered your username and token " |