mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-07-02 21:48:01 -05:00
Merge pull request #7852 from Morph1984/new-uuid
common: Revise and fix the UUID implementation
This commit is contained in:
@ -23,13 +23,13 @@ QString FormatUserEntryText(const QString& username, Common::UUID 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) {
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -33,10 +33,10 @@ 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::UUID& 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));
|
||||
}
|
||||
|
||||
@ -55,10 +55,10 @@ QString FormatUserEntryText(const QString& username, Common::UUID 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::UUID& 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::UUID::MakeRandom();
|
||||
profile_manager->CreateNewUser(uuid, username.toStdString());
|
||||
|
||||
item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)});
|
||||
|
@ -1652,7 +1652,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 {
|
||||
|
Reference in New Issue
Block a user