From 90c0d15d201c7d846db60314db2c91ed57e53828 Mon Sep 17 00:00:00 2001 From: Andreas Stallinger Date: Tue, 8 Mar 2016 13:01:00 +0100 Subject: [PATCH] src: move set app path to linux includes --- script/setup.sh | 5 ++++- src/app/main.cpp | 4 ---- src/lib_gui/platform_includes/includesLinux.h | 8 +++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/script/setup.sh b/script/setup.sh index 25a0851b..7d8775c7 100755 --- a/script/setup.sh +++ b/script/setup.sh @@ -53,7 +53,10 @@ if [ $PLATFORM == "Windows" ]; then cmd //c 'mklink /d /j '.$MY_PATH.'\..\bin\app\Debug\user '.$MY_PATH.'\..\bin\app\user' & cmd //c 'mklink /d /j '.$MY_PATH.'\..\bin\app\Release\data '.$MY_PATH.'\..\bin\app\data' & cmd //c 'mklink /d /j '.$MY_PATH.'\..\bin\app\Release\user '.$MY_PATH.'\..\bin\app\user' & - +elif [ $PLATFORM == "Linux" ]; then + echo -e $INFO "create symbolic links for data" + ln -s bin/app/data bin/app/Release/data + ln -s bin/app/data bin/app/Debug/data fi # Setup both Debug and Release configuration diff --git a/src/app/main.cpp b/src/app/main.cpp index 045bb00e..f7d4ef8a 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -35,10 +35,6 @@ void init() void prepare(int argc, char *argv[]) { - if (AppPath::getAppPath().empty()) - { - AppPath::setAppPath(QCoreApplication::applicationDirPath().toStdString() + "/"); - } setup(argc, argv); init(); diff --git a/src/lib_gui/platform_includes/includesLinux.h b/src/lib_gui/platform_includes/includesLinux.h index 45db9064..4036c22f 100644 --- a/src/lib_gui/platform_includes/includesLinux.h +++ b/src/lib_gui/platform_includes/includesLinux.h @@ -1,6 +1,7 @@ #ifndef INCLUDES_DEFAULT_H #define INCLUDES_DEFAULT_H +#include #include "utility/AppPath.h" #include "utility/UserPaths.h" #include "utility/file/FilePath.h" @@ -9,7 +10,12 @@ void setup(int argc, char *argv[]) { - std::string userdir(std::getenv("HOME")); + if (AppPath::getAppPath().empty()) + { + AppPath::setAppPath(QCoreApplication::applicationDirPath().toStdString() + "/"); + } + + std::string userdir(std::getenv("HOME")); if(isTrial()) { userdir.append("/.config/coatitrial/");