Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f88d16b2
Commit
f88d16b2
authored
Nov 21, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: correctly reset interface preferences when requested
parent
988ba5e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+3
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+17
-5
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+1
-2
No files found.
modules/gui/macosx/intf.h
View file @
f88d16b2
...
...
@@ -180,6 +180,9 @@ struct intf_sys_t
-
(
void
)
updateTogglePlaylistState
;
-
(
void
)
mediaKeyTap
:(
SPMediaKeyTap
*
)
keyTap
receivedMediaKeyEvent
:(
NSEvent
*
)
event
;
-
(
void
)
resetAndReinitializeUserDefaults
;
@end
...
...
modules/gui/macosx/intf.m
View file @
f88d16b2
...
...
@@ -1685,10 +1685,24 @@ static VLCMain *_o_sharedMainInstance = nil;
#pragma mark -
#pragma mark Remove old prefs
static
NSString
*
kVLCPreferencesVersion
=
@"VLCPreferencesVersion"
;
static
const
int
kCurrentPreferencesVersion
=
3
;
-
(
void
)
resetAndReinitializeUserDefaults
{
// note that [NSUserDefaults resetStandardUserDefaults] will NOT correctly reset to the defaults
NSString
*
appDomain
=
[[
NSBundle
mainBundle
]
bundleIdentifier
];
[[
NSUserDefaults
standardUserDefaults
]
removePersistentDomainForName
:
appDomain
];
// set correct version to avoid question about outdated config
[[
NSUserDefaults
standardUserDefaults
]
setInteger
:
kCurrentPreferencesVersion
forKey
:
kVLCPreferencesVersion
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
}
-
(
void
)
removeOldPreferences
{
static
NSString
*
kVLCPreferencesVersion
=
@"VLCPreferencesVersion"
;
static
const
int
kCurrentPreferencesVersion
=
3
;
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
int
version
=
[
defaults
integerForKey
:
kVLCPreferencesVersion
];
if
(
version
>=
kCurrentPreferencesVersion
)
...
...
@@ -1705,10 +1719,8 @@ static VLCMain *_o_sharedMainInstance = nil;
}
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
resetStandard
UserDefaults
];
[
self
resetAndReinitialize
UserDefaults
];
[
defaults
setInteger
:
kCurrentPreferencesVersion
forKey
:
kVLCPreferencesVersion
];
[
defaults
synchronize
];
}
else
{
NSArray
*
libraries
=
NSSearchPathForDirectoriesInDomains
(
NSLibraryDirectory
,
NSUserDomainMask
,
YES
);
...
...
modules/gui/macosx/simple_prefs.m
View file @
f88d16b2
...
...
@@ -861,8 +861,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
config_SaveConfigFile
(
p_intf
);
/* reset OS X defaults */
[
NSUserDefaults
resetStandardUserDefaults
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[[
VLCMain
sharedInstance
]
resetAndReinitializeUserDefaults
];
/* Relaunch now */
const
char
*
path
=
[[[
NSBundle
mainBundle
]
executablePath
]
UTF8String
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment