changeset 1384:44999439a185 trunk

[svn] - fix GTK+ assertions - reorder category IDs if required
author nenolod
date Mon, 10 Jul 2006 04:02:23 -0700
parents e1cac302fa23
children 3e44e4df1e35
files ChangeLog audacious/prefswin.c
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 10 03:15:09 2006 -0700
+++ b/ChangeLog	Mon Jul 10 04:02:23 2006 -0700
@@ -1,3 +1,12 @@
+2006-07-10 10:15:09 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1680]
+  - further cleanups
+  
+
+  Changes:        Modified:
+  +2 -2           trunk/audacious/glade/prefswin.glade  
+
+
 2006-07-10 10:12:58 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1678]
   - preferences window cleanups
--- a/audacious/prefswin.c	Mon Jul 10 03:15:09 2006 -0700
+++ b/audacious/prefswin.c	Mon Jul 10 04:02:23 2006 -0700
@@ -2412,6 +2412,7 @@
     GtkTreeView *treeview = GTK_TREE_VIEW(category_treeview);
     gboolean ret;
     gint id;
+    gint index = -1;
 
     if (category_notebook == NULL || treeview == NULL || container == NULL)
         return;
@@ -2432,12 +2433,19 @@
 
     while (ret == TRUE)
     {
-        gint index = -1;
-
         gtk_tree_model_get(model, &iter, CATEGORY_VIEW_COL_ID, &index, -1);
 
         if (index == id)
+	{
             gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+	    ret = gtk_tree_model_get_iter_first(model, &iter);
+	}
+
+	if (index > id)
+	{
+	    index--;
+	    gtk_list_store_set(GTK_LIST_STORE(model), &iter, CATEGORY_VIEW_COL_ID, index, -1);
+	}
 
         ret = gtk_tree_model_iter_next(model, &iter);
     }