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.
diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c
index 94cf6ea..f4bf2bb 100644
--- a/gio/gapplicationimpl-dbus.c
+++ b/gio/gapplicationimpl-dbus.c
@@ -65,7 +65,10 @@
         "<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 @@
         "<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_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 ();
 }