Skip to content

Commit

Permalink
Qt/GameListModel: Use absolutePath for file path column
Browse files Browse the repository at this point in the history
canonicalPath is orders of magnitude slower as it has to perform actual
disk I/O to resolve symlinks, which makes sorting by this column
ridiculously slow for large game lists, especially if the games are on
a NAS. We probably don't need that, simply resolving relative paths
should be sufficient.
  • Loading branch information
Techjar committed Jun 6, 2020
1 parent 4fc8674 commit fa208c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/GameList/GameListModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
{
QString file_path = QDir::toNativeSeparators(
QFileInfo(QString::fromStdString(game.GetFilePath())).canonicalPath());
QFileInfo(QString::fromStdString(game.GetFilePath())).absolutePath());
if (!file_path.endsWith(QDir::separator()))
file_path.append(QDir::separator());
return file_path;
Expand Down

0 comments on commit fa208c4

Please sign in to comment.