GameList: Show (Disc 1) for first disc of two-disc games

Append disc label to the first disc of two-disc games too, rather than
only labelling the second disc.
This commit is contained in:
Dentomologist
2024-04-11 16:35:18 -07:00
parent 1fa5c3485c
commit 37b89d5b71
4 changed files with 82 additions and 6 deletions

View File

@ -92,14 +92,14 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
{
QString name = QString::fromStdString(game.GetName(m_title_database));
// Add disc numbers > 1 to title if not present.
const int disc_nr = game.GetDiscNumber() + 1;
if (disc_nr > 1)
const int disc_number = game.GetDiscNumber() + 1;
if (disc_number > 1 || game.IsTwoDiscGame())
{
if (!name.contains(QRegularExpression(QStringLiteral("disc ?%1").arg(disc_nr),
// Add disc number to title if not present.
if (!name.contains(QRegularExpression(QStringLiteral("disc ?%1").arg(disc_number),
QRegularExpression::CaseInsensitiveOption)))
{
name.append(tr(" (Disc %1)").arg(disc_nr));
name.append(tr(" (Disc %1)").arg(disc_number));
}
}