mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
add support for auto-updating to beta releases
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user