diff audacious/mainwin.c @ 2149:a96b2e7ca58c trunk

[svn] - jump to file: detach model from treeview before updating its rows, then reattach it
author giacomo
date Sun, 17 Dec 2006 10:10:21 -0800
parents 06a86fdd4fb7
children 7af1ccd0a0ee
line wrap: on
line diff
--- a/audacious/mainwin.c	Sun Dec 17 09:22:48 2006 -0800
+++ b/audacious/mainwin.c	Sun Dec 17 10:10:21 2006 -0800
@@ -1975,6 +1975,10 @@
     /* FIXME: Remove the connected signals before clearing
      * (row-selected will still eventually arrive once) */
     store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview));
+    /* detach model from treeview */
+    g_object_ref( store );
+    gtk_tree_view_set_model( GTK_TREE_VIEW(treeview) , NULL );
+
     gtk_list_store_clear(store);
 
     playlist = playlist_get_active();
@@ -2031,6 +2035,10 @@
 
     PLAYLIST_UNLOCK(playlist->mutex);
 
+    /* attach the model again to the treeview */
+    gtk_tree_view_set_model( GTK_TREE_VIEW(treeview) , GTK_TREE_MODEL(store) );
+    g_object_unref( store );
+
     if ( regex_list != NULL )
     {
         regex_list_tmp = regex_list;