server should look for config in the profile() dir rather than the personal() dir. removed personal() since it is no longer used.
This commit is contained in:
parent
4c04f39685
commit
129e61a33a
|
@ -144,7 +144,7 @@ ServerApp::help()
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "If no configuration file pathname is provided then the first of the" << std::endl
|
<< "If no configuration file pathname is provided then the first of the" << std::endl
|
||||||
<< "following to load successfully sets the configuration:" << std::endl
|
<< "following to load successfully sets the configuration:" << std::endl
|
||||||
<< " " << PathUtilities::concat(DataDirectories::personal(), SYS_CONFIG_NAME) << std::endl
|
<< " " << PathUtilities::concat(DataDirectories::profile(), SYS_CONFIG_NAME) << std::endl
|
||||||
<< " " << PathUtilities::concat(DataDirectories::systemconfig(), SYS_CONFIG_NAME) << std::endl;
|
<< " " << PathUtilities::concat(DataDirectories::systemconfig(), SYS_CONFIG_NAME) << std::endl;
|
||||||
|
|
||||||
LOG((CLOG_PRINT "%s", buffer.str().c_str()));
|
LOG((CLOG_PRINT "%s", buffer.str().c_str()));
|
||||||
|
@ -182,8 +182,7 @@ ServerApp::loadConfig()
|
||||||
|
|
||||||
// load the default configuration if no explicit file given
|
// load the default configuration if no explicit file given
|
||||||
else {
|
else {
|
||||||
// get the user's home directory
|
String path = DataDirectories::profile();
|
||||||
String path = DataDirectories::personal();
|
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
// complete path
|
// complete path
|
||||||
path = PathUtilities::concat(path, USR_CONFIG_NAME);
|
path = PathUtilities::concat(path, USR_CONFIG_NAME);
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
class DataDirectories
|
class DataDirectories
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const std::string& personal();
|
|
||||||
static const std::string& personal(const std::string& path);
|
|
||||||
|
|
||||||
static const std::string& profile();
|
static const std::string& profile();
|
||||||
static const std::string& profile(const std::string& path);
|
static const std::string& profile(const std::string& path);
|
||||||
|
|
||||||
|
@ -21,7 +18,6 @@ private:
|
||||||
// static class
|
// static class
|
||||||
DataDirectories() {}
|
DataDirectories() {}
|
||||||
|
|
||||||
static std::string _personal;
|
|
||||||
static std::string _profile;
|
static std::string _profile;
|
||||||
static std::string _global;
|
static std::string _global;
|
||||||
static std::string _systemconfig;
|
static std::string _systemconfig;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#include "DataDirectories.h"
|
#include "DataDirectories.h"
|
||||||
|
|
||||||
// static member
|
// static member
|
||||||
std::string DataDirectories::_personal;
|
|
||||||
std::string DataDirectories::_profile;
|
std::string DataDirectories::_profile;
|
||||||
std::string DataDirectories::_global;
|
std::string DataDirectories::_global;
|
||||||
std::string DataDirectories::_systemconfig;
|
std::string DataDirectories::_systemconfig;
|
||||||
|
|
|
@ -44,22 +44,10 @@ static std::string unix_home()
|
||||||
|
|
||||||
#endif // HAVE_GETPWUID_R
|
#endif // HAVE_GETPWUID_R
|
||||||
|
|
||||||
const std::string& DataDirectories::personal()
|
|
||||||
{
|
|
||||||
if (_personal.empty())
|
|
||||||
_personal = unix_home();
|
|
||||||
return _personal;
|
|
||||||
}
|
|
||||||
const std::string& DataDirectories::personal(const std::string& path)
|
|
||||||
{
|
|
||||||
_personal = path;
|
|
||||||
return _personal;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& DataDirectories::profile()
|
const std::string& DataDirectories::profile()
|
||||||
{
|
{
|
||||||
if (_profile.empty())
|
if (_profile.empty())
|
||||||
_profile = personal() + ProfileSubdir;
|
_profile = unix_home() + ProfileSubdir;
|
||||||
return _profile;
|
return _profile;
|
||||||
}
|
}
|
||||||
const std::string& DataDirectories::profile(const std::string& path)
|
const std::string& DataDirectories::profile(const std::string& path)
|
||||||
|
|
|
@ -23,18 +23,6 @@ std::string known_folder_path(const KNOWNFOLDERID& id)
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& DataDirectories::personal()
|
|
||||||
{
|
|
||||||
if (_personal.empty())
|
|
||||||
_personal = known_folder_path(FOLDERID_Documents);
|
|
||||||
return _personal;
|
|
||||||
}
|
|
||||||
const std::string& DataDirectories::personal(const std::string& path)
|
|
||||||
{
|
|
||||||
_personal = path;
|
|
||||||
return _personal;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& DataDirectories::profile()
|
const std::string& DataDirectories::profile()
|
||||||
{
|
{
|
||||||
if (_profile.empty())
|
if (_profile.empty())
|
||||||
|
|
Loading…
Reference in New Issue