mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 02:32:11 +01:00
Add a Quit method to the Application interface(s)
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.
This commit is contained in:
parent
82fcb51078
commit
4b9610cfab
@ -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>";
|
||||
|
||||
@ -298,6 +304,19 @@ g_application_impl_method_call (GDBusConnection *connection,
|
||||
|
||||
g_variant_unref (platform_data);
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user