2005-01-25 Dan Williams <dcbw@redhat.com>

* panel-applet/NMWirelessAppletDbus.c
		- (nmwa_dbus_filter): Fix dbus 0.23 ServiceOwnerChanged checks
			so we check for NM_DBUS_SERVICE rather than not for it

	* libnm_glib/libnm_glib.c
		- (libnm_glib_dbus_filter): Fix for dbus 0.23, trapping
			ServiceOwnerChanged signal


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@399 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2005-01-26 02:17:03 +00:00
parent 13325a091e
commit d37c03ec19
3 changed files with 46 additions and 2 deletions

View file

@ -1,3 +1,13 @@
2005-01-25 Dan Williams <dcbw@redhat.com>
* panel-applet/NMWirelessAppletDbus.c
- (nmwa_dbus_filter): Fix dbus 0.23 ServiceOwnerChanged checks
so we check for NM_DBUS_SERVICE rather than not for it
* libnm_glib/libnm_glib.c
- (libnm_glib_dbus_filter): Fix for dbus 0.23, trapping
ServiceOwnerChanged signal
2005-01-25 Dan Williams <dcbw@redhat.com>
* configure.in

View file

@ -195,7 +195,8 @@ static DBusHandlerResult libnm_glib_dbus_filter (DBusConnection *connection, DBu
dbus_connection_disconnect (ctx->dbus_con);
libnm_glib_schedule_dbus_watcher (ctx);
}
if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, "ServiceCreated"))
#if (DBUS_VERSION_MAJOR == 0 && DBUS_VERSION_MINOR == 22)
else if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, "ServiceCreated"))
{
char *service;
@ -217,6 +218,39 @@ static DBusHandlerResult libnm_glib_dbus_filter (DBusConnection *connection, DBu
ctx->nm_status = LIBNM_NO_NETWORKMANAGER;
}
}
#elif (DBUS_VERSION_MAJOR == 0 && DBUS_VERSION_MINOR == 23)
else if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, "ServiceOwnerChanged"))
{
/* New signal for dbus 0.23... */
char *service;
char *old_owner;
char *new_owner;
if ( dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &service,
DBUS_TYPE_STRING, &old_owner,
DBUS_TYPE_STRING, &new_owner,
DBUS_TYPE_INVALID))
{
if (strcmp (service, NM_DBUS_SERVICE) == 0)
{
gboolean old_owner_good = (old_owner && (strlen (old_owner) > 0));
gboolean new_owner_good = (new_owner && (strlen (new_owner) > 0));
if (!old_owner_good && new_owner_good) /* Equivalent to old ServiceCreated signal */
{
char *status_string = libnm_glib_get_nm_status (ctx->dbus_con);
libnm_glib_update_status (ctx, status_string);
g_free (status_string);
}
else if (old_owner_good && !new_owner_good) /* Equivalent to old ServiceDeleted signal */
ctx->nm_status = LIBNM_NO_NETWORKMANAGER;
}
}
}
#else
#error "Unrecognized version of DBUS."
#endif
else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive")
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive")
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating")

View file

@ -1104,7 +1104,7 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
gboolean old_owner_good = (old_owner && (strlen (old_owner) > 0));
gboolean new_owner_good = (new_owner && (strlen (new_owner) > 0));
if ( (strcmp (service, NM_DBUS_SERVICE))
if ( (strcmp (service, NM_DBUS_SERVICE) == 0)
&& (!old_owner_good && new_owner_good) /* Equivalent to old ServiceCreated signal */
&& (applet->applet_state == APPLET_STATE_NO_NM))
{