From: Arvin Schnell Date: Tue, 10 Jul 2012 13:55:58 +0000 (+0200) Subject: - work on dbus interface X-Git-Tag: v0.1.3~212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00cf5a564d42265c38adeec181d9ed6cc9511d44;p=thirdparty%2Fsnapper.git - work on dbus interface --- diff --git a/server/snapperd.cc b/server/snapperd.cc index c3b69d64..01c02f4a 100644 --- a/server/snapperd.cc +++ b/server/snapperd.cc @@ -1262,10 +1262,12 @@ dispatch(DBus::Connection& conn, DBus::Message& msg) void listen(DBus::Connection& conn) { - y2mil("Listening for method calls and signals"); + y2mil("Requesting DBus name"); conn.request_name("org.opensuse.snapper", DBUS_NAME_FLAG_REPLACE_EXISTING); + y2mil("Listening for method calls and signals"); + conn.add_match("type='signal', interface='" DBUS_INTERFACE_DBUS "', member='NameOwnerChanged'"); int idle = 0; @@ -1341,10 +1343,22 @@ listen(DBus::Connection& conn) } +void +log_do(LogLevel level, const string& component, const char* file, const int line, const char* func, + const string& text) +{ + cerr << text << endl; +} + + int main(int argc, char** argv) { +#if 0 initDefaultLogger(); +#else + setLogDo(&log_do); +#endif DBus::Connection conn(DBUS_BUS_SYSTEM);