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;
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 */
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0];
/* really reset the defaults from now on */
[NSUserDefaults resetStandardUserDefaults];
/* Move the file to trash one by one. Using above array the method would stop after first file
not found. */
for (NSString *file in ourPreferences) {
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:@"" files:[NSArray arrayWithObject:file] tag:nil];
}
[defaults setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion];
[defaults synchronize];
[self resetAndReinitializeUserDefaults];
}
/* 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