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

Miika Turkia miika.turkia at gmail.com
Sun Oct 13 09:15:50 UTC 2013


The installed binary case is handled later in the function. The first check
is purely for checking if called from source/build directory.

miika

On Sun, Oct 13, 2013 at 6:59 PM, Dirk Hohndel <dirk at hohndel.org> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131013/0f7c76af/attachment.html>


More information about the subsurface mailing list