summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2020-01-31 17:55:52 +0100
committerDamiano Galassi <[email protected]>2020-04-11 09:16:21 +0200
commitc4202b8c37ac19f5fe6cc41a69212f82deec1dac (patch)
tree1079f590904bea6af62496990a6f52cf56af8628 /macosx/HBQueueController.m
parentb0a2c68ee60bd3d15889fa41cf1879c276a9e1b8 (diff)
MacGui: remove distributed queue.
Diffstat (limited to 'macosx/HBQueueController.m')
-rw-r--r--macosx/HBQueueController.m30
1 files changed, 2 insertions, 28 deletions
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index 86654e19b..703ec9a4d 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -309,13 +309,6 @@
*/
- (void)removeQueueItemsAtIndexes:(NSIndexSet *)indexes
{
- if ([self.queue.items beginTransaction] == HBDistributedArrayContentReload)
- {
- // Do not execture the action if the array changed.
- [self.queue.items commit];
- return;
- }
-
if (indexes.count)
{
NSMutableIndexSet *mutableIndexes = [indexes mutableCopy];
@@ -350,13 +343,9 @@
[alert beginSheetModalForWindow:targetWindow completionHandler:^(NSModalResponse returnCode) {
if (returnCode == NSAlertSecondButtonReturn)
{
- [self.queue.items beginTransaction];
-
NSInteger index = [self.queue.items indexOfObject:self.queue.currentItem];
[self.queue cancelCurrentItemAndContinue];
-
- [self.queue removeItemAtIndex:index];
- [self.queue.items commit];
+ [self.queue removeItemsAtIndexes:[NSIndexSet indexSetWithIndex:index]];
}
}];
}
@@ -365,13 +354,11 @@
// remove the non working items immediately
[self.queue removeItemsAtIndexes:mutableIndexes];
}
- [self.queue.items commit];
}
- (void)doEditQueueItem:(HBQueueItem *)item
{
NSParameterAssert(item);
- [self.queue.items beginTransaction];
if (item == self.queue.currentItem)
{
@@ -383,23 +370,19 @@
}
[self.delegate openJob:[item.job copy] completionHandler:^(BOOL result) {
- [self.queue.items beginTransaction];
if (result)
{
// Now that source is loaded and settings applied, delete the queue item from the queue
NSInteger index = [self.queue.items indexOfObject:item];
item.state = HBQueueItemStateReady;
- [self.queue removeItemAtIndex:index];
+ [self.queue removeItemsAtIndexes:[NSIndexSet indexSetWithIndex:index]];
}
else
{
item.state = HBQueueItemStateFailed;
NSBeep();
}
- [self.queue.items commit];
}];
-
- [self.queue.items commit];
}
/**
@@ -407,13 +390,6 @@
*/
- (void)editQueueItem:(HBQueueItem *)item
{
- if ([self.queue.items beginTransaction] == HBDistributedArrayContentReload)
- {
- // Do not execture the action if the array changed.
- [self.queue.items commit];
- return;
- }
-
// if this is a currently encoding item, we need to be sure to alert the user,
// to let them decide to cancel it first, then if they do, we can come back and
// remove it
@@ -442,8 +418,6 @@
{
[self doEditQueueItem:item];
}
-
- [self.queue.items commit];
}
- (void)resetQueueItemsAtIndexes:(NSIndexSet *)indexes