diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-01-31 01:35:35 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:35:35 +0800 |
commit | 3c5f909c81c81e1182bc30a4c46dbd37cdd0252c (patch) | |
tree | 2b3646af87ea70eb218552b7ca50b46b7826f009 | |
parent | 0de2b569ad097da033187a2e17f4b9c0246cb246 (diff) | |
download | gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.tar gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.tar.gz gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.tar.bz2 gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.tar.lz gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.tar.xz gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.tar.zst gsoc2013-empathy-3c5f909c81c81e1182bc30a4c46dbd37cdd0252c.zip |
Pass an EmpathyContactList to _new and create the store from that.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=2355
-rw-r--r-- | libempathy-gtk/empathy-contact-selector.c | 8 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-selector.h | 2 | ||||
-rw-r--r-- | tests/empetit.c | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c index cfd1f733a..df5384ace 100644 --- a/libempathy-gtk/empathy-contact-selector.c +++ b/libempathy-gtk/empathy-contact-selector.c @@ -308,9 +308,13 @@ empathy_contact_selector_class_init (EmpathyContactSelectorClass *klass) /* public methods */ GtkWidget * -empathy_contact_selector_new (EmpathyContactListStore *store) +empathy_contact_selector_new (EmpathyContactList *contact_list) { - g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_STORE (store), NULL); + EmpathyContactListStore *store; + + g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST (contact_list), NULL); + + store = empathy_contact_list_store_new (contact_list); return GTK_WIDGET (g_object_new (EMPATHY_TYPE_CONTACT_SELECTOR, "store", store, NULL)); } diff --git a/libempathy-gtk/empathy-contact-selector.h b/libempathy-gtk/empathy-contact-selector.h index 238cbbbb9..d766c5a62 100644 --- a/libempathy-gtk/empathy-contact-selector.h +++ b/libempathy-gtk/empathy-contact-selector.h @@ -59,7 +59,7 @@ struct _EmpathyContactSelectorClass GType empathy_contact_selector_get_type (void) G_GNUC_CONST; GtkWidget * -empathy_contact_selector_new (EmpathyContactListStore *store); +empathy_contact_selector_new (EmpathyContactList *contact_list); EmpathyContact * empathy_contact_selector_get_selected (EmpathyContactSelector *selector); diff --git a/tests/empetit.c b/tests/empetit.c index 2c05fd089..43fddcbe2 100644 --- a/tests/empetit.c +++ b/tests/empetit.c @@ -53,7 +53,6 @@ int main (int argc, char *argv[]) { EmpathyContactManager *manager; - EmpathyContactListStore *store; GtkWidget *vbox, *button, *selector; gtk_init (&argc, &argv); @@ -61,11 +60,10 @@ int main (int argc, empathy_gtk_init (); manager = empathy_contact_manager_dup_singleton (); - store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (manager)); + selector = empathy_contact_selector_new (EMPATHY_CONTACT_LIST (manager)); vbox = gtk_vbox_new (FALSE, 2); - selector = empathy_contact_selector_new (store); gtk_box_pack_start (GTK_BOX (vbox), selector, FALSE, FALSE, 5); button = gtk_button_new_with_label ("Chat"); @@ -83,7 +81,6 @@ int main (int argc, gtk_main (); - g_object_unref (store); g_object_unref (manager); return 0; |