From 64c5d35aebc38f93ce5c086c15c15de5acb21b2f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 5 Nov 2009 17:21:11 +0100 Subject: InformAllUsers support. enabled by default for Kerneloops. Tested wuth CCpp. Signed-off-by: Denys Vlasenko --- lib/Plugins/KerneloopsReporter.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/Plugins/KerneloopsReporter.cpp') diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp index c57a1ef8..712adf0f 100644 --- a/lib/Plugins/KerneloopsReporter.cpp +++ b/lib/Plugins/KerneloopsReporter.cpp @@ -98,12 +98,10 @@ std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs) { int ret = -1; - map_crash_report_t::const_iterator it; update_client(_("Creating and submitting a report...")); - it = pCrashReport.begin(); - it = pCrashReport.find(FILENAME_KERNELOOPS); + map_crash_report_t::const_iterator it = pCrashReport.find(FILENAME_KERNELOOPS); if (it != pCrashReport.end()) { ret = http_post_to_kerneloops_site( m_sSubmitURL.c_str(), @@ -111,19 +109,18 @@ std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport, ); } - if (ret) - { + if (ret) { /* FIXME: be more informative */ - throw CABRTException(EXCEP_PLUGIN, std::string("CKerneloopsReporter::Report(): Report has not been sent...")); + throw CABRTException(EXCEP_PLUGIN, std::string("CKerneloopsReporter::Report(): Report has not been sent...")); } return "Kernel oops report was uploaded to: " + m_sSubmitURL; } void CKerneloopsReporter::SetSettings(const map_plugin_settings_t& pSettings) { - if (pSettings.find("SubmitURL") != pSettings.end()) - { - m_sSubmitURL = pSettings.find("SubmitURL")->second; + map_plugin_settings_t::const_iterator it = pSettings.find("SubmitURL"); + if (it != pSettings.end()) { + m_sSubmitURL = it->second; } } -- cgit From 57039b590e4411606795893c90f9871e0412ca31 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 6 Nov 2009 18:26:42 +0100 Subject: give Plugin class a map_plugin_settings_t member This simplifies and unifies get/set settings ops Signed-off-by: Denys Vlasenko --- lib/Plugins/KerneloopsReporter.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/Plugins/KerneloopsReporter.cpp') diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp index 712adf0f..cfb4e050 100644 --- a/lib/Plugins/KerneloopsReporter.cpp +++ b/lib/Plugins/KerneloopsReporter.cpp @@ -124,13 +124,11 @@ void CKerneloopsReporter::SetSettings(const map_plugin_settings_t& pSettings) } } -map_plugin_settings_t CKerneloopsReporter::GetSettings() +const map_plugin_settings_t& CKerneloopsReporter::GetSettings() { - map_plugin_settings_t ret; + m_pSettings["SubmitURL"] = m_sSubmitURL; - ret["SubmitURL"] = m_sSubmitURL; - - return ret; + return m_pSettings; } PLUGIN_INFO(REPORTER, -- cgit From c0ee9dabb895e9079a6367a823187f9e687c3e4a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 10 Nov 2009 14:25:40 +0100 Subject: 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 --- lib/Plugins/KerneloopsReporter.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'lib/Plugins/KerneloopsReporter.cpp') diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp index cfb4e050..f7a6cbb8 100644 --- a/lib/Plugins/KerneloopsReporter.cpp +++ b/lib/Plugins/KerneloopsReporter.cpp @@ -118,18 +118,23 @@ std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport, void CKerneloopsReporter::SetSettings(const map_plugin_settings_t& pSettings) { - map_plugin_settings_t::const_iterator it = pSettings.find("SubmitURL"); - if (it != pSettings.end()) { + m_pSettings = pSettings; + + map_plugin_settings_t::const_iterator end = pSettings.end(); + map_plugin_settings_t::const_iterator it; + it = pSettings.find("SubmitURL"); + if (it != end) { m_sSubmitURL = it->second; } } -const map_plugin_settings_t& CKerneloopsReporter::GetSettings() -{ - m_pSettings["SubmitURL"] = m_sSubmitURL; - - return m_pSettings; -} +//ok to delete? +//const map_plugin_settings_t& CKerneloopsReporter::GetSettings() +//{ +// m_pSettings["SubmitURL"] = m_sSubmitURL; +// +// return m_pSettings; +//} PLUGIN_INFO(REPORTER, CKerneloopsReporter, -- cgit