edit: selector validation and fixed an exception.

This commit is contained in:
Damiano Galassi committed 2014-03-16 22:50:58 +01:00
1 parent ed1e386e90
commit d730f1699f
3 files changed
+29 -9

No files matched your search

+13 -1
View File
@@ -7,7 +7,6 @@
//
#import "SBQueue.h"
#import "SBQueueItem.h"
#import "MetadataImporter.h"
@@ -147,6 +146,18 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
return index;
}
- (NSIndexSet *)indexesOfItemsWithStatus:(SBQueueItemStatus)status {
NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet];
dispatch_sync(self.itemsQueue, ^{
[self.items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if (((SBQueueItem *)obj).status == status) {
[indexes addIndex:idx];
}
}];
});
return indexes;
}
- (void)insertItem:(SBQueueItem *)anItem atIndex:(NSUInteger)index {
dispatch_sync(self.itemsQueue, ^{
[self.items insertObject:anItem atIndex:index];
@@ -314,6 +325,7 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
#endif
[attributes release];
return noErr;
}