aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:35:00 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:35:00 +0800
commit41e7b0cb394ee1834a5ca777c1a7cc0e48247607 (patch)
treebfe85ce076e5f21d91fd82fb0842e6b7b9946cff
parent47036c6c5ff52acc356ad64d900b9b8cc738cb8b (diff)
downloadgsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.tar
gsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.tar.gz
gsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.tar.bz2
gsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.tar.lz
gsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.tar.xz
gsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.tar.zst
gsoc2013-empathy-41e7b0cb394ee1834a5ca777c1a7cc0e48247607.zip
Reorganize the constructor to avoid some casts and to avoid complex inline initializations.
svn path=/trunk/; revision=2343
-rw-r--r--libempathy-gtk/empathy-contact-selector.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c
index a094f171d..9c7052c3f 100644
--- a/libempathy-gtk/empathy-contact-selector.c
+++ b/libempathy-gtk/empathy-contact-selector.c
@@ -220,13 +220,18 @@ contact_selector_constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
- GObject *object =
- G_OBJECT_CLASS (empathy_contact_selector_parent_class)->constructor (
- type, n_construct_params, construct_params);
- EmpathyContactSelector *contact_selector = EMPATHY_CONTACT_SELECTOR (object);
- EmpathyContactSelectorPriv *priv = GET_PRIV (contact_selector);
+ GObject *object;
+ EmpathyContactSelector *contact_selector;
+ EmpathyContactSelectorPriv *priv;
+ GtkCellLayout *cell_layout;
GtkCellRenderer *renderer;
+ object = G_OBJECT_CLASS (empathy_contact_selector_parent_class)->constructor
+ (type, n_construct_params, construct_params);
+ priv = GET_PRIV (object);
+ contact_selector = EMPATHY_CONTACT_SELECTOR (object);
+ cell_layout = GTK_CELL_LAYOUT (object);
+
g_object_set (priv->store, "is-compact", TRUE, "show-avatars", FALSE,
"show-offline", FALSE, "show-groups", FALSE,
"sort-criterium", EMPATHY_CONTACT_LIST_STORE_SORT_NAME, NULL);
@@ -244,21 +249,18 @@ contact_selector_constructor (GType type,
gtk_widget_set_sensitive (GTK_WIDGET (contact_selector), FALSE);
renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (contact_selector),
- renderer, FALSE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (contact_selector), renderer,
+ gtk_cell_layout_pack_start (cell_layout, renderer, FALSE);
+ gtk_cell_layout_set_attributes (cell_layout, renderer,
"icon-name", EMPATHY_CONTACT_LIST_STORE_COL_ICON_STATUS, NULL);
renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (contact_selector),
- renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (contact_selector), renderer,
+ gtk_cell_layout_pack_start (cell_layout, renderer, TRUE);
+ gtk_cell_layout_set_attributes (cell_layout, renderer,
"text", EMPATHY_CONTACT_LIST_STORE_COL_NAME, NULL);
contact_selector_manage_blank_contact (contact_selector);
contact_selector_manage_sensitivity (contact_selector);
- object = G_OBJECT (contact_selector);
return object;
}