mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix migration window showed up every time
This commit is contained in:
parent
d7fd06a681
commit
0685b3eb87
@ -11,6 +11,11 @@ develop
|
||||
- Add “geojson” to extension list.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue under the specific conditions where the migration window showed up every time on launch.
|
||||
|
||||
|
||||
|
||||
2.2.1 (75)
|
||||
--------------------------
|
||||
|
@ -957,7 +957,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>cEd1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>76a</string>
|
||||
<string>76</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
|
@ -957,7 +957,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>cEd1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>76a</string>
|
||||
<string>76</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
|
@ -382,8 +382,15 @@
|
||||
// >= 2.2.0 : Single Integer
|
||||
NSString *lastVersion = [[NSUserDefaults standardUserDefaults] stringForKey:CEDefaultLastVersionKey];
|
||||
NSString *thisVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
|
||||
|
||||
BOOL isDigit = lastVersion && [lastVersion rangeOfString:@"^[\\d]+$" options:NSRegularExpressionSearch].location != NSNotFound;
|
||||
if (isDigit && [thisVersion integerValue] > [lastVersion integerValue]) {
|
||||
BOOL isPreRelease = lastVersion && [lastVersion rangeOfString:@"^[\\d]+[a-z]+[\\d]?$" options:NSRegularExpressionSearch].location != NSNotFound;
|
||||
// -> [@"100b3" integerValue] is 100
|
||||
|
||||
if ((!lastVersion) || // first launch
|
||||
(!isDigit && !isPreRelease) || // probably semver (semver must be older than 2.2.0)
|
||||
((isDigit || isPreRelease) && ([thisVersion integerValue] > [lastVersion integerValue]))) // normal integer or Sparkle-style pre-release
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:thisVersion forKey:CEDefaultLastVersionKey];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user