sn-watcher.c: Move invocation completion to the registration callback.
This should be called when the registration is actually finished.
Michael Webster
3 years ago
298 | 298 | typedef struct |
299 | 299 | { |
300 | 300 | XAppSnWatcher *watcher; |
301 | GDBusMethodInvocation *invocation; | |
301 | 302 | gchar *key; |
302 | 303 | gchar *path; |
303 | 304 | gchar *bus_name; |
337 | 338 | sn_watcher_interface_emit_status_notifier_item_registered (watcher->skeleton, |
338 | 339 | data->service); |
339 | 340 | |
341 | sn_watcher_interface_complete_register_status_notifier_item (watcher->skeleton, | |
342 | data->invocation); | |
343 | ||
340 | 344 | g_free (data->key); |
341 | 345 | g_free (data->path); |
342 | 346 | g_free (data->bus_name); |
343 | 347 | g_free (data->service); |
348 | g_object_unref (data->invocation); | |
344 | 349 | g_slice_free (NewSnProxyData, data); |
345 | 350 | } |
346 | 351 | |
381 | 386 | data->path = g_strdup (path); |
382 | 387 | data->bus_name = g_strdup (bus_name); |
383 | 388 | data->service = g_strdup (service); |
389 | data->invocation = g_object_ref (invocation); | |
384 | 390 | |
385 | 391 | sn_item_interface_proxy_new (watcher->connection, |
386 | 392 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, |
390 | 396 | sn_item_proxy_new_completed, |
391 | 397 | data); |
392 | 398 | } |
393 | ||
394 | sn_watcher_interface_complete_register_status_notifier_item (watcher->skeleton, | |
395 | invocation); | |
396 | 399 | |
397 | 400 | return TRUE; |
398 | 401 | } |