summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-03-21 00:12:39 +0100
committerAl12rs <gabriel.cortesi@outlook.com>2018-03-21 00:12:39 +0100
commit92a8a3dce863c80f540537162e7c7e415cdfd57d (patch)
tree67c90174274461d73ee821a67c34a0db1488971c /src
parentbbce6506cdf15b5965e12ca2b10063fa8d3b85c0 (diff)
Fixed preview "file not found" error if the mod folder containing the file was on a different drive.
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 2bf25b05..f38ddf15 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -3938,7 +3938,9 @@ void MainWindow::previewDataFile()
// check if the file comes from the actual data folder instead of a mod
QDir gameDirectory = m_OrganizerCore.managedGame()->dataDirectory().absolutePath();
QString relativePath = gameDirectory.relativeFilePath(fileName);
- if (!relativePath.startsWith("..")) {
+ QDir direRelativePath = gameDirectory.relativeFilePath(fileName);
+ // if the file is on a different drive the dirRelativePath will actually be an absolute path so we make sure that is not the case
+ if (!direRelativePath.isAbsolute() && !relativePath.startsWith("..")) {
fileName = relativePath;
}
else {