[Spice-devel] [PATCH spice-gtk 23/34] build-sys: remove dbus option
Christophe Fergeau
cfergeau at redhat.com
Mon Jan 7 16:06:09 UTC 2019
On Mon, Jan 07, 2019 at 12:00:52PM +0400, marcandre.lureau at redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
>
> The desktop-integration code works by attempting to connect to GNOME
> Session Manager. If it is absent, it will print a "Warning no
> automount-inhibiting implementation available" message.
>
> Tested on win32 as well.
What happens on win32? Is it showing a warning which was not there
before?
Christophe
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> ---
> .gitlab-ci.yml | 4 +---
> configure.ac | 15 ---------------
> meson.build | 7 -------
> meson_options.txt | 5 -----
> src/desktop-integration.c | 18 +++---------------
> 5 files changed, 4 insertions(+), 45 deletions(-)
>
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 750e801..74280e9 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -38,14 +38,12 @@ makecheck_simple:
> --enable-pulse=no
> --enable-smartcard=no
> --enable-usbredir=no
> - --enable-dbus=no
> - make -j4
> - make check
>
> makecheck_simple-meson:
> script:
> - - meson build -Dauto_features=disabled
> - -Ddbus=false || (cat build/meson-logs/meson-log.txt && exit 1)
> + - meson build -Dauto_features=disabled || (cat build/meson-logs/meson-log.txt && exit 1)
> - ninja -C build
> - (cd build && meson test) || (cat build/meson-logs/testlog.txt && exit 1)
>
> diff --git a/configure.ac b/configure.ac
> index 70587ef..a23f861 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -476,20 +476,6 @@ AM_CONDITIONAL(WITH_VALA, [test "x$enable_vala" = "xyes"])
> VAPIDIR="${datadir}/vala/vapi"
> AC_SUBST(VAPIDIR)
>
> -AC_ARG_ENABLE([dbus],
> - AS_HELP_STRING([--enable-dbus=@<:@auto/yes/no@:>@],
> - [Enable dbus support for desktop integration (disabling automount) @<:@default=auto@:>@]),
> - [],
> - [enable_dbus="auto"])
> -
> -have_dbus=no
> -if test "x$enable_dbus" != "xno"; then
> - AC_DEFINE([USE_GDBUS], [1], [Define if supporting gdbus])
> - have_dbus=yes
> -else
> - SPICE_WARNING([No D-Bus support, desktop integration and USB redirection may not work properly])
> -fi
> -
> AC_ARG_ENABLE([alignment-checks],
> AS_HELP_STRING([--enable-alignment-checks],
> [Enable runtime checks for cast alignment @<:@default=no@:>@]),
> @@ -556,7 +542,6 @@ AC_MSG_NOTICE([
> SASL support: ${have_sasl}
> Smartcard support: ${have_smartcard}
> USB redirection support: ${have_usbredir} ${with_usbredir_hotplug}
> - DBus: ${have_dbus}
> WebDAV support: ${have_phodav}
> LZ4 support: ${have_lz4}
>
> diff --git a/meson.build b/meson.build
> index 26d19ed..cb37056 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -278,13 +278,6 @@ if spice_gtk_has_introspection and get_option('vapi')
> spice_gtk_has_vala = true
> endif
>
> -# dbus
> -if get_option('dbus')
> - spice_gtk_config_data.set('USE_GDBUS', '1')
> -else
> - warning('No D-Bus support, desktop integration and USB redirection may not work properly')
> -endif
> -
> # lz4
> spice_gtk_has_lz4 = false
> d = dependency('liblz4', required : get_option('lz4'))
> diff --git a/meson_options.txt b/meson_options.txt
> index a3995f8..8dcded2 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -52,11 +52,6 @@ option('vapi',
> value : true,
> description: 'Check for vala requirements')
>
> -option('dbus',
> - type : 'boolean',
> - value : true,
> - description: 'Enable dbus support for desktop integration (disabling automount)')
> -
> option('alignment-checks',
> type : 'boolean',
> value : false,
> diff --git a/src/desktop-integration.c b/src/desktop-integration.c
> index 7c433bb..d5924c0 100644
> --- a/src/desktop-integration.c
> +++ b/src/desktop-integration.c
> @@ -31,11 +31,7 @@
> #define GNOME_SESSION_INHIBIT_AUTOMOUNT 16
>
> struct _SpiceDesktopIntegrationPrivate {
> -#if defined(USE_GDBUS)
> GDBusProxy *gnome_session_proxy;
> -#else
> - GObject *gnome_session_proxy; /* dummy */
> -#endif
> guint gnome_automount_inhibit_cookie;
> };
>
> @@ -55,12 +51,11 @@ static void handle_dbus_call_error(const char *call, GError **_error)
>
> static gboolean gnome_integration_init(SpiceDesktopIntegration *self)
> {
> - G_GNUC_UNUSED SpiceDesktopIntegrationPrivate *priv = self->priv;
> + SpiceDesktopIntegrationPrivate *priv = self->priv;
> GError *error = NULL;
> gboolean success = TRUE;
> -
> -#if defined(USE_GDBUS)
> gchar *name_owner = NULL;
> +
> priv->gnome_session_proxy =
> g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
> G_DBUS_PROXY_FLAGS_NONE,
> @@ -76,9 +71,6 @@ static gboolean gnome_integration_init(SpiceDesktopIntegration *self)
> success = FALSE;
> }
> g_free(name_owner);
> -#else
> - success = FALSE;
> -#endif
>
> if (error) {
> g_warning("Could not create org.gnome.SessionManager dbus proxy: %s",
> @@ -94,7 +86,7 @@ static void gnome_integration_inhibit_automount(SpiceDesktopIntegration *self)
> {
> SpiceDesktopIntegrationPrivate *priv = self->priv;
> GError *error = NULL;
> - G_GNUC_UNUSED const gchar *reason =
> + const gchar *reason =
> _("Automounting has been inhibited for USB auto-redirecting");
>
> if (!priv->gnome_session_proxy)
> @@ -102,7 +94,6 @@ static void gnome_integration_inhibit_automount(SpiceDesktopIntegration *self)
>
> g_return_if_fail(priv->gnome_automount_inhibit_cookie == 0);
>
> -#if defined(USE_GDBUS)
> GVariant *v = g_dbus_proxy_call_sync(priv->gnome_session_proxy,
> "Inhibit",
> g_variant_new("(susu)",
> @@ -115,7 +106,6 @@ static void gnome_integration_inhibit_automount(SpiceDesktopIntegration *self)
> g_variant_get(v, "(u)", &priv->gnome_automount_inhibit_cookie);
>
> g_clear_pointer(&v, g_variant_unref);
> -#endif
> if (error)
> handle_dbus_call_error("org.gnome.SessionManager.Inhibit", &error);
> }
> @@ -132,14 +122,12 @@ static void gnome_integration_uninhibit_automount(SpiceDesktopIntegration *self)
> if (priv->gnome_automount_inhibit_cookie == 0)
> return;
>
> -#if defined(USE_GDBUS)
> GVariant *v = g_dbus_proxy_call_sync(priv->gnome_session_proxy,
> "Uninhibit",
> g_variant_new("(u)",
> priv->gnome_automount_inhibit_cookie),
> G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
> g_clear_pointer(&v, g_variant_unref);
> -#endif
> if (error)
> handle_dbus_call_error("org.gnome.SessionManager.Uninhibit", &error);
>
> --
> 2.20.1.2.gb21ebb671b
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190107/d2e0bc2d/attachment.sig>
More information about the Spice-devel
mailing list