Merge pull request #6751 from spycrab/qt_show_disc
Qt: Show disc number
This commit is contained in:
commit
6e6bf689e7
|
@ -74,7 +74,18 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||||
break;
|
break;
|
||||||
case COL_TITLE:
|
case COL_TITLE:
|
||||||
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
||||||
return QString::fromStdString(game.GetName());
|
{
|
||||||
|
QString name = QString::fromStdString(game.GetName());
|
||||||
|
const int disc_nr = game.GetDiscNumber() + 1;
|
||||||
|
if (disc_nr > 1)
|
||||||
|
{
|
||||||
|
if (!name.contains(QRegExp(QStringLiteral("disc ?%1").arg(disc_nr), Qt::CaseInsensitive)))
|
||||||
|
{
|
||||||
|
name.append(tr(" (Disc %1)").arg(disc_nr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case COL_ID:
|
case COL_ID:
|
||||||
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
||||||
|
|
Loading…
Reference in New Issue