From b183dc8e884920228ca1e626a91cce0ea48a6297 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Tue, 12 Feb 2019 09:28:09 +0100 Subject: MacGui: serialize the queue item status to disk. --- macosx/HBQueueItem.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'macosx/HBQueueItem.m') 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; -- cgit v1.2.3