Re: [PATCH v2 2/2] modem-manager: workaround issue in 'GDBusObjectManagerClient'



On Fri, 2013-02-08 at 08:42 +0100, Aleksander Morgado wrote:
> The 'GDBusObjectManagerClient' won't signal added or removed objects when it
> was created but no name owner was available in the bus. We can still use it for
> name-owner changes, but in order to have added/removed object signals, we'll
> need to re-create the whole 'MMManager' when we know the service came alive in
> the bus.
> 
> See GLib/GIO/GDBus bug:
>    https://bugzilla.gnome.org/show_bug.cgi?id=693285

Applied, thanks.

Dan

> ---
>  src/modem-manager/nm-modem-manager.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c
> index 4669fd3..fc5ebfd 100644
> --- a/src/modem-manager/nm-modem-manager.c
> +++ b/src/modem-manager/nm-modem-manager.c
> @@ -540,6 +540,7 @@ modem_manager_1_available (NMModemManager *self)
> 
>  static void schedule_modem_manager_1_relaunch (NMModemManager *self,
>                                                 guint n_seconds);
> +static void ensure_client                     (NMModemManager *self);
> 
>  static void
>  modem_manager_1_name_owner_changed (MMManager *modem_manager_1,
> @@ -563,7 +564,18 @@ modem_manager_1_name_owner_changed (MMManager *modem_manager_1,
> 
>  	/* Available! */
>  	g_free (name_owner);
> -	modem_manager_1_available (self);
> +
> +	/* Hack alert: GDBusObjectManagerClient won't signal neither 'object-added'
> +	 * nor 'object-removed' if it was created while there was no ModemManager in
> +	 * the bus. This hack avoids this issue until we get a GIO with the fix
> +	 * included... */
> +	modem_manager_1_clear_signals (self);
> +	g_clear_object (&self->priv->modem_manager_1);
> +	ensure_client (self);
> +
> +	/* Whenever GDBusObjectManagerClient is fixed, we can just do the following:
> +	 * modem_manager_1_available (self);
> +	 */
>  }
> 
>  static void
> --
> 1.8.1
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]