diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2015-10-04 00:55:50 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2015-10-04 00:55:50 +0100 |
commit | 4b9610cfab43d6e5c3bada19698f538f965e0b92 (patch) | |
tree | f647a0fb5be752a36353e1131952eb8329cdc822 | |
parent | 82fcb51078f44932f2d43b3af6b6f20d24fb8030 (diff) | |
download | glib-wip/ebassi/application-quit.tar.gz |
Add a Quit method to the Application interface(s)wip/ebassi/application-quit
Both org.freedesktop.Application and org.gtk.Application interfaces
should have a Quit method. We tie it to the GApplication::quit signal we
previously add.
-rw-r--r-- | gio/gapplicationimpl-dbus.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c index 94cf6ea26..f4bf2bb06 100644 --- a/gio/gapplicationimpl-dbus.c +++ b/gio/gapplicationimpl-dbus.c @@ -65,7 +65,10 @@ static const gchar org_gtk_Application_xml[] = "<arg type='a{sv}' name='platform-data' direction='in'/>" "<arg type='i' name='exit-status' direction='out'/>" "</method>" - "<property name='Busy' type='b' access='read'/>" + "<method name='Quit'>" + "<arg type='a{sv}' name='platform-data' direction='in'/>" + "</method>" + "<property name='Busy' type='b' access='read'/>" "</interface>" "</node>"; @@ -86,6 +89,9 @@ static const gchar org_freedesktop_Application_xml[] = "<arg type='av' name='parameter' direction='in'/>" "<arg type='a{sv}' name='platform-data' direction='in'/>" "</method>" + "<method name='Quit'>" + "<arg type='a{sv}' name='platform-data' direction='in'/>" + "</method>" "</interface>" "</node>"; @@ -300,6 +306,19 @@ g_application_impl_method_call (GDBusConnection *connection, g_dbus_method_invocation_return_value (invocation, NULL); } + else if (g_str_equal (method_name, "Quit")) + { + /* Completely the same for both freedesktop and gtk interfaces */ + + g_variant_get (parameters, "(@a{sv})", &platform_data); + + class->before_emit (impl->app, platform_data); + g_signal_emit_by_name (impl->app, "quit"); + class->after_emit (impl->app, platform_data); + g_variant_unref (platform_data); + + g_dbus_method_invocation_return_value (invocation, NULL); + } else g_assert_not_reached (); } |