diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-02-16 21:09:41 -0500 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-02-26 23:38:28 +0100 |
commit | 3f8cb2c565b24635d2967c9900cf5f2aa8b1d632 (patch) | |
tree | c29faa335bf501b123001ea80cf33e81c987ce11 /src/util.cpp | |
parent | 972060ce0e9746c979ce0ddeeb997121414c1d58 (diff) |
Reworked QT settings
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp index f1af91de27..88d70cd38f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -908,15 +908,28 @@ string GetConfigFile() return pathConfig.string(); } -void ReadConfigFile(map<string, string>& mapSettingsRet, +bool ReadConfigFile(map<string, string>& mapSettingsRet, map<string, vector<string> >& mapMultiSettingsRet) { namespace fs = boost::filesystem; namespace pod = boost::program_options::detail; + if (mapSettingsRet.count("-datadir")) + { + if (fs::is_directory(fs::system_complete(mapSettingsRet["-datadir"]))) + { + fs::path pathDataDir = fs::system_complete(mapSettingsRet["-datadir"]); + strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir)); + } + else + { + return false; + } + } + fs::ifstream streamConfig(GetConfigFile()); if (!streamConfig.good()) - return; + return true; // No bitcoin.conf file is OK set<string> setOptions; setOptions.insert("*"); @@ -933,6 +946,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet, } mapMultiSettingsRet[strKey].push_back(it->value[0]); } + return true; } string GetPidFile() |