Changed: Check for alternative directories

This commit is contained in:
kervala 2015-12-12 11:12:38 +01:00
parent 8fc22c6c15
commit 4a0ed5acef
3 changed files with 8 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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;
}
// ****************************************************************************