From 79a688a1e928817f3d95289e9afdd07f4b830b64 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Wed, 3 Jun 2009 13:46:58 +0200 Subject: fixed updating gui --- lib/MiddleWare/MiddleWare.cpp | 2 +- src/Daemon/CrashWatcher.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/MiddleWare/MiddleWare.cpp b/lib/MiddleWare/MiddleWare.cpp index 9d4262bd..9b4b0885 100644 --- a/lib/MiddleWare/MiddleWare.cpp +++ b/lib/MiddleWare/MiddleWare.cpp @@ -435,12 +435,12 @@ CMiddleWare::mw_result_t CMiddleWare::SaveDebugDumpToDatabase(const std::string& database->Insert(pUUID, pUID, pDebugDumpDir, pTime); row = database->GetUUIDData(pUUID, pUID); database->DisConnect(); + res = GetCrashInfo(pUUID, pUID, pCrashInfo); if (row.m_sReported == "1") { comm_layer_inner_debug("Crash is already reported"); return MW_REPORTED; } - res = GetCrashInfo(pUUID, pUID, pCrashInfo); if (row.m_sCount != "1") { comm_layer_inner_debug("Crash is in database already"); diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 9c95d380..113fc509 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -82,19 +82,26 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition, switch (res) { case CMiddleWare::MW_OK: + cc->Warning("New crash, saving..."); cc->m_pMW->RunActionsAndReporters(crashinfo[CD_MWDDD][CD_CONTENT]); /* send message to dbus */ cc->m_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]); break; + case CMiddleWare::MW_REPORTED: + case CMiddleWare::MW_OCCURED: + /* send message to dbus */ + cc->Warning("Already saved crash, deleting..."); + cc->m_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]); + cc->m_pMW->DeleteDebugDumpDir(std::string(DEBUG_DUMPS_DIR) + "/" + name); + break; case CMiddleWare::MW_BLACKLISTED: case CMiddleWare::MW_CORRUPTED: case CMiddleWare::MW_PACKAGE_ERROR: case CMiddleWare::MW_GPG_ERROR: - case CMiddleWare::MW_REPORTED: case CMiddleWare::MW_IN_DB: case CMiddleWare::MW_FILE_ERROR: default: - cc->Warning("Corrupted, bad or already saved crash, deleting"); + cc->Warning("Corrupted or bad crash, deleting..."); cc->m_pMW->DeleteDebugDumpDir(std::string(DEBUG_DUMPS_DIR) + "/" + name); break; } -- cgit