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

#5994: Implement set current addressbook name and search type in addressbook plugin

parent 4a9ff00e
No related branches found
No related tags found
No related merge requests found
...@@ -84,11 +84,12 @@ static void cbox_changed_cb (GtkWidget *widget, gpointer user_data UNUSED) ...@@ -84,11 +84,12 @@ static void cbox_changed_cb (GtkWidget *widget, gpointer user_data UNUSED)
{ {
gchar *name; gchar *name;
DEBUG ("Searchbar: CBOX changed callback"); DEBUG ("Searchbar: Addressbook changed callback");
name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
if(abookfactory_is_addressbook_loaded()) { if(abookfactory_is_addressbook_loaded()) {
DEBUG("Searchbar: Set new addressbook");
AddrBookFactory *factory = abookfactory_get_factory(); AddrBookFactory *factory = abookfactory_get_factory();
factory->addrbook->set_current_book (name); factory->addrbook->set_current_book (name);
AddressBook_Config *addressbook_config; AddressBook_Config *addressbook_config;
......
...@@ -235,9 +235,22 @@ handler_async_search (GList *hits, gpointer user_data) ...@@ -235,9 +235,22 @@ handler_async_search (GList *hits, gpointer user_data)
*/ */
void addressbook_set_search_type(AddrbookSearchType searchType) { void addressbook_set_search_type(AddrbookSearchType searchType) {
switch(searchType) {
case ABOOK_QUERY_IS:
set_current_addressbook_test(E_BOOK_QUERY_IS);
break;
case ABOOK_QUERY_BEGINS_WITH:
set_current_addressbook_test(E_BOOK_QUERY_BEGINS_WITH);
break;
case ABOOK_QUERY_CONTAINS:
set_current_addresbook_test(E_BOOK_QUERY_CONTAINS);
break;
default:
printf("Addressbook: Error: Unsupported search type");
break;
}
} }
void addressbook_set_current_book(gchar *current) { void addressbook_set_current_book(gchar *current) {
set_current_addressbook(current);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment