From 7759679ab1ed2916b2d5439ffa836491e9b8d4e7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 26 Jul 2014 13:57:07 +0400 Subject: [PATCH] using exe dir in debug and appdata dir in release in os x and linux --- Telegram/SourceFiles/logs.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 70ecef462b..b42f187cc7 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -120,9 +120,15 @@ void logsInit() { if (mainLogStream) return; QString wasDir = cWorkingDir(); -#if (defined Q_OS_MAC || defined Q_OS_LINUX) && !defined _DEBUG +#if (defined Q_OS_MAC || defined Q_OS_LINUX) + +#ifdef _DEBUG + cForceWorkingDir(cExeDir()); +#else cForceWorkingDir(psAppDataPath()); -#ifdef Q_OS_LINUX // fix first version +#endif + +#if (defined Q_OS_LINUX && !defined _DEBUG) // fix first version { QFile data(wasDir + "data"), dataConfig(wasDir + "data_config"), tdataConfig(wasDir + "tdata/config"); if (data.exists() && dataConfig.exists() && !QFileInfo(cWorkingDir() + "data").exists() && !QFileInfo(cWorkingDir() + "data_config").exists()) { // move to home dir