From 92a8a3dce863c80f540537162e7c7e415cdfd57d Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 21 Mar 2018 00:12:39 +0100 Subject: Fixed preview "file not found" error if the mod folder containing the file was on a different drive. --- src/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') 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 { -- cgit v1.3.1