diff --git a/sflphone-client-gnome/src/contacts/addressbook.c b/sflphone-client-gnome/src/contacts/addressbook.c index 60557d04f6533ac2b87e724d6570bb170c7251ae..d9b987c6340af544880f01ef9e74ded840bfd2b4 100644 --- a/sflphone-client-gnome/src/contacts/addressbook.c +++ b/sflphone-client-gnome/src/contacts/addressbook.c @@ -32,17 +32,21 @@ void addressbook_search(GtkEntry* entry) { - AddressBook_Config *addressbook_config; + gchar* query = gtk_entry_get_text(GTK_ENTRY (entry)); + if (strlen(query) >= 3) { - // Activate waiting layer - activateWaitingLayer(); + AddressBook_Config *addressbook_config; + + // Activate waiting layer + activateWaitingLayer(); - // Load the address book parameters - addressbook_config_load_parameters(&addressbook_config); + // Load the address book parameters + addressbook_config_load_parameters(&addressbook_config); + + // Start the asynchronous search as soon as we have an entry */ + search_async(gtk_entry_get_text(GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, addressbook_config); - // Start the asynchronous search as soon as we have an entry */ - search_async(gtk_entry_get_text(GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, - addressbook_config); + } } /** @@ -84,6 +88,7 @@ addressbook_is_active() static void addressbook_config_books() { + gchar **config_book_uid; book_data_t *book_data; gchar **list; @@ -91,21 +96,21 @@ addressbook_config_books() // Retrieve list of books list = (gchar **) dbus_get_addressbook_list(); - if (list) - { - for (config_book_uid = list; *config_book_uid; config_book_uid++) - { + if (list) { + + for (config_book_uid = list; *config_book_uid; config_book_uid++) { + // Get corresponding book data book_data = books_get_book_data_by_uid(*config_book_uid); // If book_data exists - if (book_data != NULL) - { + if (book_data != NULL) { + book_data->active = TRUE; - } - } + } + } g_strfreev(list); - } + } // Update buttons update_actions ();