Qt/GameListModel: Use native separators in File Path column

This commit is contained in:
Silent 2020-03-19 18:03:35 +01:00
parent 53c34d962d
commit 4a438db2c9
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
1 changed files with 2 additions and 1 deletions

View File

@ -145,7 +145,8 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
case COL_FILE_PATH:
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
{
QString file_path = QFileInfo(QString::fromStdString(game.GetFilePath())).canonicalPath();
QString file_path = QDir::toNativeSeparators(
QFileInfo(QString::fromStdString(game.GetFilePath())).canonicalPath());
if (!file_path.endsWith(QDir::separator()))
file_path.append(QDir::separator());
return file_path;