diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-02-05 18:29:09 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-02-05 19:56:21 +0100 |
commit | dfe11d72e3eb14dee718b7fa67a673514d199f20 (patch) | |
tree | f21885d513c2df4bb409e17016e0996815e37569 /src/yuzu | |
parent | common: uuid: Add AsU128() (diff) | |
download | yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.gz yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.bz2 yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.lz yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.xz yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.zst yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.zip |
Diffstat (limited to 'src/yuzu')
-rw-r--r-- | src/yuzu/applets/qt_profile_select.cpp | 14 | ||||
-rw-r--r-- | src/yuzu/applets/qt_profile_select.h | 7 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_profile_manager.cpp | 14 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/main.h | 2 |
5 files changed, 20 insertions, 19 deletions
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp index 5b32da923..c10185e50 100644 --- a/src/yuzu/applets/qt_profile_select.cpp +++ b/src/yuzu/applets/qt_profile_select.cpp @@ -19,21 +19,21 @@ #include "yuzu/util/controller_navigation.h" namespace { -QString FormatUserEntryText(const QString& username, Common::UUID uuid) { +QString FormatUserEntryText(const QString& username, Common::NewUUID uuid) { return QtProfileSelectionDialog::tr( "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " "00112233-4455-6677-8899-AABBCCDDEEFF))") - .arg(username, QString::fromStdString(uuid.FormatSwitch())); + .arg(username, QString::fromStdString(uuid.FormattedString())); } -QString GetImagePath(Common::UUID uuid) { +QString GetImagePath(Common::NewUUID uuid) { const auto path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / - fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormatSwitch()); + fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); return QString::fromStdString(Common::FS::PathToUTF8String(path)); } -QPixmap GetIcon(Common::UUID uuid) { +QPixmap GetIcon(Common::NewUUID uuid) { QPixmap icon{GetImagePath(uuid)}; if (!icon) { @@ -163,11 +163,11 @@ QtProfileSelector::QtProfileSelector(GMainWindow& parent) { QtProfileSelector::~QtProfileSelector() = default; void QtProfileSelector::SelectProfile( - std::function<void(std::optional<Common::UUID>)> callback_) const { + std::function<void(std::optional<Common::NewUUID>)> callback_) const { callback = std::move(callback_); emit MainWindowSelectProfile(); } -void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::UUID> uuid) { +void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::NewUUID> uuid) { callback(uuid); } diff --git a/src/yuzu/applets/qt_profile_select.h b/src/yuzu/applets/qt_profile_select.h index 56496ed31..2522b6450 100644 --- a/src/yuzu/applets/qt_profile_select.h +++ b/src/yuzu/applets/qt_profile_select.h @@ -66,13 +66,14 @@ public: explicit QtProfileSelector(GMainWindow& parent); ~QtProfileSelector() override; - void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback_) const override; + void SelectProfile( + std::function<void(std::optional<Common::NewUUID>)> callback_) const override; signals: void MainWindowSelectProfile() const; private: - void MainWindowFinishedSelection(std::optional<Common::UUID> uuid); + void MainWindowFinishedSelection(std::optional<Common::NewUUID> uuid); - mutable std::function<void(std::optional<Common::UUID>)> callback; + mutable std::function<void(std::optional<Common::NewUUID>)> callback; }; diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 78b6374c0..9e2832543 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp @@ -33,14 +33,14 @@ constexpr std::array<u8, 107> backup_jpeg{ 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, }; -QString GetImagePath(Common::UUID uuid) { +QString GetImagePath(const Common::NewUUID& uuid) { const auto path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / - fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormatSwitch()); + fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); return QString::fromStdString(Common::FS::PathToUTF8String(path)); } -QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::UUID uuid) { +QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::NewUUID uuid) { Service::Account::ProfileBase profile{}; if (!manager.GetProfileBase(uuid, profile)) { return {}; @@ -51,14 +51,14 @@ QString GetAccountUsername(const Service::Account::ProfileManager& manager, Comm return QString::fromStdString(text); } -QString FormatUserEntryText(const QString& username, Common::UUID uuid) { +QString FormatUserEntryText(const QString& username, Common::NewUUID uuid) { return ConfigureProfileManager::tr("%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " "00112233-4455-6677-8899-AABBCCDDEEFF))") - .arg(username, QString::fromStdString(uuid.FormatSwitch())); + .arg(username, QString::fromStdString(uuid.FormattedString())); } -QPixmap GetIcon(Common::UUID uuid) { +QPixmap GetIcon(const Common::NewUUID& uuid) { QPixmap icon{GetImagePath(uuid)}; if (!icon) { @@ -200,7 +200,7 @@ void ConfigureProfileManager::AddUser() { return; } - const auto uuid = Common::UUID::Generate(); + const auto uuid = Common::NewUUID::MakeRandom(); profile_manager->CreateNewUser(uuid, username.toStdString()); item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)}); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 556d2cdb3..c89909737 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1688,7 +1688,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( *system, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, - program_id, user_id->uuid, 0); + program_id, user_id->AsU128(), 0); path = Common::FS::ConcatPathSafe(nand_dir, user_save_data_path); } else { diff --git a/src/yuzu/main.h b/src/yuzu/main.h index ca4ab9af5..529d101ae 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -153,7 +153,7 @@ signals: void ErrorDisplayFinished(); - void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid); + void ProfileSelectorFinishedSelection(std::optional<Common::NewUUID> uuid); void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, bool confirmed); |