summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-02-12 09:28:09 +0100
committerDamiano Galassi <[email protected]>2019-02-12 09:28:09 +0100
commitb183dc8e884920228ca1e626a91cce0ea48a6297 (patch)
tree933c452307fd2fa748972232e8f9f63d80ea7ac7 /macosx
parent1e615d4e0b1c6ef4727cf39a028beddb2636bcea (diff)
MacGui: serialize the queue item status to disk.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBQueueItem.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/macosx/HBQueueItem.m b/macosx/HBQueueItem.m
index 3e993281f..9a24385a2 100644
--- a/macosx/HBQueueItem.m
+++ b/macosx/HBQueueItem.m
@@ -78,6 +78,7 @@ static NSString *versionKey = @"HBQueueItemVersion";
- (void)encodeWithCoder:(nonnull NSCoder *)coder
{
[coder encodeInt:1 forKey:versionKey];
+ encodeInt(_state);
encodeObject(_job);
encodeObject(_uuid);
}
@@ -88,6 +89,11 @@ static NSString *versionKey = @"HBQueueItemVersion";
if (version == 1 && (self = [super init]))
{
+ decodeInt(_state);
+ if (_state > HBQueueItemStateFailed)
+ {
+ goto fail;
+ }
decodeObjectOrFail(_job, HBJob);
decodeObjectOrFail(_uuid, NSString);
return self;