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.
NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc", @"VLC", nil];
/* Move the file to trash so that user can find them later */ /* Move the file to trash one by one. Using above array the method would stop after first file
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0]; not found. */
for (NSString *file in ourPreferences) {
/* really reset the defaults from now on */ [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:@"" files:[NSArray arrayWithObject:file] tag:nil];
[NSUserDefaults resetStandardUserDefaults]; }
[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