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.
This commit is contained in:
Lubomir Rintel 2018-11-09 16:46:13 +01:00
parent 13d2d332dd
commit def03fd7cf

View file

@ -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: