From b0d2f3c7f257be07bbf8af8e963335127ef43d65 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 9 Oct 2009 12:57:59 +0200 Subject: *: add "force" param to CreateReport dbus call. If !0, regenerates backtrace Signed-off-by: Denys Vlasenko --- lib/Plugins/CCpp.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index c054c78..a2665ed 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -578,7 +578,7 @@ static bool DebuginfoCheckPolkit(int uid) } -void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) +void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir, int force) { update_client(_("Starting report creation...")); @@ -588,18 +588,19 @@ void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) CDebugDump dd; dd.Open(pDebugDumpDir); - bool bt_exists = dd.Exist(FILENAME_BACKTRACE); - if (bt_exists) + if (!force) { - dd.Close(); /* do not keep dir locked longer than needed */ - return; /* already done */ + bool bt_exists = dd.Exist(FILENAME_BACKTRACE); + if (bt_exists) + { + return; /* backtrace already exists */ + } } dd.LoadText(FILENAME_PACKAGE, package); dd.LoadText(FILENAME_UID, UID); - dd.Close(); - + dd.Close(); /* do not keep dir locked longer than needed */ map_plugin_settings_t settings = GetSettings(); if (settings["InstallDebuginfo"] == "yes" && @@ -609,7 +610,7 @@ void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) } else { - warn_client(_("Skipping debuginfo installation")); + VERB1 log(_("Skipping debuginfo installation")); } GetBacktrace(pDebugDumpDir, backtrace); -- cgit