[MPlayer-cvslog] r35616 - trunk/gui/ui/gtk/playlist.c

ib subversion at mplayerhq.hu
Thu Dec 6 01:57:30 CET 2012


Author: ib
Date: Thu Dec  6 01:57:30 2012
New Revision: 35616

Log:
Fix bug with removing items from playlist.

When removing files from the playlist in the playlist editor
not all selected items towards the end of the list were removed.

Patch by Hans-Dieter Kosch, hdkosch kabelbw de.

Modified:
   trunk/gui/ui/gtk/playlist.c

Modified: trunk/gui/ui/gtk/playlist.c
==============================================================================
--- trunk/gui/ui/gtk/playlist.c	Thu Dec  6 00:28:14 2012	(r35615)
+++ trunk/gui/ui/gtk/playlist.c	Thu Dec  6 01:57:30 2012	(r35616)
@@ -247,22 +247,25 @@ static void plButtonReleased( GtkButton 
        break;
   case 2: // remove
        {
-	int i; int j; int c=0;
+	int i; int j;
 
 	gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigSel );
 	gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigUnsel );
 	gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigEvent );
 
         gtk_clist_freeze( GTK_CLIST( CLSelected ) );
-        for ( i=0;i<NrOfSelected-c;i++ )
+        i = 0;
+        while ( i<NrOfSelected )
+        {
   	 if ( CLListSelected[i] )
 	  {
-	   gtk_clist_remove( GTK_CLIST( CLSelected ),i - c );
-	   c++;
-	   for ( j=i;j<NrOfSelected-c;j++ )
-		CLListSelected[i] = CLListSelected[i+1];
+	   gtk_clist_remove( GTK_CLIST( CLSelected ),i );
+	   NrOfSelected--;
+	   for ( j=i;j<NrOfSelected;j++ )
+		CLListSelected[j] = CLListSelected[j+1];
 	  }
-	NrOfSelected-=c;
+  	 else i++;
+        }
 	gtk_clist_thaw( GTK_CLIST( CLSelected ) );
 
 	gtk_signal_handler_unblock( GTK_OBJECT( CLSelected ),sigSel );


More information about the MPlayer-cvslog mailing list