MacOSX/Framework: Fix grouped event sending, and remove a debugging assert that isn...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 2 Jan 2008 14:46:15 +0000 (14:46 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 2 Jan 2008 14:46:15 +0000 (14:46 +0000)
extras/MacOSX/Framework/Sources/VLCEventManager.m
extras/MacOSX/Framework/Sources/VLCMediaList.m
extras/MacOSX/Framework/Sources/VLCMediaListAspect.m

index 9f1201d..49ea159 100644 (file)
@@ -117,7 +117,6 @@ static void * EventDispatcherMainLoop(void * user_data)
                     [message_newer->target release];
                     [message_newer->u.object release];
                     [[self messageQueue] removeObjectAtIndex: i];
-                    i++;
                     continue;
                 }
                 /* It should be a good idea not to collapse event, with other kind of event in-between
index ba9fa70..b712fcc 100644 (file)
@@ -300,14 +300,11 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
     int end = [[[arrayOfArgs objectAtIndex: [arrayOfArgs count]-1] objectForKey:@"index"] intValue];
     NSRange range = NSMakeRange(start, end-start);
     [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:range] forKey:@"media"];
-    int i = [[[arrayOfArgs objectAtIndex: 0] objectForKey:@"index"] intValue];
-    [arrayOfArgs retain];
     for( NSDictionary * args in arrayOfArgs )
     {
         int index = [[args objectForKey:@"index"] intValue];
         VLCMedia * media = [args objectForKey:@"media"];
         /* Sanity check */
-        NSAssert( i == index, @"Expects some troubles, inserted items are not in a range" ); i++;
         if( index && index >= [cachedMedia count] )
             index = [cachedMedia count] - 1;
         [cachedMedia insertObject:media atIndex:index];
index 9fa9974..adf00aa 100644 (file)
@@ -256,7 +256,6 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
 
     [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:range] forKey:@"media"];
     [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:range] forKey:@"node"];
-    int i = [[[arrayOfArgs objectAtIndex: 0] objectForKey:@"index"] intValue];
     for( NSDictionary * args in arrayOfArgs )
     {
         int index = [[args objectForKey:@"index"] intValue];
@@ -265,7 +264,6 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
         [node setMedia:media];
         [node setChildren:[self childrenAtIndex:index]];
         /* Sanity check */
-        NSAssert( i == index, @"Expects some troubles, inserted items are not in a range" ); i++;
         if( index && index >= [cachedNode count] )
             index = [cachedNode count] - 1;
         [cachedNode insertObject:node atIndex:index];