game_list: rewrite format

This commit is contained in:
zhupengfei 2018-05-26 22:27:59 +08:00
parent e5c8b9f0a2
commit 9504aa19d5
No known key found for this signature in database
GPG Key ID: 85B82A3E62174206

View File

@ -173,7 +173,7 @@ public:
&extension);
QString title = data(TitleRole).toString();
QString second_name = QString::fromStdString(filename + extension);
QRegExp installed_system_pattern(
static QRegExp installed_system_pattern(
QString::fromStdString(
FileUtil::GetUserPath(D_SDMC_IDX) +
"Nintendo "
@ -182,9 +182,10 @@ public:
.replace("\\", "\\\\"));
if (installed_system_pattern.exactMatch(QString::fromStdString(path))) {
// Use a different mechanism for system / installed titles showing program ID
second_name = "000" +
QString::number(data(ProgramIdRole).toULongLong(), 16).toUpper() +
"-" + QString::fromStdString(filename);
second_name = QString("%1-%2")
.arg(data(ProgramIdRole).toULongLong(), 16, 16, QChar('0'))
.toUpper()
.arg(QString::fromStdString(filename));
}
return title + (title.isEmpty() ? "" : "\n ") + second_name;
} else {