if (g_strcmp0 (method_name, "RegisterDocument") == 0) {
EvDoc *doc;
const gchar *uri;
- const gchar *owner = NULL;
g_variant_get (parameters, "(&s)", &uri);
doc = ev_daemon_find_doc (uri);
- if (doc) {
- /* Already registered */
- owner = doc->dbus_name;
- } else {
+ if (doc == NULL) {
ev_daemon_stop_killtimer ();
doc = g_new (EvDoc, 1);
}
g_dbus_method_invocation_return_value (invocation,
- g_variant_new_string (owner));
+ g_variant_new ("(s)", doc->dbus_name));
return;
} else if (g_strcmp0 (method_name, "UnregisterDocument") == 0) {
guint registration_id, owner_id;
GDBusNodeInfo *introspection_data;
+ g_set_prgname ("evince-daemon");
+
g_type_init ();
connection = g_bus_get_sync (G_BUS_TYPE_STARTER, NULL, &error);