]> git.sesse.net Git - vlc/commitdiff
macosx: bump plist version to avoid exceptions when upgrading from 2.0.x or 2.1-git
authorFelix Paul Kühne <fkuehne@videolan.org>
Fri, 17 May 2013 21:19:36 +0000 (23:19 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Fri, 17 May 2013 21:19:36 +0000 (23:19 +0200)
No explicit settings performed by the user are affected, so most won't notice except for reset window positions

modules/gui/macosx/intf.m

index a42a22b34b09b182f9a85a970bbd21797dfe4622..c07c779ee41eeebed963d186e951830e9bebf840 100644 (file)
@@ -1871,7 +1871,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 - (void)removeOldPreferences
 {
     static NSString * kVLCPreferencesVersion = @"VLCPreferencesVersion";
-    static const int kCurrentPreferencesVersion = 2;
+    static const int kCurrentPreferencesVersion = 3;
     NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
     int version = [defaults integerForKey:kVLCPreferencesVersion];
     if (version >= kCurrentPreferencesVersion)
@@ -1885,6 +1885,13 @@ static VLCMain *_o_sharedMainInstance = nil;
             return;
         else
             config_SaveConfigFile(VLCIntf); // we need to do manually, since we won't quit libvlc cleanly
+    } else if (version == 2) {
+        /* version 2 (used by VLC 2.0.x and early versions of 2.1) can lead to exceptions within 2.1 or later
+         * so we reset the OS X specific prefs here - in practice, no user will notice */
+        [NSUserDefaults resetStandardUserDefaults];
+
+        [defaults setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion];
+        [defaults synchronize];
     } else {
         NSArray *libraries = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
             NSUserDomainMask, YES);