Commit 1feca0de authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: check for updates only every seven days

additionally, save the user's selection to check for updates as soon as it is changed, so we don't ask multiple times in case of a crash
parent d03dc723
...@@ -36,7 +36,7 @@ static NSString * kPrefUpdateOnStartup = @"UpdateOnStartup"; ...@@ -36,7 +36,7 @@ static NSString * kPrefUpdateOnStartup = @"UpdateOnStartup";
static NSString * kPrefUpdateLastTimeChecked = @"UpdateLastTimeChecked"; static NSString * kPrefUpdateLastTimeChecked = @"UpdateLastTimeChecked";
/***************************************************************************** /*****************************************************************************
* VLCExtended implementation * VLCUpdate implementation
*****************************************************************************/ *****************************************************************************/
@implementation VLCUpdate @implementation VLCUpdate
...@@ -85,6 +85,9 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -85,6 +85,9 @@ static VLCUpdate *_o_sharedInstance = nil;
{ {
[[NSUserDefaults standardUserDefaults] setBool: check forKey: kPrefUpdateOnStartup]; [[NSUserDefaults standardUserDefaults] setBool: check forKey: kPrefUpdateOnStartup];
[o_chk_updateOnStartup setState: check]; [o_chk_updateOnStartup setState: check];
/* make sure we got this set, even if we crash later on */
[[NSUserDefaults standardUserDefaults] synchronize];
} }
- (BOOL)shouldCheckForUpdate - (BOOL)shouldCheckForUpdate
...@@ -107,7 +110,7 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -107,7 +110,7 @@ static VLCUpdate *_o_sharedInstance = nil;
if( !o_last_update ) if( !o_last_update )
return YES; return YES;
o_next_update = [[[NSDate alloc] initWithTimeInterval: 60*60*24*2 /* every two days */ sinceDate: o_last_update] autorelease]; o_next_update = [[[NSDate alloc] initWithTimeInterval: 60*60*24*7 /* every seven days */ sinceDate: o_last_update] autorelease];
if( !o_next_update ) if( !o_next_update )
return YES; return YES;
......
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