summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-11-09 16:46:13 +0100
committerLubomir Rintel <lkundrak@v3.sk>2018-11-21 11:46:22 +0100
commitdef03fd7cf9be94fc5464a86724ff3815cc4b93a (patch)
tree654a9737a44a2933927c714f40a74256f48f6f7c
parent13d2d332dd55312e48a6a46ab3b311c2e740691d (diff)
downloadNetworkManager-def03fd7cf9be94fc5464a86724ff3815cc4b93a.tar.gz
cli/connections: improve sort by active connections
When sorting the active connections, use the same policy as "nmcli" and "nmcli d", not just the connection state. It looks better that way.
-rw-r--r--clients/cli/connections.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index e64e19a262..446424ba46 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -1693,12 +1693,10 @@ con_show_get_items_cmp (gconstpointer pa, gconstpointer pb, gpointer user_data)
switch (item) {
case NMC_SORT_ACTIVE:
- NM_CMP_DIRECT (active_connection_get_state_ord (ac_b),
- active_connection_get_state_ord (ac_a));
+ NM_CMP_RETURN (nmc_active_connection_cmp (ac_b, ac_a));
break;
case NMC_SORT_ACTIVE_INV:
- NM_CMP_DIRECT (active_connection_get_state_ord (ac_a),
- active_connection_get_state_ord (ac_b));
+ NM_CMP_RETURN (nmc_active_connection_cmp (ac_a, ac_b));
break;
case NMC_SORT_TYPE: