comparison 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
comparison
equal deleted inserted replaced
2148:dcf529750750 2149:a96b2e7ca58c
1973 } 1973 }
1974 1974
1975 /* FIXME: Remove the connected signals before clearing 1975 /* FIXME: Remove the connected signals before clearing
1976 * (row-selected will still eventually arrive once) */ 1976 * (row-selected will still eventually arrive once) */
1977 store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview)); 1977 store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview));
1978 /* detach model from treeview */
1979 g_object_ref( store );
1980 gtk_tree_view_set_model( GTK_TREE_VIEW(treeview) , NULL );
1981
1978 gtk_list_store_clear(store); 1982 gtk_list_store_clear(store);
1979 1983
1980 playlist = playlist_get_active(); 1984 playlist = playlist_get_active();
1981 1985
1982 PLAYLIST_LOCK(playlist->mutex); 1986 PLAYLIST_LOCK(playlist->mutex);
2028 filename = NULL; 2032 filename = NULL;
2029 } 2033 }
2030 } 2034 }
2031 2035
2032 PLAYLIST_UNLOCK(playlist->mutex); 2036 PLAYLIST_UNLOCK(playlist->mutex);
2037
2038 /* attach the model again to the treeview */
2039 gtk_tree_view_set_model( GTK_TREE_VIEW(treeview) , GTK_TREE_MODEL(store) );
2040 g_object_unref( store );
2033 2041
2034 if ( regex_list != NULL ) 2042 if ( regex_list != NULL )
2035 { 2043 {
2036 regex_list_tmp = regex_list; 2044 regex_list_tmp = regex_list;
2037 while ( regex_list != NULL ) 2045 while ( regex_list != NULL )