summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Daemon/CrashWatcher.cpp19
-rw-r--r--src/Daemon/CrashWatcher.h1
-rw-r--r--src/Daemon/DBusServerProxy.h23
3 files changed, 42 insertions, 1 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index c06ad01b..5eb77059 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -148,6 +148,8 @@ dbus_map_report_info_t CCrashWatcher::CreateReport(const std::string &pUUID,cons
{
m_pMW->CreateReport(pUUID,to_string(unix_uid), crashReport);
retval = crashReport.GetMap();
+ //send out the message about completed analyze
+ AnalyzeComplete(pUUID);
}
catch(std::string err)
{
@@ -167,7 +169,6 @@ bool CCrashWatcher::Report(dbus_map_report_info_t pReport)
// std::cerr << it->second << std::endl;
//}
crashReport.SetFromMap(pReport);
- std::cerr << crashReport.m_sPackage << std::endl;
try
{
m_pMW->Report(crashReport);
@@ -175,10 +176,26 @@ bool CCrashWatcher::Report(dbus_map_report_info_t pReport)
catch(std::string err)
{
std::cerr << err << std::endl;
+ return false;
}
return true;
}
+bool CCrashWatcher::DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender)
+{
+ unsigned long unix_uid = m_pConn->sender_unix_uid(pDBusSender.c_str());
+ try
+ {
+ //std::cerr << "DeleteDebugDump(" << pUUID << "," << unix_uid << ")" << std::endl;
+ m_pMW->DeleteDebugDump(pUUID,to_string(unix_uid));
+ }
+ catch(std::string err)
+ {
+ std::cerr << err << std::endl;
+ return false;
+ }
+ return true;
+}
void CCrashWatcher::Lock()
{
int lfp = open("crashcatcher.lock",O_RDWR|O_CREAT,0640);
diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h
index d1f08df0..dfe716fb 100644
--- a/src/Daemon/CrashWatcher.h
+++ b/src/Daemon/CrashWatcher.h
@@ -63,6 +63,7 @@ class CCrashWatcher
dbus_vector_map_crash_infos_t GetCrashInfosMap(const std::string &pDBusSender);
dbus_map_report_info_t CreateReport(const std::string &pUUID,const std::string &pDBusSender);
bool Report(dbus_map_report_info_t pReport);
+ bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender);
};
diff --git a/src/Daemon/DBusServerProxy.h b/src/Daemon/DBusServerProxy.h
index 8bb9b6bc..6a76f2c6 100644
--- a/src/Daemon/DBusServerProxy.h
+++ b/src/Daemon/DBusServerProxy.h
@@ -33,6 +33,7 @@ public:
register_method(CDBusServer_adaptor, GetCrashInfosMap, _GetCrashInfosMap_stub);
register_method(CDBusServer_adaptor, CreateReport, _CreateReport_stub);
register_method(CDBusServer_adaptor, Report, _Report_stub);
+ register_method(CDBusServer_adaptor, DeleteDebugDump, _DeleteDebugDump_stub);
}
/* reveal Interface introspection when we stabilize the API */
/*
@@ -90,11 +91,13 @@ public:
virtual dbus_vector_map_crash_infos_t GetCrashInfosMap(const std::string &pDBusSender) = 0;
virtual dbus_map_report_info_t CreateReport(const std::string &pUUID,const std::string &pDBusSender) = 0;
virtual bool Report(dbus_map_report_info_t pReport) = 0;
+ virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender) = 0;
public:
/* signal emitters for this interface
*/
+ /* Notify the clients (UI) about a new crash */
void Crash(const std::string& arg1)
{
::DBus::SignalMessage sig("Crash");
@@ -102,6 +105,14 @@ public:
wi << arg1;
emit_signal(sig);
}
+ /* Notify the clients that creating a report has finished */
+ void AnalyzeComplete(const std::string& arg1)
+ {
+ ::DBus::SignalMessage sig("AnalyzeComplete");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << arg1;
+ emit_signal(sig);
+ }
private:
@@ -155,5 +166,17 @@ private:
wi << argout1;
return reply;
}
+
+ DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call)
+ {
+ DBus::MessageIter ri = call.reader();
+
+ std::string argin1; ri >> argin1;
+ bool argout1 = DeleteDebugDump(argin1,call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << argout1;
+ return reply;
+ }
};