mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Mark SPUUpdater with nullability annotations
This commit is contained in:
1 parent
f2713138b9
commit
bdd2b7571b
8 files changed
+24
-11
No files matched your search
Vendored
+8
-4
@@ -14,6 +14,8 @@
|
||||
#import "SUExport.h"
|
||||
#import "SPUUserDriver.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SUAppcastItem, SUAppcast;
|
||||
|
||||
@protocol SUUpdaterDelegate;
|
||||
@@ -43,7 +45,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
*
|
||||
* This must be called on the main thread.
|
||||
*/
|
||||
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle userDriver:(id <SPUUserDriver>)userDriver delegate:(id <SUUpdaterDelegate>)delegate;
|
||||
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle userDriver:(id <SPUUserDriver>)userDriver delegate:(id<SUUpdaterDelegate> _Nullable)delegate;
|
||||
|
||||
/*!
|
||||
* Starts the updater.
|
||||
@@ -58,7 +60,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
*/
|
||||
- (BOOL)startUpdater:(NSError * __autoreleasing *)error;
|
||||
|
||||
@property (weak, readonly) id<SUUpdaterDelegate> delegate;
|
||||
@property (weak, readonly, nullable) id<SUUpdaterDelegate> delegate;
|
||||
@property (nonatomic, readonly) id<SPUUserDriver> userDriver;
|
||||
|
||||
@property (readonly, strong) NSBundle *hostBundle;
|
||||
@@ -77,7 +79,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *userAgentString;
|
||||
|
||||
@property (copy) NSDictionary *httpHeaders;
|
||||
@property (copy, nullable) NSDictionary *httpHeaders;
|
||||
|
||||
@property (nonatomic) BOOL sendsSystemProfile;
|
||||
|
||||
@@ -108,7 +110,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
|
||||
\returns \c nil if no check has been performed.
|
||||
*/
|
||||
@property (readonly, copy) NSDate *lastUpdateCheckDate;
|
||||
@property (readonly, copy, nullable) NSDate *lastUpdateCheckDate;
|
||||
|
||||
/*!
|
||||
Begins a "probing" check for updates which will not actually offer to
|
||||
@@ -131,3 +133,5 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
- (void)resetUpdateCycle;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+10
-1
@@ -658,7 +658,16 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
NSString *version = [self.sparkleBundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey];
|
||||
NSString *userAgent = [NSString stringWithFormat:@"%@/%@ Sparkle/%@", [self.host name], [self.host displayVersion], version ? version : @"?"];
|
||||
NSData *cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
|
||||
return [[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding];
|
||||
|
||||
NSString *result = @"";
|
||||
if (cleanedAgent != nil) {
|
||||
NSString *cleanedAgentString = [[NSString alloc] initWithData:(NSData * _Nonnull)cleanedAgent encoding:NSASCIIStringEncoding];
|
||||
if (cleanedAgentString != nil) {
|
||||
result = cleanedAgentString;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile
|
||||
|
||||
Vendored
+1
-1
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host updater:(id)updater updaterDelegate:(nullable id <SUUpdaterDelegate>)updaterDelegate delegate:(nullable id <SUAppcastDriverDelegate>)delegate;
|
||||
|
||||
- (void)loadAppcastFromURL:(NSURL *)appcastURL userAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates;
|
||||
- (void)loadAppcastFromURL:(NSURL *)appcastURL userAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates;
|
||||
|
||||
@property (nullable, nonatomic, readonly) SUAppcastItem *nonDeltaUpdateItem;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -52,7 +52,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)loadAppcastFromURL:(NSURL *)appcastURL userAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates
|
||||
- (void)loadAppcastFromURL:(NSURL *)appcastURL userAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates
|
||||
{
|
||||
self.userAgent = userAgent;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host updater:(id)updater updaterDelegate:(nullable id <SUUpdaterDelegate>)updaterDelegate delegate:(id <SUBasicUpdateDriverDelegate>)delegate;
|
||||
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock;
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -56,7 +56,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock
|
||||
{
|
||||
self.completionBlock = completionBlock;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock
|
||||
{
|
||||
[self.basicDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO completion:completionBlock];
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ typedef void (^SUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SUDow
|
||||
|
||||
@protocol SUUpdateDriver <NSObject>
|
||||
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock;
|
||||
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
|
||||
Reference in new issue
Block a user