diff options
author | Will Thompson <will@willthompson.co.uk> | 2012-02-01 11:00:09 +0000 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2012-02-01 11:00:19 +0000 |
commit | c02db9192bf6233e09252b3d0d189744ea91acb1 (patch) | |
tree | 0e15a0804cc75aa5253cefb6af61f0e0b736169f | |
parent | 35053f8fdeddd79c92d7f6ddb9e0ac96a6c0c3f6 (diff) | |
download | telepathy-mission-control-c02db9192bf6233e09252b3d0d189744ea91acb1.tar.gz |
mc-tool: sort lists of account identifiers.
-rw-r--r-- | util/mc-tool.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/util/mc-tool.c b/util/mc-tool.c index 38003b20..b51e948c 100644 --- a/util/mc-tool.c +++ b/util/mc-tool.c @@ -504,12 +504,25 @@ getter_by_name(char *name) /* ====================================================================== */ +static gint +compare_accounts (gconstpointer a, + gconstpointer b) +{ + return strcmp (tp_account_get_path_suffix (TP_ACCOUNT (a)), + tp_account_get_path_suffix (TP_ACCOUNT (b))); +} + +static GList * +get_valid_accounts_sorted (TpAccountManager *manager) +{ + return g_list_sort (tp_account_manager_get_valid_accounts (manager), + compare_accounts); +} + static gboolean command_list (TpAccountManager *manager) { - GList *accounts; - - accounts = tp_account_manager_get_valid_accounts (manager); + GList *accounts = get_valid_accounts_sorted (manager); if (accounts != NULL) { GList *ptr; |