mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-26 02:48:31 +01:00
More fixes 3
This commit is contained in:
parent
2056eae139
commit
5fedda08d7
@ -8,7 +8,7 @@ void ConfigManager::setPath(std::string file) {
|
|||||||
path = file;
|
path = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigManager::load(json default, bool lock) {
|
void ConfigManager::load(json def, bool lock) {
|
||||||
if (lock) { mtx.lock(); }
|
if (lock) { mtx.lock(); }
|
||||||
if (path == "") {
|
if (path == "") {
|
||||||
spdlog::error("Config manager tried to load file with no path specified");
|
spdlog::error("Config manager tried to load file with no path specified");
|
||||||
@ -16,7 +16,7 @@ void ConfigManager::load(json default, bool lock) {
|
|||||||
}
|
}
|
||||||
if (!std::filesystem::exists(path)) {
|
if (!std::filesystem::exists(path)) {
|
||||||
spdlog::warn("Config file '{0}' does not exist, creating it", path);
|
spdlog::warn("Config file '{0}' does not exist, creating it", path);
|
||||||
conf = default;
|
conf = def;
|
||||||
save(false);
|
save(false);
|
||||||
}
|
}
|
||||||
if (!std::filesystem::is_regular_file(path)) {
|
if (!std::filesystem::is_regular_file(path)) {
|
||||||
|
@ -27,7 +27,7 @@ class ConfigManager {
|
|||||||
public:
|
public:
|
||||||
ConfigManager();
|
ConfigManager();
|
||||||
void setPath(std::string file);
|
void setPath(std::string file);
|
||||||
void load(json default, bool lock = true);
|
void load(json def, bool lock = true);
|
||||||
void save(bool lock = true);
|
void save(bool lock = true);
|
||||||
void enableAutoSave();
|
void enableAutoSave();
|
||||||
void disableAutoSave();
|
void disableAutoSave();
|
||||||
|
Loading…
Reference in New Issue
Block a user