diff options
-rw-r--r-- | src/Daemon/Settings.cpp | 32 | ||||
-rw-r--r-- | src/Daemon/Settings.h | 3 |
2 files changed, 34 insertions, 1 deletions
diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp index 83aad1e9..fd377e3b 100644 --- a/src/Daemon/Settings.cpp +++ b/src/Daemon/Settings.cpp @@ -23,7 +23,6 @@ static map_settings_t s_mapSettingsCommon; static map_settings_t s_mapSettingsAnalyzerActionsAndReporters; static map_settings_t s_mapSettingsCron; - static set_strings_t ParseList(const std::string& pList) { unsigned int ii; @@ -391,3 +390,34 @@ void SaveSettings(const char* pPath) fOut.close(); } } + +void SetSettings(const map_abrt_settings_t& pSettings) +{ + if (pSettings.find(SECTION_COMMON) != pSettings.end()) + { + s_mapSettingsCommon = pSettings.find(SECTION_COMMON)->second; + ParseCommon(); + } + if (pSettings.find(SECTION_ANALYZER_ACTIONS_AND_REPORTERS) != pSettings.end()) + { + s_mapSettingsAnalyzerActionsAndReporters = pSettings.find(SECTION_ANALYZER_ACTIONS_AND_REPORTERS)->second; + ParseAnalyzerActionsAndReporters(); + } + if (pSettings.find(SECTION_CRON) != pSettings.end()) + { + s_mapSettingsCron = pSettings.find(SECTION_CRON)->second; + ParseCron(); + } +} + +map_abrt_settings_t GetSettings() +{ + map_abrt_settings_t ABRTSettings; + + ABRTSettings[SECTION_COMMON] = s_mapSettingsCommon; + ABRTSettings[SECTION_ANALYZER_ACTIONS_AND_REPORTERS] = s_mapSettingsAnalyzerActionsAndReporters; + ABRTSettings[SECTION_CRON] = s_mapSettingsCron; + + return ABRTSettings; +} + diff --git a/src/Daemon/Settings.h b/src/Daemon/Settings.h index d80bed04..d5fd36df 100644 --- a/src/Daemon/Settings.h +++ b/src/Daemon/Settings.h @@ -5,9 +5,12 @@ typedef map_vector_pair_string_string_t map_analyzer_actions_and_reporters_t; typedef map_vector_pair_string_string_t map_cron_t; +typedef std::map<std::string, std::map<std::string, std::string> > map_abrt_settings_t; void LoadSettings(const char* pPath); void SaveSettings(const char* pPath); +void SetSettings(const map_abrt_settings_t& pSettings); +map_abrt_settings_t GetSettings(); extern set_strings_t g_settings_setOpenGPGPublicKeys; extern set_strings_t g_settings_mapSettingsBlackList; |