diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-10 14:25:40 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-10 14:25:40 +0100 |
commit | c0ee9dabb895e9079a6367a823187f9e687c3e4a (patch) | |
tree | 0c06abb4063c099918e641be9106fb16ee2665a6 /lib/Plugins/Logger.cpp | |
parent | 8ddd4fb2e18e4ae996907a930aaedb5ceea1b78b (diff) | |
download | abrt-c0ee9dabb895e9079a6367a823187f9e687c3e4a.tar.gz abrt-c0ee9dabb895e9079a6367a823187f9e687c3e4a.tar.xz abrt-c0ee9dabb895e9079a6367a823187f9e687c3e4a.zip |
remove getSettings from most plugins (inherited one is ok)
Also move parse_release() to abrtlib, it's shared among
Bugzilla and Catcut.
Tested Bugzilla and Catcut, both work.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Plugins/Logger.cpp')
-rw-r--r-- | lib/Plugins/Logger.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp index b2ac1ade..6babc732 100644 --- a/lib/Plugins/Logger.cpp +++ b/lib/Plugins/Logger.cpp @@ -19,9 +19,10 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "Logger.h" #include <fstream> #include <sstream> +#include "abrtlib.h" +#include "Logger.h" #include "DebugDump.h" #include "CommLayerInner.h" #include "ABRTException.h" @@ -33,23 +34,30 @@ CLogger::CLogger() : void CLogger::SetSettings(const map_plugin_settings_t& pSettings) { - if (pSettings.find("LogPath") != pSettings.end()) + m_pSettings = pSettings; + + map_plugin_settings_t::const_iterator end = pSettings.end(); + map_plugin_settings_t::const_iterator it; + it = pSettings.find("LogPath"); + if (it != end) { - m_sLogPath = pSettings.find("LogPath")->second; + m_sLogPath = it->second; } - if (pSettings.find("AppendLogs") != pSettings.end()) + it = pSettings.find("AppendLogs"); + if (it != end) { - m_bAppendLogs = pSettings.find("AppendLogs")->second == "yes"; + m_bAppendLogs = string_to_bool(it->second.c_str()); } } -const map_plugin_settings_t& CLogger::GetSettings() -{ - m_pSettings["LogPath"] = m_sLogPath; - m_pSettings["AppendLogs"] = m_bAppendLogs ? "yes" : "no"; - - return m_pSettings; -} +//ok to delete? +//const map_plugin_settings_t& CLogger::GetSettings() +//{ +// m_pSettings["LogPath"] = m_sLogPath; +// m_pSettings["AppendLogs"] = m_bAppendLogs ? "yes" : "no"; +// +// return m_pSettings; +//} std::string CLogger::Report(const map_crash_report_t& pCrashReport, const map_plugin_settings_t& pSettings, const std::string& pArgs) |