diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-10-13 13:02:33 -0400 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-10-23 19:31:28 -0400 |
commit | 45f2a2fe29373f261144c097d169dad8b65fe012 (patch) | |
tree | 610b04ce839b40eaab1fe297c625b34eaf76e9cd /src/yuzu/main.cpp | |
parent | e408bbceed90da8965480e23d05fb764fcbfbb84 (diff) |
acc: Fix account UUID duplication error
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9a3535e77..47f494841 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -762,19 +762,16 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target Service::Account::ProfileManager manager{}; const auto user_ids = manager.GetAllUsers(); QStringList list; - std::transform( - user_ids.begin(), user_ids.end(), std::back_inserter(list), - [&manager](const auto& user_id) -> QString { - if (user_id == Service::Account::UUID{}) - return ""; - Service::Account::ProfileBase base; - if (!manager.GetProfileBase(user_id, base)) - return ""; - - return QString::fromStdString(Common::StringFromFixedZeroTerminatedBuffer( - reinterpret_cast<const char*>(base.username.data()), base.username.size())); - }); - list.removeAll(""); + for (const auto& user_id : user_ids) { + if (user_id == Service::Account::UUID{}) + continue; + Service::Account::ProfileBase base; + if (!manager.GetProfileBase(user_id, base)) + continue; + + list.push_back(QString::fromStdString(Common::StringFromFixedZeroTerminatedBuffer( + reinterpret_cast<const char*>(base.username.data()), base.username.size()))); + } bool ok = false; const auto index_string = @@ -787,10 +784,11 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target const auto index = list.indexOf(index_string); ASSERT(index != -1 && index < 8); - const auto user_id = manager.GetAllUsers()[index]; + const auto user_id = manager.GetUser(index); + ASSERT(user_id != boost::none); path = nand_dir + FileSys::SaveDataFactory::GetFullPath(FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, - program_id, user_id.uuid, 0); + program_id, user_id->uuid, 0); if (!FileUtil::Exists(path)) { FileUtil::CreateFullPath(path); |