[network-manager-netbook/MplPanelClient: 44/44] Rebase from master.
- From: Tambet Ingo <tambeti src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [network-manager-netbook/MplPanelClient: 44/44] Rebase from master.
- Date: Tue, 10 Nov 2009 14:13:24 +0000 (UTC)
commit 60e2ae7d3d2c8b2d0e575a4d0a4cbb8ac6cb8c42
Merge: ba86498... a0ae2ea...
Author: Tambet Ingo <tambet gmail com>
Date: Tue Nov 10 16:10:17 2009 +0200
Rebase from master.
src/nmn-wifi-handler.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
---
diff --cc src/nmn-wifi-handler.c
index 72db539,efac99c..5108171
--- a/src/nmn-wifi-handler.c
+++ b/src/nmn-wifi-handler.c
@@@ -115,34 -74,32 +115,32 @@@ find_best_ap_for_connection (NMDeviceWi
}
static void
-update_items (NmnWifiHandler *self)
+ap_updated (NMAccessPoint *ap,
+ GParamSpec *pspec,
+ gpointer user_data)
{
- GSList *list;
+ NmnDeviceHandler *handler = NMN_DEVICE_HANDLER (user_data);
+ GSList *items;
GSList *iter;
- NMDeviceWifi *device;
-
- device = NM_DEVICE_WIFI (nmn_device_handler_get_device (NMN_DEVICE_HANDLER (self)));
- list = nmn_device_handler_get_items (NMN_DEVICE_HANDLER (self));
- for (iter = list; iter; iter = iter->next) {
+ items = nmn_device_handler_get_items (handler);
+ for (iter = items; iter; iter = iter->next) {
NmnWifiItem *item = NMN_WIFI_ITEM (iter->data);
- NMAccessPoint *item_ap = nmn_wifi_item_get_ap (item);
- NMDeviceWifi *device;
- NMAccessPoint *new_ap;
+ NMAccessPoint *current_ap = nmn_wifi_item_get_ap (item);
+ NMAccessPoint *best_ap;
- /* Don't touch activated items, these are handled by active_ap_changed */
- if (nmn_network_item_get_status (NMN_NETWORK_ITEM (item)) != NMN_NETWORK_ITEM_STATUS_DISCONNECTED)
- continue;
+ best_ap = nm_device_wifi_get_active_access_point (device);
+ if (!best_ap) {
+ NMSettingsConnectionInterface *connection;
- /* not us */
- if (item_ap != ap && !aps_are_compatible (ap, item_ap))
- continue;
+ connection = nmn_network_item_get_connection (NMN_NETWORK_ITEM (item));
+ best_ap = find_best_ap_for_connection (device, NM_CONNECTION (connection));
+ }
- /* Do we have a better compatible AP for this item? */
- device = NM_DEVICE_WIFI (nmn_device_handler_get_device (handler));
- new_ap = find_best_compatible_ap (nm_device_wifi_get_access_points (device), item_ap);
- if (new_ap)
- nmn_wifi_item_set_ap (item, new_ap);
+ if (!best_ap)
+ nmn_item_remove_requested (NMN_ITEM (item));
+ else if (best_ap != current_ap)
+ nmn_wifi_item_set_ap (item, best_ap);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]