summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-03-02 15:18:52 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2009-03-02 15:18:52 +0100
commitf98ee8ad41a9f9ebc8f2318a4bbf9ecfc01bc1ab (patch)
tree02b8f5bae86c0ac3b5e22708f637a9b77765810f
parenta83f30394c4d7790b574b66b8fa326430830d706 (diff)
downloadabrt-f98ee8ad41a9f9ebc8f2318a4bbf9ecfc01bc1ab.tar.gz
abrt-f98ee8ad41a9f9ebc8f2318a4bbf9ecfc01bc1ab.tar.xz
abrt-f98ee8ad41a9f9ebc8f2318a4bbf9ecfc01bc1ab.zip
Added new method DeleteDebugDump
Added new signal "AnalyzeComplete"
-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;
+ }
};