summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2020-07-11 16:08:34 +0200
committerFearlessTobi <thm.frey@gmail.com>2020-07-11 16:08:34 +0200
commita59ad9246b346e9e37797a306f1a1a3500900ad3 (patch)
tree5606c3934606cc0e6d931b7df3d0627a166c494c
parentMerge pull request #4203 from VolcaEM/services (diff)
downloadyuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.tar
yuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.tar.gz
yuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.tar.bz2
yuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.tar.lz
yuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.tar.xz
yuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.tar.zst
yuzu-a59ad9246b346e9e37797a306f1a1a3500900ad3.zip
-rw-r--r--src/yuzu/main.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 4d501a8f9..ab4b0e4e5 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -278,17 +278,21 @@ GMainWindow::~GMainWindow() {
}
void GMainWindow::ProfileSelectorSelectProfile() {
- QtProfileSelectionDialog dialog(this);
- dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
- Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
- dialog.setWindowModality(Qt::WindowModal);
- if (dialog.exec() == QDialog::Rejected) {
- emit ProfileSelectorFinishedSelection(std::nullopt);
- return;
+ const Service::Account::ProfileManager manager;
+ int index = 0;
+ if (manager.GetUserCount() != 1) {
+ QtProfileSelectionDialog dialog(this);
+ dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
+ Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
+ dialog.setWindowModality(Qt::WindowModal);
+ if (dialog.exec() == QDialog::Rejected) {
+ emit ProfileSelectorFinishedSelection(std::nullopt);
+ return;
+ }
+ index = dialog.GetIndex();
}
- Service::Account::ProfileManager manager;
- const auto uuid = manager.GetUser(static_cast<std::size_t>(dialog.GetIndex()));
+ const auto uuid = manager.GetUser(static_cast<std::size_t>(index));
if (!uuid.has_value()) {
emit ProfileSelectorFinishedSelection(std::nullopt);
return;