[PATCH] Use QDir::currentPath to get the current directory

Dirk Hohndel dirk at hohndel.org
Sun Oct 13 08:59:36 UTC 2013


I'm very suspicious of this change. I doubt this will work with installed binaries.

/D

Miika Turkia <miika.turkia at gmail.com> wrote:

>applicationDirPath() does not find the source directory (if build
>directory differs from source directory). Using currentPath() allows one
>to still run built Subsurface from the source directory and find e.g.
>xslt_path.
>---
> qt-gui.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/qt-gui.cpp b/qt-gui.cpp
>index 8a27b6e..8d67890 100644
>--- a/qt-gui.cpp
>+++ b/qt-gui.cpp
>@@ -390,7 +390,7 @@ QString getSubsurfaceDataPath(QString folderToFind)
> 
> 	// first check if we are running in the build dir, so this
> 	// is just subdirectory of the current directory
>-	execdir = QCoreApplication::applicationDirPath();
>+	execdir = QDir::currentPath();
> 	folder = QDir(execdir.append(QDir::separator()).append(folderToFind));
> 	if (folder.exists())
> 		return folder.absolutePath();
>-- 
>1.8.1.2
>
>_______________________________________________
>subsurface mailing list
>subsurface at hohndel.org
>http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


More information about the subsurface mailing list