aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-05-29 00:23:46 -0400
committerLioncash <mathew1800@gmail.com>2019-05-29 00:29:09 -0400
commit139301c5a12b769d5a13dec55589ed7fb5dc7bdf (patch)
tree7988b954c2cb870185c29a9b247bb8058b87d217 /src/yuzu/main.cpp
parent90c9d703baacddb6abdf464bfb9c9eb906bd78a8 (diff)
profile_select: Return int instead of u32 for GetIndex()
Qt uses a signed value to represent indices. We should follow this convention where applicable to avoid unnecessary sign-conversion warnings, as well as making it easier to interoperate with other aspects of Qt. While we're at it, we can also make a sign-conversion explicit.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index cef2cc1ae8..1e24b90284 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -246,7 +246,7 @@ void GMainWindow::ProfileSelectorSelectProfile() {
}
Service::Account::ProfileManager manager;
- const auto uuid = manager.GetUser(dialog.GetIndex());
+ const auto uuid = manager.GetUser(static_cast<std::size_t>(dialog.GetIndex()));
if (!uuid.has_value()) {
emit ProfileSelectorFinishedSelection(std::nullopt);
return;
@@ -904,7 +904,7 @@ void GMainWindow::SelectAndSetCurrentUser() {
dialog.exec();
if (dialog.GetStatus()) {
- Settings::values.current_user = static_cast<s32>(dialog.GetIndex());
+ Settings::values.current_user = dialog.GetIndex();
}
}
@@ -1055,7 +1055,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
const std::string nand_dir = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
ASSERT(program_id != 0);
- const auto select_profile = [this]() -> s32 {
+ const auto select_profile = [this] {
QtProfileSelectionDialog dialog(this);
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
@@ -1070,11 +1070,12 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
};
const auto index = select_profile();
- if (index == -1)
+ if (index == -1) {
return;
+ }
Service::Account::ProfileManager manager;
- const auto user_id = manager.GetUser(index);
+ const auto user_id = manager.GetUser(static_cast<std::size_t>(index));
ASSERT(user_id);
path = nand_dir + FileSys::SaveDataFactory::GetFullPath(FileSys::SaveDataSpaceId::NandUser,
FileSys::SaveDataType::SaveData,