implement interface remove

Clean up some g_print
This commit is contained in:
Wim Taymans 2015-05-21 10:18:21 +02:00
parent 4a61f988dc
commit e24398fe8c
6 changed files with 51 additions and 66 deletions

View file

@ -33,16 +33,14 @@ static void
subscription_cb (PvContext *context, PvSubscriptionEvent type, PvSubscriptionFlags flags,
GDBusProxy *object, gpointer user_data)
{
g_print ("got event %d %d %s:%s\n", type, flags,
g_dbus_proxy_get_name (object),
g_dbus_proxy_get_object_path (object));
switch (type) {
case PV_SUBSCRIPTION_EVENT_NEW:
g_print ("object added %s\n", g_dbus_proxy_get_object_path (object));
dump_object (object);
break;
case PV_SUBSCRIPTION_EVENT_CHANGE:
g_print ("object changed %s\n", g_dbus_proxy_get_object_path (object));
dump_object (object);
break;
@ -58,21 +56,17 @@ on_state_notify (GObject *gobject,
gpointer user_data)
{
PvContextState state;
PvContext *c = user_data;
g_object_get (gobject, "state", &state, NULL);
g_print ("got state %d\n", state);
g_print ("got context state %d\n", state);
switch (state) {
case PV_CONTEXT_STATE_ERROR:
g_main_loop_quit (loop);
break;
case PV_CONTEXT_STATE_READY:
{
g_object_set (c, "subscription-mask", PV_SUBSCRIPTION_FLAGS_ALL, NULL);
g_signal_connect (c, "subscription-event", (GCallback) subscription_cb, NULL);
break;
}
default:
break;
@ -90,6 +84,8 @@ main (gint argc, gchar *argv[])
c = pv_context_new (NULL, "test-client", NULL);
g_signal_connect (c, "notify::state", (GCallback) on_state_notify, c);
g_object_set (c, "subscription-mask", PV_SUBSCRIPTION_FLAGS_ALL, NULL);
g_signal_connect (c, "subscription-event", (GCallback) subscription_cb, NULL);
pv_context_connect(c, PV_CONTEXT_FLAGS_NOFAIL);
g_main_loop_run (loop);