diff options
author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-08-14 20:59:43 +0200 |
---|---|---|
committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-08-14 20:59:43 +0200 |
commit | 3c226c987f5015e8184bfc4293ee9f9b2f7b8f67 (patch) | |
tree | b2ec9e8f5ec3140008a15cccea4030c438dbe72e /src/Daemon/MiddleWare.cpp | |
parent | 15e44fefb8e0ce093e91bc0fd96302c6b77bf92a (diff) | |
download | abrt-3c226c987f5015e8184bfc4293ee9f9b2f7b8f67.tar.gz abrt-3c226c987f5015e8184bfc4293ee9f9b2f7b8f67.tar.xz abrt-3c226c987f5015e8184bfc4293ee9f9b2f7b8f67.zip |
added support for storing results from reporters (used from gui)
Diffstat (limited to 'src/Daemon/MiddleWare.cpp')
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 80380555..5591203b 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -247,9 +247,11 @@ void CMiddleWare::RunActionsAndReporters(const std::string& pDebugDumpDir) } } -void CMiddleWare::Report(const map_crash_report_t& pCrashReport, - const std::string& pUID) +CMiddleWare::report_status_t CMiddleWare::Report(const map_crash_report_t& pCrashReport, + const std::string& pUID) { + report_status_t ret; + std::string message; if (pCrashReport.find(CD_MWANALYZER) == pCrashReport.end() || pCrashReport.find(CD_MWUID) == pCrashReport.end() || pCrashReport.find(CD_MWUUID) == pCrashReport.end()) @@ -269,6 +271,8 @@ void CMiddleWare::Report(const map_crash_report_t& pCrashReport, { try { + std::string res; + if (m_pPluginManager->GetPluginType((*it_r).first) == REPORTER) { CReporter* reporter = m_pPluginManager->GetReporter((*it_r).first); @@ -290,26 +294,34 @@ void CMiddleWare::Report(const map_crash_report_t& pCrashReport, } } - reporter->Report(pCrashReport, (*it_r).second); + res = reporter->Report(pCrashReport, (*it_r).second); if (home != "") { reporter->SetSettings(oldSettings); } } + ret[(*it_r).first].push_back("1"); + ret[(*it_r).first].push_back(res); + message += res + "\n"; } catch (CABRTException& e) { + ret[(*it_r).first].push_back("0"); + ret[(*it_r).first].push_back(e.what()); comm_layer_inner_warning("CMiddleWare::Report(): " + e.what()); comm_layer_inner_status("Reporting via '"+(*it_r).first+"' was not successful: " + e.what()); } + } } CDatabase* database = m_pPluginManager->GetDatabase(m_sDatabase); database->Connect(); - database->SetReported(UUID, UID); + database->SetReported(UUID, UID, message); database->DisConnect(); + + return ret; } void CMiddleWare::DeleteDebugDumpDir(const std::string& pDebugDumpDir) @@ -564,6 +576,7 @@ CMiddleWare::mw_result_t CMiddleWare::GetCrashInfo(const std::string& pUUID, add_crash_data_to_crash_info(pCrashInfo, CD_COUNT, row.m_sCount); add_crash_data_to_crash_info(pCrashInfo, CD_TIME, row.m_sTime); add_crash_data_to_crash_info(pCrashInfo, CD_REPORTED, row.m_sReported); + add_crash_data_to_crash_info(pCrashInfo, CD_MESSAGE, row.m_sMessage); add_crash_data_to_crash_info(pCrashInfo, CD_MWDDD, row.m_sDebugDumpDir); return MW_OK; |