File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ - (void)calculateUpgradeState {
87
87
[self setUpgradeState: upgradeState] ;
88
88
if ([self upgradeState ] != SSYCurrentRev) {
89
89
// Get a nice, clean, filtered versionString of the form "major.minor.bugFix" using SSVersionTriplet methods
90
- SSYVersionTriplet* currentVersionTriplet = [SSYVersionTriplet versionTripletFromBundleIdentifier: [[ NSBundle mainAppBundle ] bundleIdentifier ]] ;
90
+ SSYVersionTriplet* currentVersionTriplet = [SSYVersionTriplet versionTripletFromBundle: [ NSBundle mainAppBundle ]] ;
91
91
NSString * currentVersionString = [currentVersionTriplet string ] ;
92
92
93
93
// Record currently-launched version into prefs
@@ -124,4 +124,4 @@ + (void)calculateUpgradeState {
124
124
}
125
125
126
126
127
- @end
127
+ @end
Original file line number Diff line number Diff line change @@ -82,14 +82,16 @@ typedef struct SSYVersionStruct_struct SSYVersionStruct ;
82
82
*/
83
83
+ (SSYVersionTriplet*)versionTripletFromString : (NSString *)versionString ;
84
84
85
+ + (SSYVersionTriplet*)versionTripletFromBundle : (NSBundle *)bundle ;
86
+
85
87
/* !
86
88
@brief Returns an autoreleased version triplet from a bundle
87
89
@details Version number string is found as described in
88
90
rawVersionTripletFromBundleIdentifier: and then version numbers in triplet are parsed
89
91
as described in versionTripletFromString:
90
92
91
93
@details This function is not reliable because it relies on -rawVersionStringFromBundleIdentifier
92
- which is also not reliable. If you've got the bundle, use +rawVersionStringFromBundle : instead.
94
+ which is also not reliable. If you've got the bundle, use +versionTripletFromBundle : instead.
93
95
@param bundleIdentifier The bundle identifier of the target bundle
94
96
@result An autoreleased version triplet, or nil.
95
97
*/
Original file line number Diff line number Diff line change @@ -77,6 +77,11 @@ + (SSYVersionTriplet*)versionTripletFromString:(NSString*)versionString {
77
77
return versionTriplet ;
78
78
}
79
79
80
+ + (SSYVersionTriplet*)versionTripletFromBundle : (NSBundle *)bundle {
81
+ NSString * versionString = [self rawVersionStringFromBundle: bundle] ;
82
+ return [self versionTripletFromString: versionString] ;
83
+ }
84
+
80
85
+ (SSYVersionTriplet*)versionTripletFromBundleIdentifier : (NSString *)bundleIdentifier {
81
86
NSString * versionString = [self rawVersionStringFromBundleIdentifier: bundleIdentifier] ;
82
87
return [self versionTripletFromString: versionString] ;
@@ -210,4 +215,4 @@ + (NSString*)cleanVersionStringFromBundleIdentifier:(NSString*)bundleIdentifier
210
215
return [vt string ] ;
211
216
}
212
217
213
- @end
218
+ @end
You can’t perform that action at this time.
0 commit comments