summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-10-28 08:15:52 +0100
committerDamiano Galassi <[email protected]>2015-10-28 08:15:52 +0100
commit89c0a25d548575ac2ad9e867fa0f506fed7ad625 (patch)
tree6ae99c75b0558cb04af6842ea8b5b53bdac5c0aa /macosx/HBQueueController.m
parent5adcef6070a6b8f91a92d2c22e5449dab3b15a34 (diff)
MacGui: annotate the type of some arrays, and check the count of the input jobs in HBQueueController addJobsFromArray:, so we don't add an empty undo command.
Diffstat (limited to 'macosx/HBQueueController.m')
-rw-r--r--macosx/HBQueueController.m13
1 files changed, 8 insertions, 5 deletions
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index 624d03700..537e8c86b 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -44,7 +44,7 @@
@property (nonatomic, readonly) NSMutableDictionary *descriptions;
-@property (nonatomic, readonly) HBDistributedArray *jobs;
+@property (nonatomic, readonly) HBDistributedArray<HBJob *> *jobs;
@property (nonatomic) HBJob *currentJob;
@property (nonatomic) HBJobOutputFileWriter *currentLog;
@@ -53,7 +53,7 @@
@property (nonatomic, readwrite) NSUInteger pendingItemsCount;
@property (nonatomic, readwrite) NSUInteger completedItemsCount;
-@property (nonatomic) NSArray *dragNodesArray;
+@property (nonatomic) NSArray<HBJob *> *dragNodesArray;
@end
@@ -213,10 +213,13 @@
[self addJobsFromArray:@[item]];
}
-- (void)addJobsFromArray:(NSArray *)items;
+- (void)addJobsFromArray:(NSArray<HBJob *> *)items;
{
NSParameterAssert(items);
- [self addQueueItems:items];
+ if (items.count)
+ {
+ [self addQueueItems:items];
+ }
}
- (BOOL)jobExistAtURL:(NSURL *)url
@@ -937,7 +940,7 @@
if ([targetedRows containsIndexes:workingIndexes])
{
[targetedRows removeIndexes:workingIndexes];
- NSArray *workingJobs = [self.jobs filteredArrayUsingBlock:^BOOL(HBJob *item) {
+ NSArray<HBJob *> *workingJobs = [self.jobs filteredArrayUsingBlock:^BOOL(HBJob *item) {
return item.state == HBJobStateWorking;
}];