[gnome-initial-setup] network: Sort by strength
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] network: Sort by strength
- Date: Tue, 31 Jul 2012 20:41:28 +0000 (UTC)
commit 6165fc175a515dbf952a189c524c59d310d7e9a7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jul 31 11:30:31 2012 -0300
network: Sort by strength
.../pages/network/gis-network-page.c | 43 +-------------------
.../pages/network/gis-network-page.ui | 1 -
2 files changed, 2 insertions(+), 42 deletions(-)
---
diff --git a/gnome-initial-setup/pages/network/gis-network-page.c b/gnome-initial-setup/pages/network/gis-network-page.c
index 987d46c..d32a643 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.c
+++ b/gnome-initial-setup/pages/network/gis-network-page.c
@@ -44,7 +44,6 @@ struct _NetworkData {
enum {
PANEL_WIRELESS_COLUMN_ID,
PANEL_WIRELESS_COLUMN_TITLE,
- PANEL_WIRELESS_COLUMN_SORT,
PANEL_WIRELESS_COLUMN_STRENGTH,
PANEL_WIRELESS_COLUMN_MODE,
PANEL_WIRELESS_COLUMN_SECURITY,
@@ -53,37 +52,6 @@ enum {
PANEL_WIRELESS_COLUMN_PULSE
};
-static gint
-wireless_sort_cb (GtkTreeModel *model,
- GtkTreeIter *a,
- GtkTreeIter *b,
- gpointer user_data)
-{
- gchar *str_a;
- gchar *str_b;
- gint retval;
-
- gtk_tree_model_get (model, a, PANEL_WIRELESS_COLUMN_SORT, &str_a, -1);
- gtk_tree_model_get (model, b, PANEL_WIRELESS_COLUMN_SORT, &str_b, -1);
-
- /* special case blank entries to the bottom */
- if (g_strcmp0 (str_a, "") == 0) {
- retval = 1;
- goto out;
- }
- if (g_strcmp0 (str_b, "") == 0) {
- retval = -1;
- goto out;
- }
-
- retval = g_strcmp0 (str_a, str_b);
- out:
- g_free (str_a);
- g_free (str_b);
-
- return retval;
-}
-
static GPtrArray *
get_strongest_unique_aps (const GPtrArray *aps)
{
@@ -235,7 +203,6 @@ add_access_point (NetworkData *data, NMAccessPoint *ap, NMAccessPoint *active)
gtk_list_store_set (data->ap_list, &iter,
PANEL_WIRELESS_COLUMN_ID, object_path,
PANEL_WIRELESS_COLUMN_TITLE, ssid_text,
- PANEL_WIRELESS_COLUMN_SORT, ssid_text,
PANEL_WIRELESS_COLUMN_STRENGTH, nm_access_point_get_strength (ap),
PANEL_WIRELESS_COLUMN_MODE, nm_access_point_get_mode (ap),
PANEL_WIRELESS_COLUMN_SECURITY, get_access_point_security (ap),
@@ -271,7 +238,6 @@ add_access_point_other (NetworkData *data)
PANEL_WIRELESS_COLUMN_TITLE, C_("Wireless access point", "Other..."),
/* always last */
- PANEL_WIRELESS_COLUMN_SORT, "",
PANEL_WIRELESS_COLUMN_STRENGTH, 0,
PANEL_WIRELESS_COLUMN_MODE, NM_802_11_MODE_UNKNOWN,
PANEL_WIRELESS_COLUMN_SECURITY, NM_AP_SEC_UNKNOWN,
@@ -690,13 +656,8 @@ gis_prepare_network_page (SetupData *setup)
data->ap_list = g_object_ref (OBJ(GtkListStore *, "liststore-wireless"));
sortable = GTK_TREE_SORTABLE (data->ap_list);
gtk_tree_sortable_set_sort_column_id (sortable,
- PANEL_WIRELESS_COLUMN_SORT,
- GTK_SORT_ASCENDING);
- gtk_tree_sortable_set_sort_func (sortable,
- PANEL_WIRELESS_COLUMN_SORT,
- wireless_sort_cb,
- sortable,
- NULL);
+ PANEL_WIRELESS_COLUMN_STRENGTH,
+ GTK_SORT_DESCENDING);
data->nm_client = nm_client_new ();
diff --git a/gnome-initial-setup/pages/network/gis-network-page.ui b/gnome-initial-setup/pages/network/gis-network-page.ui
index ac18131..0e1b275 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.ui
+++ b/gnome-initial-setup/pages/network/gis-network-page.ui
@@ -5,7 +5,6 @@
<columns>
<column type="gchararray"/> <!-- column-name id -->
<column type="gchararray"/> <!-- column-name title -->
- <column type="gchararray"/> <!-- column-name sortable -->
<column type="guint"/> <!-- column-name strength -->
<column type="guint"/> <!-- column-name mode -->
<column type="guint"/> <!-- column-name security -->
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]