Skip to content

Commit

Permalink
call the notify function just once when the keywords are pushed to the
Browse files Browse the repository at this point in the history
textarea
  • Loading branch information
nadvornik committed Mar 15, 2009
1 parent 5c5e09c commit bdb1e4f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/bar_keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ GList *keyword_list_pull(GtkWidget *text_widget)
return list;
}

/* the "changed" signal should be blocked before calling this */
static void keyword_list_push(GtkWidget *textview, GList *list)
{
GtkTextBuffer *buffer;
Expand Down Expand Up @@ -279,6 +280,8 @@ static void bar_pane_keywords_keyword_toggle(GtkCellRendererToggle *toggle, cons
GtkTreeIter child_iter;
GtkTreeModel *keyword_tree;

GtkTextBuffer *keyword_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pkd->keyword_view));

model = gtk_tree_view_get_model(GTK_TREE_VIEW(pkd->keyword_treeview));

tpath = gtk_tree_path_new_from_string(path);
Expand All @@ -297,11 +300,16 @@ static void bar_pane_keywords_keyword_toggle(GtkCellRendererToggle *toggle, cons
keyword_tree_set(keyword_tree, &child_iter, &list);
else
keyword_tree_reset(keyword_tree, &child_iter, &list);


g_signal_handlers_block_by_func(keyword_buffer, bar_pane_keywords_changed, pkd);
keyword_list_push(pkd->keyword_view, list);
string_list_free(list);
g_signal_handlers_unblock_by_func(keyword_buffer, bar_pane_keywords_changed, pkd);

/* call this just once in the end */
bar_pane_keywords_changed(keyword_buffer, pkd);
/*
keyword_list_push triggers bar_pane_keywords_change which calls bar_keyword_tree_sync, no need to do it again
bar_pane_keywords_change calls bar_keyword_tree_sync, no need to do it again
bar_keyword_tree_sync(pkd);
*/
}
Expand Down

0 comments on commit bdb1e4f

Please sign in to comment.