diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-02-11 20:28:44 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-02-12 00:01:37 +0800 |
commit | 0d6a5a8caef60613531a96f5f81b55c811200ec8 (patch) | |
tree | 169ff346e4f0964776abf6c626e39ec9b1e05792 | |
parent | a2ca8c402f0d0be1f2f7c47b6159c92f44181bff (diff) | |
download | gsoc2013-empathy-0d6a5a8caef60613531a96f5f81b55c811200ec8.tar.gz gsoc2013-empathy-0d6a5a8caef60613531a96f5f81b55c811200ec8.tar.zst gsoc2013-empathy-0d6a5a8caef60613531a96f5f81b55c811200ec8.zip |
empathy-protocol-chooser: add a column saying if a row is a facebook account or not
-rw-r--r-- | libempathy-gtk/empathy-protocol-chooser.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c index c2a159c9f..e67faf860 100644 --- a/libempathy-gtk/empathy-protocol-chooser.c +++ b/libempathy-gtk/empathy-protocol-chooser.c @@ -78,6 +78,7 @@ enum COL_CM, COL_PROTOCOL_NAME, COL_IS_GTALK, + COL_IS_FACEBOOK, COL_COUNT }; @@ -130,12 +131,16 @@ protocol_chooser_sort_func (GtkTreeModel *model, * non-gtalk */ if (cmp == 0) { - gboolean is_gtalk; + gboolean is_gtalk, is_facebook; gtk_tree_model_get (model, iter_a, COL_IS_GTALK, &is_gtalk, + COL_IS_FACEBOOK, &is_facebook, -1); - cmp = is_gtalk ? 1 : -1; + if (is_gtalk || is_facebook) + cmp = 1; + else + cmp = -1; } } @@ -226,6 +231,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser, COL_CM, cm, COL_PROTOCOL_NAME, proto->name, COL_IS_GTALK, FALSE, + COL_IS_FACEBOOK, FALSE, -1); if (!tp_strdiff (proto->name, "jabber") && @@ -239,6 +245,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser, COL_CM, cm, COL_PROTOCOL_NAME, proto->name, COL_IS_GTALK, TRUE, + COL_IS_FACEBOOK, FALSE, -1); display_name = empathy_protocol_name_to_display_name ("facebook"); @@ -249,6 +256,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser, COL_CM, cm, COL_PROTOCOL_NAME, proto->name, COL_IS_GTALK, FALSE, + COL_IS_FACEBOOK, TRUE, -1); } @@ -299,7 +307,8 @@ protocol_chooser_constructed (GObject *object) G_TYPE_STRING, /* Label */ G_TYPE_OBJECT, /* CM */ G_TYPE_STRING, /* protocol name */ - G_TYPE_BOOLEAN); /* is gtalk */ + G_TYPE_BOOLEAN, /* is gtalk */ + G_TYPE_BOOLEAN); /* is facebook */ /* Set the protocol sort function */ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (priv->store), |