mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
53 lines
1.4 KiB
Objective-C
53 lines
1.4 KiB
Objective-C
//
|
|
// SPUInstallationInfo.m
|
|
// Sparkle
|
|
//
|
|
// Created by Mayur Pawashe on 4/10/16.
|
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
|
//
|
|
|
|
#import "SPUInstallationInfo.h"
|
|
#import "SUAppcastItem.h"
|
|
|
|
static NSString *SUAppcastItemKey = @"SUAppcastItem";
|
|
static NSString *SUCanSilentlyInstallKey = @"SUCanSilentlyInstall";
|
|
|
|
@implementation SPUInstallationInfo
|
|
|
|
@synthesize appcastItem = _appcastItem;
|
|
@synthesize canSilentlyInstall = _canSilentlyInstall;
|
|
|
|
- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem canSilentlyInstall:(BOOL)canSilentlyInstall
|
|
{
|
|
self = [super init];
|
|
if (self != nil) {
|
|
_appcastItem = appcastItem;
|
|
_canSilentlyInstall = canSilentlyInstall;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (nullable instancetype)initWithCoder:(NSCoder *)decoder
|
|
{
|
|
SUAppcastItem *appcastItem = [decoder decodeObjectOfClass:[SUAppcastItem class] forKey:SUAppcastItemKey];
|
|
if (appcastItem == nil) {
|
|
return nil;
|
|
}
|
|
|
|
BOOL canSilentlyInstall = [decoder decodeBoolForKey:SUCanSilentlyInstallKey];
|
|
return [self initWithAppcastItem:appcastItem canSilentlyInstall:canSilentlyInstall];
|
|
}
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)coder
|
|
{
|
|
[coder encodeObject:self.appcastItem forKey:SUAppcastItemKey];
|
|
[coder encodeBool:self.canSilentlyInstall forKey:SUCanSilentlyInstallKey];
|
|
}
|
|
|
|
+ (BOOL)supportsSecureCoding
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
@end
|