summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueue.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-07-27 13:15:37 +0200
committerDamiano Galassi <[email protected]>2019-07-27 13:15:37 +0200
commitf82a8597f2800a5ca147679ad5660ef9fab5a85d (patch)
tree8e859079072c7c5e939ba4a7a7fcac5e8a67c3d9 /macosx/HBQueue.m
parenta1d064d2f01d963213b1336c0aeda9e7a1a6817f (diff)
MacGui: improve queue labels when multiple jobs are selected; fix some bugs.
Diffstat (limited to 'macosx/HBQueue.m')
-rw-r--r--macosx/HBQueue.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/macosx/HBQueue.m b/macosx/HBQueue.m
index 846f13c24..a294c1104 100644
--- a/macosx/HBQueue.m
+++ b/macosx/HBQueue.m
@@ -318,7 +318,7 @@ NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemK
[self.items commit];
}
-- (void)resetItemsStateAtIndexes:(NSIndexSet *)indexes
+- (void)resetItemsAtIndexes:(NSIndexSet *)indexes
{
if ([self.items beginTransaction] == HBDistributedArrayContentReload)
{
@@ -352,7 +352,7 @@ NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemK
NSIndexSet *indexes = [self.items indexesOfObjectsUsingBlock:^BOOL(HBQueueItem *item) {
return (item.state != HBQueueItemStateWorking);
}];
- [self resetItemsStateAtIndexes:indexes];
+ [self resetItemsAtIndexes:indexes];
[self.items commit];
}
@@ -362,7 +362,7 @@ NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemK
NSIndexSet *indexes = [self.items indexesOfObjectsUsingBlock:^BOOL(HBQueueItem *item) {
return (item.state == HBQueueItemStateFailed);
}];
- [self resetItemsStateAtIndexes:indexes];
+ [self resetItemsAtIndexes:indexes];
[self.items commit];
}
@@ -634,8 +634,8 @@ NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemK
[NSNotificationCenter.defaultCenter postNotificationName:HBQueueProgressNotification object:self userInfo:@{HBQueueProgressNotificationPercentKey: @1.0,
HBQueueProgressNotificationInfoKey: info}];
- NSInteger index = [self.items indexOfObject:item];
- NSIndexSet *indexes = index > -1 ? [NSIndexSet indexSetWithIndex:index] : [NSIndexSet indexSet];
+ NSUInteger index = [self.items indexOfObject:item];
+ NSIndexSet *indexes = index != NSNotFound ? [NSIndexSet indexSetWithIndex:index] : [NSIndexSet indexSet];
[NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidCompleteItemNotification object:self userInfo:@{HBQueueItemNotificationItemKey: item,
HBQueueItemNotificationIndexesKey: indexes}];