From d71fe39576ded4e9567f5f938e9ef67183bb8afd Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 16 Apr 2009 15:19:21 +0200 Subject: simple report can be activated immediately after a crash occurs --- lib/MiddleWare/MiddleWare.cpp | 19 +++++++++++++++++++ lib/MiddleWare/MiddleWare.h | 3 +++ lib/Plugins/Mailx.cpp | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/MiddleWare/MiddleWare.cpp b/lib/MiddleWare/MiddleWare.cpp index d2d12a0..e1e679a 100644 --- a/lib/MiddleWare/MiddleWare.cpp +++ b/lib/MiddleWare/MiddleWare.cpp @@ -173,6 +173,20 @@ void CMiddleWare::CreateCrashReport(const std::string& pUUID, add_crash_data_to_crash_report(pCrashReport, CD_REPRODUCE, CD_TXT, CD_ISEDITABLE, "1.\n2.\n3.\n"); } +void CMiddleWare::Report(const std::string& pDebugDumpDir) +{ + map_crash_report_t crashReport; + + DebugDumpToCrashReport(pDebugDumpDir, crashReport); + + set_reporters_t::iterator it_r; + for (it_r = m_setReporters.begin(); it_r != m_setReporters.end(); it_r++) + { + CReporter* reporter = m_pPluginManager->GetReporter(*it_r); + reporter->Report(crashReport); + } +} + void CMiddleWare::Report(const map_crash_report_t& pCrashReport) { if (pCrashReport.find(CD_MWANALYZER) == pCrashReport.end() || @@ -488,3 +502,8 @@ void CMiddleWare::AddAnalyzerAction(const std::string& pAnalyzer, { m_mapAnalyzerActions[pAnalyzer].insert(make_pair(pAction, pArgs)); } + +void CMiddleWare::AddReporter(const std::string& pReporter) +{ + m_setReporters.insert(pReporter); +} diff --git a/lib/MiddleWare/MiddleWare.h b/lib/MiddleWare/MiddleWare.h index 86db708..28afb2a 100644 --- a/lib/MiddleWare/MiddleWare.h +++ b/lib/MiddleWare/MiddleWare.h @@ -45,6 +45,7 @@ class CMiddleWare std::string m_sDatabase; map_reporter_associations_t m_mapAnalyzerReporters; map_action_associations_t m_mapAnalyzerActions; + set_reporters_t m_setReporters; bool m_bOpenGPGCheck; @@ -79,6 +80,7 @@ class CMiddleWare const std::string& pUID, map_crash_report_t& pCrashReport); + void Report(const std::string& pDebugDumpDir); void Report(const map_crash_report_t& pCrashReport); void DeleteDebugDumpDir(const std::string& pDebugDumpDir); void DeleteCrashInfo(const std::string& pUUID, @@ -100,6 +102,7 @@ class CMiddleWare void AddAnalyzerAction(const std::string& pAnalyzer, const std::string& pAction, const std::string& pArgs); + void AddReporter(const std::string& pReporter); }; #endif /*MIDDLEWARE_H_*/ diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index 72d5cb7..8aacef3 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -140,6 +140,6 @@ void CMailx::LoadSettings(const std::string& pPath) } if (settings.find("SendBinaryData")!= settings.end()) { - m_bSendBinaryData = settings["SendBinaryData"] == "no"; + m_bSendBinaryData = settings["SendBinaryData"] == "yes"; } } -- cgit