Skip to content
Snippets Groups Projects
Commit 6b9cb06d authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Merge branch 'conference'

parents b0008ae4 4dd47998
Branches
Tags
No related merge requests found
...@@ -32,17 +32,21 @@ void ...@@ -32,17 +32,21 @@ void
addressbook_search(GtkEntry* entry) addressbook_search(GtkEntry* entry)
{ {
AddressBook_Config *addressbook_config; gchar* query = gtk_entry_get_text(GTK_ENTRY (entry));
if (strlen(query) >= 3) {
// Activate waiting layer AddressBook_Config *addressbook_config;
activateWaitingLayer();
// Activate waiting layer
activateWaitingLayer();
// Load the address book parameters // Load the address book parameters
addressbook_config_load_parameters(&addressbook_config); 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() ...@@ -84,6 +88,7 @@ addressbook_is_active()
static void static void
addressbook_config_books() addressbook_config_books()
{ {
gchar **config_book_uid; gchar **config_book_uid;
book_data_t *book_data; book_data_t *book_data;
gchar **list; gchar **list;
...@@ -91,21 +96,21 @@ addressbook_config_books() ...@@ -91,21 +96,21 @@ addressbook_config_books()
// Retrieve list of books // Retrieve list of books
list = (gchar **) dbus_get_addressbook_list(); list = (gchar **) dbus_get_addressbook_list();
if (list) if (list) {
{
for (config_book_uid = list; *config_book_uid; config_book_uid++) for (config_book_uid = list; *config_book_uid; config_book_uid++) {
{
// Get corresponding book data // Get corresponding book data
book_data = books_get_book_data_by_uid(*config_book_uid); book_data = books_get_book_data_by_uid(*config_book_uid);
// If book_data exists // If book_data exists
if (book_data != NULL) if (book_data != NULL) {
{
book_data->active = TRUE; book_data->active = TRUE;
} }
} }
g_strfreev(list); g_strfreev(list);
} }
// Update buttons // Update buttons
update_actions (); update_actions ();
......
...@@ -275,23 +275,25 @@ pixbuf_from_contact(EContact *contact) ...@@ -275,23 +275,25 @@ pixbuf_from_contact(EContact *contact)
static void static void
eds_async_open_callback(EBook *book, EBookStatus status, gpointer closure) eds_async_open_callback(EBook *book, EBookStatus status, gpointer closure)
{ {
Open_Handler_And_Data *had = (Open_Handler_And_Data *) closure; Open_Handler_And_Data *had = (Open_Handler_And_Data *) closure;
remaining_books_to_open--; remaining_books_to_open--;
if (status == E_BOOK_ERROR_OK) DEBUG("eds_async_open_callback remaining book to open: %i", remaining_books_to_open);
{
book_data_t *book_data = g_new(book_data_t, 1); if (status == E_BOOK_ERROR_OK) {
book_data->active = FALSE;
book_data->name = g_strdup(e_source_peek_name(e_book_get_source(book))); book_data_t *book_data = g_new(book_data_t, 1);
book_data->uid = g_strdup(e_source_peek_uid(e_book_get_source(book))); book_data->active = FALSE;
book_data->ebook = book; book_data->name = g_strdup(e_source_peek_name(e_book_get_source(book)));
books_data = g_slist_prepend(books_data, book_data); book_data->uid = g_strdup(e_source_peek_uid(e_book_get_source(book)));
had->handler(); book_data->ebook = book;
books_data = g_slist_prepend(books_data, book_data);
had->handler();
} }
else else {
{
WARN("Got error %d when opening book", status); WARN("Got error %d when opening book", status);
} }
} }
...@@ -302,14 +304,15 @@ void ...@@ -302,14 +304,15 @@ void
init(OpenAsyncHandler callback) init(OpenAsyncHandler callback)
{ {
GSList *list, *l; GSList *list, *l;
ESourceList *source_list; ESourceList *source_list = NULL;
remaining_books_to_open = 0; remaining_books_to_open = 0;
books_data = NULL; books_data = NULL;
source_list = e_source_list_new_for_gconf_default( source_list = e_source_list_new_for_gconf_default("/apps/evolution/addressbook/sources");
"/apps/evolution/addressbook/sources");
if (source_list == NULL) if (source_list == NULL)
{ {
DEBUG("Error could not initialize source list for addressbook");
return; return;
} }
...@@ -320,6 +323,7 @@ init(OpenAsyncHandler callback) ...@@ -320,6 +323,7 @@ init(OpenAsyncHandler callback)
for (l = list; l != NULL; l = l->next) for (l = list; l != NULL; l = l->next)
{ {
ESourceGroup *group = l->data; ESourceGroup *group = l->data;
GSList *sources = NULL, *m; GSList *sources = NULL, *m;
sources = e_source_group_peek_sources(group); sources = e_source_group_peek_sources(group);
...@@ -330,10 +334,12 @@ init(OpenAsyncHandler callback) ...@@ -330,10 +334,12 @@ init(OpenAsyncHandler callback)
if (book != NULL) if (book != NULL)
{ {
// Keep count of remaining books to open // Keep count of remaining books to open
remaining_books_to_open++;
DEBUG("init addressbook %i", remaining_books_to_open);
remaining_books_to_open++;
// Asynchronous open // Asynchronous open
e_book_async_open(book, TRUE, eds_async_open_callback, had); e_book_async_open(book, FALSE, eds_async_open_callback, had);
} }
} }
} }
......
...@@ -36,6 +36,8 @@ GdkPixbuf *missed_pixbuf = NULL; ...@@ -36,6 +36,8 @@ GdkPixbuf *missed_pixbuf = NULL;
void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED) void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED)
{ {
DEBUG("searchbar_entry_changed");
if (active_calltree == contacts) { if (active_calltree == contacts) {
addressbook_search (entry); addressbook_search (entry);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment