summaryrefslogtreecommitdiffstats
path: root/macosx/HBDistributedArray.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2018-07-10 20:06:09 +0200
committerDamiano Galassi <[email protected]>2018-07-10 20:06:09 +0200
commitf6a000f1c97f4aa0e4fc6f7751dc5bedb8e3a0bf (patch)
tree966d59d56302aae46ac334d0e2939058ed9ac0e4 /macosx/HBDistributedArray.m
parent44d7c56f5551c2b862811c70ae457fd5f2a5c797 (diff)
MacGui: remove a bunch of unneeded compatibility code.
Diffstat (limited to 'macosx/HBDistributedArray.m')
-rw-r--r--macosx/HBDistributedArray.m24
1 files changed, 5 insertions, 19 deletions
diff --git a/macosx/HBDistributedArray.m b/macosx/HBDistributedArray.m
index 266382166..f92abfdf5 100644
--- a/macosx/HBDistributedArray.m
+++ b/macosx/HBDistributedArray.m
@@ -60,7 +60,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
@property (nonatomic, readwrite) NSTimeInterval modifiedTime;
@property (nonatomic, readonly) NSSet *objectClasses;
-@property (nonatomic, readonly) BOOL requiresSecureCoding;
@property (nonatomic, readonly) sem_t *mutex;
@property (nonatomic, readwrite) uint32_t mutexCount;
@@ -78,12 +77,6 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
_array = [[NSMutableArray alloc] init];
_objectClasses = [NSSet setWithObjects:[NSMutableArray class], objectClass, nil];
- // Enable secure coding only on 10.9 and later
- if ([NSURL instancesRespondToSelector:@selector(fileSystemRepresentation)])
- {
- _requiresSecureCoding = YES;
- }
-
NSString *identifier = [[NSBundle mainBundle] bundleIdentifier];
NSArray *runningInstances = [NSRunningApplication runningApplicationsWithBundleIdentifier:identifier];
const char *name = [NSString stringWithFormat:@"%@/%@", identifier, _fileURL.lastPathComponent.stringByDeletingPathExtension].UTF8String;
@@ -204,18 +197,11 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
NSMutableArray *jobsArray = nil;
@try
{
- if (self.requiresSecureCoding)
- {
- NSData *queue = [NSData dataWithContentsOfURL:self.fileURL];
- NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue];
- unarchiver.requiresSecureCoding = YES;
- jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey];
- [unarchiver finishDecoding];
- }
- else
- {
- jobsArray = [NSKeyedUnarchiver unarchiveObjectWithFile:self.fileURL.path];
- }
+ NSData *queue = [NSData dataWithContentsOfURL:self.fileURL];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue];
+ unarchiver.requiresSecureCoding = YES;
+ jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey];
+ [unarchiver finishDecoding];
}
@catch (NSException *exception)
{