From: Arvin Schnell Date: Thu, 4 Oct 2012 13:45:43 +0000 (+0200) Subject: - send signal when snapshot metadata is modified X-Git-Tag: v0.1.3~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=956e92632d0b875d6298f777bcc01c7fa386bb5d;p=thirdparty%2Fsnapper.git - send signal when snapshot metadata is modified --- diff --git a/server/Client.cc b/server/Client.cc index 2115d5f7..1384c540 100644 --- a/server/Client.cc +++ b/server/Client.cc @@ -143,6 +143,11 @@ Client::introspect(DBus::Connection& conn, DBus::Message& msg) " \n" " \n" + " \n" + " \n" + " \n" + " \n" + " \n" " \n" " \n" @@ -378,6 +383,19 @@ Client::signal_snapshot_created(DBus::Connection& conn, const string& config_nam } +void +Client::signal_snapshot_modified(DBus::Connection& conn, const string& config_name, + unsigned int num) +{ + DBus::MessageSignal msg(PATH, INTERFACE, "SnapshotModified"); + + DBus::Hoho hoho(msg); + hoho << config_name << num; + + conn.send(msg); +} + + void Client::signal_snapshots_deleted(DBus::Connection& conn, const string& config_name, const list& nums) @@ -641,6 +659,8 @@ Client::set_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); conn.send(reply); + + signal_snapshot_modified(conn, config_name, snap->getNum()); } diff --git a/server/Client.h b/server/Client.h index 1ed8697f..6715a1d3 100644 --- a/server/Client.h +++ b/server/Client.h @@ -75,6 +75,8 @@ public: void signal_config_deleted(DBus::Connection& conn, const string& config_name); void signal_snapshot_created(DBus::Connection& conn, const string& config_name, unsigned int num); + void signal_snapshot_modified(DBus::Connection& conn, const string& config_name, + unsigned int num); void signal_snapshots_deleted(DBus::Connection& conn, const string& config_name, const list& nums);