[vlc-commits] macosx: when resetting VLC's config in the prefs panels, also reset the OS X specific NSDefaults

Felix Paul Kühne git at videolan.org
Sun Aug 26 14:30:43 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Aug 26 14:30:31 2012 +0200| [85a9ef4fcb2019f29504900fdb104a60ec995f65] | committer: Felix Paul Kühne

macosx: when resetting VLC's config in the prefs panels, also reset the OS X specific NSDefaults

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=85a9ef4fcb2019f29504900fdb104a60ec995f65
---

 modules/gui/macosx/prefs.m        |    6 ++++++
 modules/gui/macosx/simple_prefs.m |    5 +++++
 2 files changed, 11 insertions(+)

diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m
index ae4812b..0db47bc 100644
--- a/modules/gui/macosx/prefs.m
+++ b/modules/gui/macosx/prefs.m
@@ -240,8 +240,14 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 {
     if( i_return == NSAlertAlternateReturn )
     {
+        /* reset VLC's config */
         config_ResetAll( p_intf );
         [_rootTreeItem resetView];
+        config_SaveConfigFile( p_intf );
+
+        /* reset OS X defaults */
+        [NSUserDefaults resetStandardUserDefaults];
+        [[NSUserDefaults standardUserDefaults] synchronize];
     }
 }
 
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index e372a07..f2357f1 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -742,9 +742,14 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
 {
     if( i_return == NSAlertAlternateReturn )
     {
+        /* reset VLC's config */
         config_ResetAll( p_intf );
         [self resetControls];
         config_SaveConfigFile( p_intf );
+
+        /* reset OS X defaults */
+        [NSUserDefaults resetStandardUserDefaults];
+        [[NSUserDefaults standardUserDefaults] synchronize];
     }
 }
 



More information about the vlc-commits mailing list