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

#6065: Fix runtime gtk warning when initializing searchbar without addressbook

parent 680b2efd
No related branches found
No related tags found
No related merge requests found
......@@ -94,10 +94,13 @@ calltab_get_selected_conf ()
void
calltab_create_searchbar (calltab_t* tab)
{
if (g_strcasecmp (tab->_name, HISTORY) == 0)
if (g_strcasecmp (tab->_name, HISTORY) == 0) {
tab->searchbar = history_searchbar_new ();
else if (g_strcasecmp (tab->_name, CONTACTS) == 0)
}
else if (g_strcasecmp (tab->_name, CONTACTS) == 0) {
tab->searchbar = contacts_searchbar_new ();
else
}
else {
ERROR ("Current calls tab does not need a searchbar\n");
}
}
......@@ -645,8 +645,10 @@ calltree_create (calltab_t* tab, gboolean searchbar_type)
// search bar if tab is either "history" or "addressbook"
if (searchbar_type) {
calltab_create_searchbar (tab);
if(tab->searchbar != NULL) {
gtk_box_pack_start (GTK_BOX (tab->tree), tab->searchbar, FALSE, TRUE, 0);
}
}
gtk_widget_show (tab->tree);
}
......
......@@ -161,8 +161,6 @@ void update_searchbar_addressbook_list()
}
}
DEBUG("OK");
if(abookfactory_is_addressbook_loaded()) {
AddrBookFactory *factory = abookfactory_get_factory();
if (activeIsSet) {
......@@ -175,7 +173,6 @@ void update_searchbar_addressbook_list()
factory->addrbook->set_current_book(gtk_combo_box_get_active_text(GTK_COMBO_BOX(cbox)));
}
}
DEBUG("OK");
g_free (activeText);
cboxSignalId = gtk_signal_connect (GTK_OBJECT (cbox), "changed", G_CALLBACK (cbox_changed_cb), NULL);
......@@ -496,7 +493,6 @@ GtkWidget* contacts_searchbar_new ()
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cbox), cell, "text", 0, NULL);
#if GTK_CHECK_VERSION(2,16,0)
// GdkPixbuf *pixbuf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment