From 13c9d2ad38da23ba39a56c5bd2b0c48e23b9f38a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 10 Dec 2013 07:29:06 +0100 Subject: Don't rely on current path when searching for support files The notion of current path changes as we open files in the file system. What we really want is the directory from where Subsurface was started. That covers both the case of Windows and running Subsurface from the install directory. This worked before because all support files were opened before the first user interaction. But opening the manual showed the flaw in the previous logic. Fixes #348 Signed-off-by: Dirk Hohndel --- qt-gui.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'qt-gui.cpp') diff --git a/qt-gui.cpp b/qt-gui.cpp index 0b80bb557..3cd35893a 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -394,9 +394,11 @@ QString getSubsurfaceDataPath(QString folderToFind) QString execdir; QDir folder; - // first check if we are running in the build dir, so this - // is just subdirectory of the current directory - execdir = QDir::currentPath(); + // first check if we are running in the build dir, so the path that we + // are looking for is just a subdirectory of the execution path; + // this also works on Windows as there we install the dirs + // under the application path + execdir = QCoreApplication::applicationDirPath(); folder = QDir(execdir.append(QDir::separator()).append(folderToFind)); if (folder.exists()) return folder.absolutePath(); -- cgit v1.2.3-70-g09d2