[patch] 'Start All Wireless Devices' bug fix
- From: Robert Love <rml novell com>
- To: networkmanager list <networkmanager-list gnome org>
- Subject: [patch] 'Start All Wireless Devices' bug fix
- Date: Sat, 25 Jun 2005 23:07:51 -0400
Loves,
The 'Start All Wireless Devices' right-click menu item currently seems
to do the same thing as its counterpart, 'Stop All Wireless Devices.'
Both send the setWirelessEnabled D-BUS signal, which invokes
src/nm-dbus-nm.c :: nm_dbus_set_wireless_enabled().
The nm_dbus_set_wireless_enabled() function does the same thing whether
or not the enabled attribute was set on the setWirelessEnabled signal.
It seems to only eventually work because it sets ->wireless_enabled to
the value of the enabled attribute. But it first downs all of the
wireless devices and so on, even if enabling.
What I _think_ we want (to be fair, I am not 100% sure of the intent of
this code) is to only down and disable the device if !enabled. But to
set ->wireless_enabled and call nm_policy_schedule_device_change_check()
either way. Attached patch does this.
Tested, and it seems to work.
Makes sense? If so, may I apply?
Robert Love
Index: src/nm-dbus-nm.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/nm-dbus-nm.c,v
retrieving revision 1.11
diff -u -u -r1.11 nm-dbus-nm.c
--- src/nm-dbus-nm.c 10 Jun 2005 03:13:27 -0000 1.11
+++ src/nm-dbus-nm.c 26 Jun 2005 02:55:06 -0000
@@ -345,17 +345,20 @@
{
gboolean enabled = FALSE;
DBusError err;
+ NMData *app_data;
g_return_val_if_fail (data && data->data && connection && message, NULL);
dbus_error_init (&err);
- if (dbus_message_get_args (message, &err, DBUS_TYPE_BOOLEAN, &enabled, DBUS_TYPE_INVALID))
+ if (!dbus_message_get_args (message, &err, DBUS_TYPE_BOOLEAN, &enabled, DBUS_TYPE_INVALID))
+ return NULL;
+
+ app_data = data->data;
+ app_data->wireless_enabled = enabled;
+
+ if (!enabled)
{
GSList *elt;
- NMData *app_data;
-
- app_data = data->data;
- app_data->wireless_enabled = enabled;
/* Physically down all wireless devices */
nm_lock_mutex (app_data->dev_list_mutex, __FUNCTION__);
@@ -369,8 +372,9 @@
}
}
nm_unlock_mutex (app_data->dev_list_mutex, __FUNCTION__);
- nm_policy_schedule_device_change_check (data->data);
}
+
+ nm_policy_schedule_device_change_check (data->data);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]