From b1966132ff1c7633990ef836bc528b5b09193565 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <asavard@asavard.(none)> Date: Tue, 7 Jun 2011 17:56:13 -0400 Subject: [PATCH] #5994: Fix addressbook plugin configuration loading --- sflphone-client-gnome/src/contacts/searchbar.c | 4 +++- sflphone-plugins/plugin/addressbook/addressbook.c | 14 ++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sflphone-client-gnome/src/contacts/searchbar.c b/sflphone-client-gnome/src/contacts/searchbar.c index 1bd06c3c57..533c37eb71 100644 --- a/sflphone-client-gnome/src/contacts/searchbar.c +++ b/sflphone-client-gnome/src/contacts/searchbar.c @@ -454,6 +454,8 @@ GtkWidget* contacts_searchbar_new () book_list_iterator = book_list_iterator->next) { book_data = (book_data_t *) book_list_iterator->data; + DEBUG("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %s", book_data->name); + if (book_data->active) { gtk_list_store_append (liststore, &iter); @@ -539,7 +541,7 @@ GtkWidget* contacts_searchbar_new () gtk_box_pack_start (GTK_BOX (ret), addressbookentry, TRUE, TRUE, 0); g_free (tooltip_text); - + g_strfreev (book_list); // current_addressbook = gtk_combo_box_get_active_text (GTK_COMBO_BOX (cbox)); // set_current_addressbook (current_addressbook); diff --git a/sflphone-plugins/plugin/addressbook/addressbook.c b/sflphone-plugins/plugin/addressbook/addressbook.c index 5056d5d7f9..96f5c2e5a7 100644 --- a/sflphone-plugins/plugin/addressbook/addressbook.c +++ b/sflphone-plugins/plugin/addressbook/addressbook.c @@ -104,17 +104,13 @@ addressbook_config_books(gchar **book_list) { gchar **config_book_uid; book_data_t *book_data; - gchar **list; - // Retrieve list of books - // list = (gchar **) dbus_get_addressbook_list(); - - list = NULL; - - if (list == NULL) + if (book_list == NULL) { + printf("Addresbook: Error: Book list is NULL (%s:%d)\n", __FILE__, __LINE__); return; + } - for (config_book_uid = list; *config_book_uid; config_book_uid++) { + for (config_book_uid = book_list; *config_book_uid; config_book_uid++) { // Get corresponding book data book_data = books_get_book_data_by_uid (*config_book_uid); @@ -126,8 +122,6 @@ addressbook_config_books(gchar **book_list) book_data->active = TRUE; } } - - g_strfreev (list); } /** -- GitLab