mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Used whole path instead of relative path
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
#include "DolphinQt/GameList/GameListModel.h"
|
#include "DolphinQt/GameList/GameListModel.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
@ -144,21 +145,10 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
|||||||
case COL_FILE_PATH:
|
case COL_FILE_PATH:
|
||||||
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
||||||
{
|
{
|
||||||
QString file_path = QDir::cleanPath(QString::fromStdString(game.GetFilePath()));
|
QString file_path = QFileInfo(QString::fromStdString(game.GetFilePath())).canonicalPath();
|
||||||
for (QString dir : Settings::Instance().GetPaths())
|
if (!file_path.endsWith(QDir::separator()))
|
||||||
{
|
file_path.append(QDir::separator());
|
||||||
dir = QDir::cleanPath(dir);
|
return file_path;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COL_SIZE:
|
case COL_SIZE:
|
||||||
|
Reference in New Issue
Block a user