mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Add documentation to SPUSkippedUpdate
This commit is contained in:
1 parent
0ee12d881d
commit
a79f6b2a85
2 files changed
+9
No files matched your search
Vendored
+6
@@ -12,6 +12,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SUHost, SUAppcastItem;
|
||||
|
||||
/*
|
||||
A skipped update tracks the version and minimum autoupdate version the user skipped.
|
||||
Each minimum autoupdate version is tracked as a separate release / train.
|
||||
The intent is that a user choosing to skip a future major update chooses to skip that train's updates,
|
||||
but a user choosing to skip a minor update only chooses to skip updates equal or preceding that update.
|
||||
*/
|
||||
@interface SPUSkippedUpdate : NSObject
|
||||
|
||||
- (instancetype)initWithVersion:(NSString *)version minimumAutoupdateVersion:(nullable NSString *)minimumAutoupdateVersion;
|
||||
|
||||
Vendored
+3
@@ -42,6 +42,7 @@
|
||||
[components addObject:minimumAutoupdateVersion];
|
||||
}
|
||||
|
||||
// We encode the version and minimum autoupdate version in a human readable form with our own separator
|
||||
return [components componentsJoinedByString:SKIPPED_UPDATE_TAG_SEPARATOR];
|
||||
}
|
||||
|
||||
@@ -68,10 +69,12 @@
|
||||
{
|
||||
id skippedVersions = [host objectForUserDefaultsKey:SUSkippedVersionKey];
|
||||
if ([(NSObject *)skippedVersions isKindOfClass:[NSString class]]) {
|
||||
// Handle legacy skipped version format with just a single skipped version
|
||||
SPUSkippedUpdate *skippedUpdate = [SPUSkippedUpdate decodeSkippedUpdateFromString:skippedVersions];
|
||||
|
||||
return (skippedUpdate != nil) ? @[skippedUpdate] : @[];
|
||||
} else if ([(NSObject *)skippedVersions isKindOfClass:[NSArray class]]) {
|
||||
// Handle array of skipped updates
|
||||
NSMutableArray *skippedUpdates = [NSMutableArray array];
|
||||
for (id skippedUpdateObject in skippedVersions) {
|
||||
SPUSkippedUpdate *skippedUpdate = [SPUSkippedUpdate decodeSkippedUpdateFromString:skippedUpdateObject];
|
||||
|
||||
Reference in new issue
Block a user