profile: Migrate to the new UUID implementation

This commit is contained in:
Morph 2022-02-05 12:29:09 -05:00
parent ad33e58c2d
commit 26f74468c4
14 changed files with 131 additions and 127 deletions

View file

@ -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);
}