diff options
author | Lioncash <mathew1800@gmail.com> | 2019-05-29 06:34:42 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-05-29 06:56:41 +0200 |
commit | 802dd3cc95aee9e7ba3a5005e291beb65612b52b (patch) | |
tree | ba5e21e90404819ef075e4ac6860be77c098a952 | |
parent | profile_select: Return int instead of u32 for GetIndex() (diff) | |
download | yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.tar yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.tar.gz yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.tar.bz2 yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.tar.lz yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.tar.xz yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.tar.zst yuzu-802dd3cc95aee9e7ba3a5005e291beb65612b52b.zip |
-rw-r--r-- | src/yuzu/applets/profile_select.cpp | 6 | ||||
-rw-r--r-- | src/yuzu/applets/profile_select.h | 6 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 14 |
3 files changed, 8 insertions, 18 deletions
diff --git a/src/yuzu/applets/profile_select.cpp b/src/yuzu/applets/profile_select.cpp index 6696cb532..bb8913162 100644 --- a/src/yuzu/applets/profile_select.cpp +++ b/src/yuzu/applets/profile_select.cpp @@ -122,20 +122,14 @@ QtProfileSelectionDialog::QtProfileSelectionDialog(QWidget* parent) QtProfileSelectionDialog::~QtProfileSelectionDialog() = default; void QtProfileSelectionDialog::accept() { - ok = true; QDialog::accept(); } void QtProfileSelectionDialog::reject() { - ok = false; user_index = 0; QDialog::reject(); } -bool QtProfileSelectionDialog::GetStatus() const { - return ok; -} - int QtProfileSelectionDialog::GetIndex() const { return user_index; } diff --git a/src/yuzu/applets/profile_select.h b/src/yuzu/applets/profile_select.h index ff02df93b..1055d4809 100644 --- a/src/yuzu/applets/profile_select.h +++ b/src/yuzu/applets/profile_select.h @@ -29,15 +29,13 @@ public: void accept() override; void reject() override; - bool GetStatus() const; int GetIndex() const; private: - bool ok = false; - int user_index = 0; - void SelectUser(const QModelIndex& index); + int user_index = 0; + QVBoxLayout* layout; QTreeView* tree_view; QStandardItemModel* item_model; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1e24b9028..cb07b64b8 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -238,9 +238,7 @@ void GMainWindow::ProfileSelectorSelectProfile() { dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); dialog.setWindowModality(Qt::WindowModal); - dialog.exec(); - - if (!dialog.GetStatus()) { + if (dialog.exec() == QDialog::Rejected) { emit ProfileSelectorFinishedSelection(std::nullopt); return; } @@ -901,11 +899,12 @@ void GMainWindow::SelectAndSetCurrentUser() { dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); dialog.setWindowModality(Qt::WindowModal); - dialog.exec(); - if (dialog.GetStatus()) { - Settings::values.current_user = dialog.GetIndex(); + if (dialog.exec() == QDialog::Rejected) { + return; } + + Settings::values.current_user = dialog.GetIndex(); } void GMainWindow::BootGame(const QString& filename) { @@ -1060,9 +1059,8 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); dialog.setWindowModality(Qt::WindowModal); - dialog.exec(); - if (!dialog.GetStatus()) { + if (dialog.exec() == QDialog::Rejected) { return -1; } |