This commit is contained in:
jl777
2016-10-30 07:29:01 -03:00
parent 992b308b7d
commit dadaab0a4f

View File

@@ -401,19 +401,27 @@ void PrintExceptionContinue(const std::exception* pex, const char* pszThread)
} }
extern char ASSETCHAINS_SYMBOL[16]; extern char ASSETCHAINS_SYMBOL[16];
extern int32_t ASSETCHAINS_SHORTFLAG;
boost::filesystem::path GetDefaultDataDir() boost::filesystem::path GetDefaultDataDir()
{ {
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
char symbol[16];
if ( ASSETCHAINS_SYMBOL[0] != 0 )
{
if ( ASSETCHAINS_SHORTFLAG != 0 )
sprintf(symbol,"-%s",ASSETCHAINS_SYMBOL);
else strcpy(symbol,ASSETCHAINS_SYMBOL);
} else symbol[0] = 0;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Zcash // Windows < Vista: C:\Documents and Settings\Username\Application Data\Zcash
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Zcash // Windows >= Vista: C:\Users\Username\AppData\Roaming\Zcash
// Mac: ~/Library/Application Support/Zcash // Mac: ~/Library/Application Support/Zcash
// Unix: ~/.zcash // Unix: ~/.zcash
#ifdef WIN32 #ifdef WIN32
// Windows // Windows
if ( ASSETCHAINS_SYMBOL[0] == 0 ) if ( symbol[0] == 0 )
return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo"; return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo";
else return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo" / ASSETCHAINS_SYMBOL; else return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo" / symbol;
#else #else
fs::path pathRet; fs::path pathRet;
char* pszHome = getenv("HOME"); char* pszHome = getenv("HOME");
@@ -425,19 +433,19 @@ boost::filesystem::path GetDefaultDataDir()
// Mac // Mac
pathRet /= "Library/Application Support"; pathRet /= "Library/Application Support";
TryCreateDirectory(pathRet); TryCreateDirectory(pathRet);
if ( ASSETCHAINS_SYMBOL[0] == 0 ) if ( symbol[0] == 0 )
return pathRet / "Komodo"; return pathRet / "Komodo";
else else
{ {
pathRet /= "Komodo"; pathRet /= "Komodo";
TryCreateDirectory(pathRet); TryCreateDirectory(pathRet);
return pathRet / ASSETCHAINS_SYMBOL; return pathRet / symbol;
} }
#else #else
// Unix // Unix
if ( ASSETCHAINS_SYMBOL[0] == 0 ) if ( symbol[0] == 0 )
return pathRet / ".komodo"; return pathRet / ".komodo";
else return pathRet / ".komodo" / ASSETCHAINS_SYMBOL; else return pathRet / ".komodo" / symbol;
#endif #endif
#endif #endif
} }