[network-manager-netbook/MplPanelClient] Fix another rebase problem.



commit 7bece4ededd285a2266fa54bae5ea90367681eb7
Author: Tambet Ingo <tambet gmail com>
Date:   Tue Nov 10 16:56:23 2009 +0200

    Fix another rebase problem.

 src/nmn-wifi-handler.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/nmn-wifi-handler.c b/src/nmn-wifi-handler.c
index 5108171..72db539 100644
--- a/src/nmn-wifi-handler.c
+++ b/src/nmn-wifi-handler.c
@@ -126,21 +126,23 @@ ap_updated (NMAccessPoint *ap,
     items = nmn_device_handler_get_items (handler);
     for (iter = items; iter; iter = iter->next) {
         NmnWifiItem *item = NMN_WIFI_ITEM (iter->data);
-        NMAccessPoint *current_ap = nmn_wifi_item_get_ap (item);
-        NMAccessPoint *best_ap;
+        NMAccessPoint *item_ap = nmn_wifi_item_get_ap (item);
+        NMDeviceWifi *device;
+        NMAccessPoint *new_ap;
 
-        best_ap = nm_device_wifi_get_active_access_point (device);
-        if (!best_ap) {
-            NMSettingsConnectionInterface *connection;
+        /* 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;
 
-            connection = nmn_network_item_get_connection (NMN_NETWORK_ITEM (item));
-            best_ap = find_best_ap_for_connection (device, NM_CONNECTION (connection));
-        }
+        /* not us */
+        if (item_ap != ap && !aps_are_compatible (ap, item_ap))
+            continue;
 
-        if (!best_ap)
-            nmn_item_remove_requested (NMN_ITEM (item));
-        else if (best_ap != current_ap)
-            nmn_wifi_item_set_ap (item, best_ap);
+        /* 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);
     }
 }
 



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