Skip to content
Snippets Groups Projects
Commit 21667c4b authored by pierre-luc's avatar pierre-luc
Browse files

[#1858] This problem was fixed by removing a useless line in

sflphone-client-gnome that was querying the daemon on dbus to see if the
option showsearchbar was set or not. This function being later defined as
a macro, it was used too often while building up the history from file.
Since the behaviour defined with that option is no longer needed, this
change had no undesirable effect.
parent 5e4ca48e
No related branches found
No related tags found
No related merge requests found
......@@ -65,50 +65,46 @@ static GtkTreeModel* history_create_filter (GtkTreeModel* child)
static gboolean history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED)
{
if (SHOW_SEARCHBAR)
{
GValue val, obj;
GValue val, obj;
callable_obj_t *history_entry = NULL;
gchar* text = NULL;
gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget));
memset (&val, 0, sizeof(val));
memset (&obj, 0, sizeof(obj));
// Fetch the call description
gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 1, &val);
if(G_VALUE_HOLDS_STRING(&val)){
text = (gchar *)g_value_get_string(&val);
}
// Fetch the call type
gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 2, &obj);
if (G_VALUE_HOLDS_POINTER (&obj)){
history_entry = (gpointer) g_value_get_pointer (&obj);
}
callable_obj_t *history_entry = NULL;
gchar* text = NULL;
gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(history_searchbar_widget));
memset (&val, 0, sizeof(val));
memset (&obj, 0, sizeof(obj));
// Fetch the call description
gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 1, &val);
if(G_VALUE_HOLDS_STRING(&val)){
text = (gchar *)g_value_get_string(&val);
}
// Fetch the call type
gtk_tree_model_get_value (GTK_TREE_MODEL(model), iter, 2, &obj);
if (G_VALUE_HOLDS_POINTER (&obj)){
history_entry = (gpointer) g_value_get_pointer (&obj);
}
if(text != NULL)
if(text != NULL)
{
if (history_entry)
{
if (history_entry)
// Filter according to the type of call
// MISSED, INCOMING, OUTGOING, ALL
if ((int)get_current_history_search_type () == SEARCH_ALL)
return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0);
else
{
// Filter according to the type of call
// MISSED, INCOMING, OUTGOING, ALL
if ((int)get_current_history_search_type () == SEARCH_ALL)
return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0);
else
{
// We need a match on the history_state_t and the current search type
return (history_entry->_history_state + 1) == (int)get_current_history_search_type () &&
g_regex_match_simple(search, text, G_REGEX_CASELESS, 0);
}
// We need a match on the history_state_t and the current search type
return (history_entry->_history_state + 1) == (int)get_current_history_search_type () &&
g_regex_match_simple(search, text, G_REGEX_CASELESS, 0);
}
}
}
// Clean up
g_value_unset (&val);
g_value_unset (&obj);
// Clean up
g_value_unset (&val);
g_value_unset (&obj);
return TRUE;
}
return TRUE;
}
......@@ -197,21 +197,9 @@ create_main_window ()
gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
// gtk_box_pack_start (GTK_BOX (vbox), current_calls->searchbar, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
// gtk_box_pack_start (GTK_BOX (vbox), history->searchbar, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
// gtk_box_pack_start (GTK_BOX (vbox), contacts ->searchbar, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/);
// if( SHOW_SEARCHBAR ){
// filterEntry = create_filter_entry();
// gtk_box_pack_start (GTK_BOX (subvbox), filterEntry, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
// gtk_widget_show_all ( filterEntry );
// }
if( SHOW_VOLUME ){
if( SHOW_VOLUME ){
speaker_control = create_slider("speaker");
gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (speaker_control);
......@@ -350,22 +338,6 @@ main_window_volume_controls( gboolean *state ){
}
}
void
main_window_searchbar( gboolean *state UNUSED){
if( !SHOW_SEARCHBAR )
{
// filterEntry = create_filter_entry();
// gtk_box_pack_start (GTK_BOX (subvbox), filterEntry, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
// gtk_widget_show_all (filterEntry);
// *state = TRUE;
}
else
{
// gtk_container_remove( GTK_CONTAINER(subvbox) , filterEntry );
// *state = FALSE;
}
}
void
statusbar_push_message(const gchar * message, guint id)
{
......
......@@ -90,8 +90,6 @@ void statusbar_push_message( const gchar* message , guint id );
*/
void statusbar_pop_message( guint id );
void main_window_searchbar( gboolean *state );
//static gboolean
//on_key_released (GtkWidget *widget, GdkEventKey *event,
// gpointer user_data);
......
......@@ -614,16 +614,7 @@ view_volume_controls (GtkImageMenuItem *imagemenuitem UNUSED,
dbus_set_volume_controls( state );
}
/*
static void
view_searchbar (GtkImageMenuItem *imagemenuitem UNUSED,
void* foo UNUSED)
{
gboolean state;
main_window_searchbar( &state );
dbus_set_searchbar( state );
}
*/
GtkWidget *
create_view_menu()
{
......
......@@ -77,8 +77,6 @@ log4c_category_t* log4c_sfl_gtk_category;
#define SHOW_DIALPAD ( dbus_get_dialpad() )
/** Show/Hide the volume controls */
#define SHOW_VOLUME ( dbus_get_volume_controls() )
/** Show/Hide the dialpad */
#define SHOW_SEARCHBAR ( dbus_get_searchbar() )
/** Show/Hide the alsa configuration panel */
#define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment