add support for auto-updating to beta releases

This commit is contained in:
Mitchell Livingston
2009-01-11 16:58:14 +00:00
parent fd22f40917
commit 554088d322
10 changed files with 244 additions and 40 deletions

View File

@@ -31,6 +31,8 @@
#import "UKKQueue.h"
#import "utils.h"
#import <Sparkle/Sparkle.h>
#define DOWNLOAD_FOLDER 0
#define DOWNLOAD_TORRENT 2
@@ -139,6 +141,16 @@ tr_session * fHandle;
if (!fRPCWhitelistArray)
fRPCWhitelistArray = [[NSMutableArray arrayWithObject: @"127.0.0.1"] retain];
[self updateRPCWhitelist];
//reset old Sparkle settings from previous versions
[fDefaults removeObjectForKey: @"SUScheduledCheckInterval"];
if ([fDefaults objectForKey: @"CheckForUpdates"])
{
[[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates: [fDefaults boolForKey: @"CheckForUpdates"]];
[fDefaults removeObjectForKey: @"CheckForUpdates"];
}
[self updateAppcastURL: nil];
}
return self;
@@ -326,6 +338,17 @@ tr_session * fHandle;
TOOLBAR_PEERS, TOOLBAR_NETWORK, TOOLBAR_REMOTE, nil];
}
//for a beta release, always use the beta appcast
#if defined(BETA_RELEASE)
#define APPCAST_URL @"AppcastBeta"
#else
#define APPCAST_URL ([[NSUserDefaults standardUserDefaults] boolForKey: @"AutoUpdateBeta"] ? @"AppcastBeta" : @"AppcastRelease")
#endif
- (void) updateAppcastURL: (id) sender
{
[[SUUpdater sharedUpdater] setFeedURL: [NSURL URLWithString: [[[NSBundle mainBundle] infoDictionary] objectForKey: APPCAST_URL]]];
}
- (void) setPort: (id) sender
{
int port = [sender intValue];