From 465e7c252138ff8962d7272c0b29eca7657fe908 Mon Sep 17 00:00:00 2001 From: AlexApps99 Date: Mon, 2 Mar 2020 17:33:17 +1300 Subject: [PATCH] Used whole path instead of relative path --- .../Core/DolphinQt/GameList/GameListModel.cpp | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Source/Core/DolphinQt/GameList/GameListModel.cpp b/Source/Core/DolphinQt/GameList/GameListModel.cpp index fb5aa0020f..b14b6291f9 100644 --- a/Source/Core/DolphinQt/GameList/GameListModel.cpp +++ b/Source/Core/DolphinQt/GameList/GameListModel.cpp @@ -5,6 +5,7 @@ #include "DolphinQt/GameList/GameListModel.h" #include +#include #include #include "Core/ConfigManager.h" @@ -144,21 +145,10 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const case COL_FILE_PATH: if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole) { - QString file_path = QDir::cleanPath(QString::fromStdString(game.GetFilePath())); - for (QString dir : Settings::Instance().GetPaths()) - { - dir = QDir::cleanPath(dir); - if (file_path.startsWith(dir)) - { - int path_index = dir.lastIndexOf(QLatin1Char('/'), -2); - if (path_index > -1) - { - file_path = file_path.mid(path_index + 1); - break; - } - } - } - return QDir::toNativeSeparators(file_path); + QString file_path = QFileInfo(QString::fromStdString(game.GetFilePath())).canonicalPath(); + if (!file_path.endsWith(QDir::separator())) + file_path.append(QDir::separator()); + return file_path; } break; case COL_SIZE: