more qt fixes

This commit is contained in:
lizzie 2026-03-18 00:31:33 +00:00 committed by crueter
parent 539d06eeb6
commit 4519450d48
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
8 changed files with 39 additions and 34 deletions

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
@ -24,22 +24,22 @@
#include "yuzu/util/controller_navigation.h"
namespace {
QString FormatUserEntryText(const QString& username, Common::UUID uuid) {
QString FormatProfileUserEntryText(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.FormattedString()));
}
QString GetImagePath(Common::UUID uuid) {
QString GetProfileImagePath(const Common::UUID uuid) {
const auto path =
Common::FS::GetEdenPath(Common::FS::EdenPath::NANDDir) /
fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
return QString::fromStdString(Common::FS::PathToUTF8String(path));
}
QPixmap GetIcon(Common::UUID uuid) {
QPixmap icon{GetImagePath(uuid)};
QPixmap GetProfileIcon(Common::UUID uuid) {
QPixmap icon{GetProfileImagePath(uuid)};
if (!icon) {
icon.fill(Qt::black);
@ -118,8 +118,11 @@ QtProfileSelectionDialog::QtProfileSelectionDialog(
const auto username = Common::StringFromFixedZeroTerminatedBuffer(
reinterpret_cast<const char*>(profile.username.data()), profile.username.size());
list_items.push_back(QList<QStandardItem*>{new QStandardItem{
GetIcon(user), FormatUserEntryText(QString::fromStdString(username), user)}});
auto const text = QtProfileSelectionDialog::tr(
"%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. "
"00112233-4455-6677-8899-AABBCCDDEEFF))")
.arg(QString::fromStdString(username), QString::fromStdString(user.FormattedString()));
list_items.push_back(QList<QStandardItem*>{new QStandardItem{GetProfileIcon(user), text}});
}
for (const auto& item : list_items)