]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix the queue job descriptions cache.
authorDamiano Galassi <damiog@gmail.com>
Wed, 31 Jan 2018 09:10:58 +0000 (10:10 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 31 Jan 2018 09:10:58 +0000 (10:10 +0100)
macosx/HBQueueController.m

index db6cfe4812e63df55cd5a8aaf34006499378d5e6..4b37640cbb9724ff9a930a0a836f1ccf795e7c2c 100644 (file)
     [self.jobs beginTransaction];
     [self.outlineView beginUpdates];
 
-    NSArray *removeJobs = [self.jobs objectsAtIndexes:indexes];
+    NSArray<HBJob *> *removeJobs = [self.jobs objectsAtIndexes:indexes];
 
     if (self.jobs.count > indexes.lastIndex)
     {
         [self.jobs removeObjectsAtIndexes:indexes];
     }
 
+    for (HBJob *job in removeJobs)
+    {
+        [self.descriptions removeObjectForKey:job.uuid];
+    }
+
     [self.outlineView removeItemsAtIndexes:indexes inParent:nil withAnimation:NSTableViewAnimationSlideUp];
     [self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:indexes.firstIndex] byExtendingSelection:NO];
 
     if ([tableColumn.identifier isEqualToString:@"desc"])
     {
         HBJob *job = item;
-        NSAttributedString *description = self.descriptions[@(job.hash)];
+        NSAttributedString *description = self.descriptions[job.uuid];
 
         if (description == nil)
         {
             description = job.attributedDescription;
-            self.descriptions[@(job.hash)] = description;
+            self.descriptions[job.uuid] = description;
         }
 
         return description;