From e8f77eb967bbf82fcc91862c9a2f6c53b84b7dcf Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 12 Dec 2015 11:12:38 +0100 Subject: [PATCH] Changed: Check for alternative directories --HG-- branch : develop --- code/ryzom/client/src/client_cfg.cpp | 2 +- code/ryzom/client/src/init.cpp | 4 ++-- code/ryzom/client/src/login_patch.cpp | 14 +++++--------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 24c74ebe0..c16608eb7 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -2210,7 +2210,7 @@ bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const defaultConfigPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/"); #elif defined(NL_OS_UNIX) // if RYZOM_ETC_PREFIX is defined, client_default.cfg might be over there - if (!getRyzomEtcPrefix().empty()) defaultConfigPath = CPath::standardizePath(getRyzomEtcPrefix()); + defaultConfigPath = CPath::standardizePath(getRyzomEtcPrefix()); #else // some other prefix here :) #endif // NL_OS_UNIX diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 7882eee21..177330b40 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -675,7 +675,7 @@ void addSearchPaths(IProgressCallback &progress) #ifdef NL_OS_MAC defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); #elif defined(NL_OS_UNIX) - if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix()); + if (CFile::isDirectory(getRyzomSharePrefix()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix()); #endif // add in last position, a specific possibly read only directory @@ -720,7 +720,7 @@ void addPreDataPaths(NLMISC::IProgressCallback &progress) #ifdef NL_OS_MAC defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); #elif defined(NL_OS_UNIX) - if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix()); + if (CFile::isDirectory(getRyzomSharePrefix()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix()); #endif // add in last position, a specific possibly read only directory diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 906e2a367..b60fe084d 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -220,17 +220,13 @@ void CPatchManager::setClientRootPath(const std::string& clientRootPath) #ifdef NL_OS_MAC ReadableClientDataPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/data"); #elif defined(NL_OS_UNIX) - if (!getRyzomSharePrefix().empty()) - { - ReadableClientDataPath = CPath::standardizePath(getRyzomSharePrefix() + "/data"); - } - else - { - ReadableClientDataPath = WritableClientDataPath; - } + ReadableClientDataPath = CPath::standardizePath(getRyzomSharePrefix() + "/data"); + if (CFile::isDirectory(ReadableClientDataPath)) ReadableClientDataPath.clear() #else - ReadableClientDataPath = WritableClientDataPath; + ReadableClientDataPath.clear(); #endif + + if (ReadableClientDataPath.empty()) ReadableClientDataPath = WritableClientDataPath; } // ****************************************************************************