Commit a87c668e authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix preferences reset if unknown version was found

parent dd4fe674
...@@ -1742,16 +1742,17 @@ static const int kCurrentPreferencesVersion = 3; ...@@ -1742,16 +1742,17 @@ static const int kCurrentPreferencesVersion = 3;
return; return;
} }
NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc.plist", @"VLC", @"org.videolan.vlc", nil]; // Do NOT add the current plist file here as this would conflict with caching.
// Instead, just reset below.
/* Move the file to trash so that user can find them later */ NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc", @"VLC", nil];
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0];
/* Move the file to trash one by one. Using above array the method would stop after first file
/* really reset the defaults from now on */ not found. */
[NSUserDefaults resetStandardUserDefaults]; for (NSString *file in ourPreferences) {
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:@"" files:[NSArray arrayWithObject:file] tag:nil];
}
[defaults setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion]; [self resetAndReinitializeUserDefaults];
[defaults synchronize];
} }
/* Relaunch now */ /* Relaunch now */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment