Qt/GameList: Fix broken File Name column

This commit is contained in:
Léo Lam 2017-09-14 18:11:06 +02:00
parent 6db55fc2d0
commit ca3be07e59
2 changed files with 3 additions and 1 deletions

View File

@ -484,7 +484,8 @@ void GameList::OnColumnVisibilityToggled(const QString& row, bool visible)
{tr("Platform"), GameListModel::COL_PLATFORM},
{tr("Size"), GameListModel::COL_SIZE},
{tr("Title"), GameListModel::COL_TITLE},
{tr("State"), GameListModel::COL_RATING}};
{tr("State"), GameListModel::COL_RATING},
{tr("File Name"), GameListModel::COL_FILE_NAME}};
m_list->setColumnHidden(rowname_to_col_index[row], !visible);
}

View File

@ -101,6 +101,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
case COL_FILE_NAME:
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
return game->GetFileName();
break;
case COL_SIZE:
if (role == Qt::DisplayRole)
return FormatSize(game->GetFileSize());