Changed: Check for alternative directories

--HG--
branch : develop
This commit is contained in:
kervala 2015-12-12 11:12:38 +01:00
parent fdbaab6a38
commit e8f77eb967
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/"); defaultConfigPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/");
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)
// if RYZOM_ETC_PREFIX is defined, client_default.cfg might be over there // 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 #else
// some other prefix here :) // some other prefix here :)
#endif // NL_OS_UNIX #endif // NL_OS_UNIX

View file

@ -675,7 +675,7 @@ void addSearchPaths(IProgressCallback &progress)
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources");
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)
if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix()); if (CFile::isDirectory(getRyzomSharePrefix()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix());
#endif #endif
// add in last position, a specific possibly read only directory // add in last position, a specific possibly read only directory
@ -720,7 +720,7 @@ void addPreDataPaths(NLMISC::IProgressCallback &progress)
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources");
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)
if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix()); if (CFile::isDirectory(getRyzomSharePrefix()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix());
#endif #endif
// add in last position, a specific possibly read only directory // 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 #ifdef NL_OS_MAC
ReadableClientDataPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/data"); ReadableClientDataPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/data");
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)
if (!getRyzomSharePrefix().empty()) ReadableClientDataPath = CPath::standardizePath(getRyzomSharePrefix() + "/data");
{ if (CFile::isDirectory(ReadableClientDataPath)) ReadableClientDataPath.clear()
ReadableClientDataPath = CPath::standardizePath(getRyzomSharePrefix() + "/data");
}
else
{
ReadableClientDataPath = WritableClientDataPath;
}
#else #else
ReadableClientDataPath = WritableClientDataPath; ReadableClientDataPath.clear();
#endif #endif
if (ReadableClientDataPath.empty()) ReadableClientDataPath = WritableClientDataPath;
} }
// **************************************************************************** // ****************************************************************************