Revision: 2259 http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2259&view=rev Author: jcsjcs Date: 2009-02-24 13:43:56 +0000 (Tue, 24 Feb 2009)
Log Message: ----------- * src/display_sorttabs.c (st_remove_all_entries_from_model) Faster code to remove all entries in the filter entries. Thanks to Javier Kohen for the patch. Modified Paths: -------------- gtkpod/trunk/ChangeLog gtkpod/trunk/src/display_sorttabs.c Modified: gtkpod/trunk/ChangeLog =================================================================== --- gtkpod/trunk/ChangeLog 2009-02-24 13:19:58 UTC (rev 2258) +++ gtkpod/trunk/ChangeLog 2009-02-24 13:43:56 UTC (rev 2259) @@ -1,5 +1,11 @@ 2009-02-24 Jorg Schuler <jcsjcs at users.sourceforge.net> + * src/display_sorttabs.c (st_remove_all_entries_from_model) + Faster code to remove all entries in the filter + entries. Thanks to Javier Kohen for the patch. + +2009-02-24 Jorg Schuler <jcsjcs at users.sourceforge.net> + * src/display_tracks.c (tm_remove_all_tracks) Faster code to remove all tracks. Thanks to Javier Kohen for the patch. Modified: gtkpod/trunk/src/display_sorttabs.c =================================================================== --- gtkpod/trunk/src/display_sorttabs.c 2009-02-24 13:19:58 UTC (rev 2258) +++ gtkpod/trunk/src/display_sorttabs.c 2009-02-24 13:43:56 UTC (rev 2259) @@ -1144,16 +1144,21 @@ if (hashed_entry == entry) g_hash_table_remove (st->entry_hash, entry->name); } - C_FREE (entry->name); + g_free (entry->name); g_free (entry); } } +static void st_free_entry_cb (gpointer data, gpointer user_data) +{ + TabEntry *entry = (TabEntry *)data; + g_list_free (entry->members); +} + /* Remove all entries from the display model and the sorttab */ /* @clear_sort: reset sorted columns to the non-sorted state */ void st_remove_all_entries_from_model (guint32 inst) { - TabEntry *entry; SortTab *st = sorttab[inst]; gint column; GtkSortType order; @@ -1168,11 +1173,13 @@ /* We may have to unselect the previous selection */ gtk_tree_selection_unselect_all (selection); } - while (st->entries != NULL) + if (st->model) { - entry = (TabEntry *)g_list_nth_data (st->entries, 0); - st_remove_entry_from_model (entry, inst); + gtk_list_store_clear (GTK_LIST_STORE (st->model)); } + g_list_foreach (st->entries, st_free_entry_cb, NULL); + g_list_free (st->entries); + st->entries = NULL; if (st->entry_hash) g_hash_table_destroy (st->entry_hash); st->entry_hash = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2