summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-19 21:02:05 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-19 21:02:05 +0100
commit9edadbfa15ed05a3e48158aad89e438a6f9a9e50 (patch)
tree225a0f3420b84a6097f11dd6351e83d14e10053b
parentc781b46915c73f8f7b12efddd0357930eb1df8bb (diff)
downloadabrt-9edadbfa15ed05a3e48158aad89e438a6f9a9e50.tar.gz
abrt-9edadbfa15ed05a3e48158aad89e438a6f9a9e50.tar.xz
abrt-9edadbfa15ed05a3e48158aad89e438a6f9a9e50.zip
use get_crash_data_item_content() more widely. -4k.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--lib/Plugins/Bugzilla.cpp14
-rw-r--r--lib/Plugins/Catcut.cpp10
-rw-r--r--lib/Plugins/KerneloopsScanner.cpp5
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp2
-rw-r--r--src/Daemon/MiddleWare.cpp8
-rw-r--r--src/Daemon/Settings.cpp2
6 files changed, 20 insertions, 21 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index 5fdaa750..8a5a7978 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -283,11 +283,11 @@ uint32_t ctx::new_bug(const map_crash_data_t& pCrashData)
xmlrpc_env env;
xmlrpc_env_init(&env);
- std::string package = pCrashData.find(FILENAME_PACKAGE)->second[CD_CONTENT];
- std::string component = pCrashData.find(FILENAME_COMPONENT)->second[CD_CONTENT];
- std::string release = pCrashData.find(FILENAME_RELEASE)->second[CD_CONTENT];
- std::string arch = pCrashData.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT];
- std::string uuid = pCrashData.find(CD_UUID)->second[CD_CONTENT];
+ const std::string& package = get_crash_data_item_content(pCrashData, FILENAME_PACKAGE);
+ const std::string& component = get_crash_data_item_content(pCrashData, FILENAME_COMPONENT);
+ const std::string& release = get_crash_data_item_content(pCrashData, FILENAME_RELEASE);
+ const std::string& arch = get_crash_data_item_content(pCrashData, FILENAME_ARCHITECTURE);
+ const std::string& uuid = get_crash_data_item_content(pCrashData, CD_UUID);
std::string summary = "[abrt] crash in " + package;
std::string status_whiteboard = "abrt_hash:" + uuid;
@@ -433,8 +433,8 @@ std::string CReporterBugzilla::Report(const map_crash_data_t& pCrashData,
NoSSLVerify = m_bNoSSLVerify;
}
- std::string component = pCrashData.find(FILENAME_COMPONENT)->second[CD_CONTENT];
- std::string uuid = pCrashData.find(CD_UUID)->second[CD_CONTENT];
+ const std::string& component = get_crash_data_item_content(pCrashData, FILENAME_COMPONENT);
+ const std::string& uuid = get_crash_data_item_content(pCrashData, CD_UUID);
try
{
ctx bz_server(BugzillaXMLRPC.c_str(), NoSSLVerify);
diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp
index 73316e70..1bc51f97 100644
--- a/lib/Plugins/Catcut.cpp
+++ b/lib/Plugins/Catcut.cpp
@@ -268,11 +268,11 @@ ctx::new_bug(const char *auth_cookie, const map_crash_data_t& pCrashData)
xmlrpc_env env;
xmlrpc_env_init(&env);
- string package = pCrashData.find(FILENAME_PACKAGE)->second[CD_CONTENT];
- string component = pCrashData.find(FILENAME_COMPONENT)->second[CD_CONTENT];
- string release = pCrashData.find(FILENAME_RELEASE)->second[CD_CONTENT];
- string arch = pCrashData.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT];
- string uuid = pCrashData.find(CD_UUID)->second[CD_CONTENT];
+ const string& package = get_crash_data_item_content(pCrashData, FILENAME_PACKAGE);
+ const string& component = get_crash_data_item_content(pCrashData, FILENAME_COMPONENT);
+ const string& release = get_crash_data_item_content(pCrashData, FILENAME_RELEASE);
+ const string& arch = get_crash_data_item_content(pCrashData, FILENAME_ARCHITECTURE);
+ const string& uuid = get_crash_data_item_content(pCrashData, CD_UUID);
string summary = "[abrt] crash in " + package;
string status_whiteboard = "abrt_hash:" + uuid;
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp
index fe780a01..47043c25 100644
--- a/lib/Plugins/KerneloopsScanner.cpp
+++ b/lib/Plugins/KerneloopsScanner.cpp
@@ -52,8 +52,7 @@ void CKerneloopsScanner::Run(const char *pActionDir, const char *pArgs)
{
const char *syslog_file = "/var/log/messages";
map_plugin_settings_t::const_iterator it = m_pSettings.find("SysLogFile");
- if (it != m_pSettings.end())
- {
+ if (it != m_pSettings.end()) {
syslog_file = it->second.c_str();
}
@@ -203,4 +202,4 @@ void save_oops_to_debug_dump(CKerneloopsScanner *This)
This->SaveOopsToDebugDump();
}
-}
+} /* extern "C" */
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp
index 22d1bd0f..fef8c578 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -215,8 +215,8 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply)
}
map_crash_data_t::const_iterator it_comment = argin1.find(CD_COMMENT);
- map_crash_data_t::const_iterator it_reproduce = argin1.find(CD_REPRODUCE);
const char* comment = (it_comment != argin1.end()) ? it_comment->second[CD_CONTENT].c_str() : "";
+ map_crash_data_t::const_iterator it_reproduce = argin1.find(CD_REPRODUCE);
const char* reproduce = (it_reproduce != argin1.end()) ? it_reproduce->second[CD_CONTENT].c_str() : "";
const char* errmsg = NULL;
if (strlen(comment) > LIMIT_MESSAGE)
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index 50d0acae..4f24ee11 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -444,10 +444,10 @@ report_status_t Report(const map_crash_data_t& pCrashData,
throw CABRTException(EXCEP_ERROR, "Report(): Some of mandatory report data are missing.");
}
- std::string analyzer = pCrashData.find(CD_MWANALYZER)->second[CD_CONTENT];
- std::string UID = pCrashData.find(CD_MWUID)->second[CD_CONTENT];
- std::string UUID = pCrashData.find(CD_MWUUID)->second[CD_CONTENT];
- std::string packageNVR = pCrashData.find(FILENAME_PACKAGE)->second[CD_CONTENT];
+ const std::string& analyzer = get_crash_data_item_content(pCrashData, CD_MWANALYZER);
+ const std::string& UID = get_crash_data_item_content(pCrashData, CD_MWUID);
+ const std::string& UUID = get_crash_data_item_content(pCrashData, CD_MWUUID);
+ const std::string& packageNVR = get_crash_data_item_content(pCrashData, FILENAME_PACKAGE);
std::string packageName = packageNVR.substr(0, packageNVR.rfind("-", packageNVR.rfind("-") - 1));
// Save comment and "how to reproduce"
diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp
index 48658e28..73736f13 100644
--- a/src/Daemon/Settings.cpp
+++ b/src/Daemon/Settings.cpp
@@ -146,8 +146,8 @@ static vector_pair_string_string_t ParseListWithArgs(const char *pValue)
static void ParseCommon()
{
- map_string_t::const_iterator it = s_mapSectionCommon.find("OpenGPGCheck");
map_string_t::const_iterator end = s_mapSectionCommon.end();
+ map_string_t::const_iterator it = s_mapSectionCommon.find("OpenGPGCheck");
if (it != end)
{
g_settings_bOpenGPGCheck = string_to_bool(it->second.c_str());