From 8d7f5af91ae603ddfbddc0f926eed23cee2c1024 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 20 Mar 2011 03:59:02 -0700 Subject: Remove setCydiaSource(). --- MobileCydia.mm | 33 --------------------------------- Sources.mm | 6 +----- postinst.mm | 5 ----- 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 25215bd..847a269 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -707,7 +707,6 @@ static _transient NSMutableDictionary *Values_; static _transient NSMutableDictionary *Sections_; _H Sources_; static _transient NSNumber *Version_; -_H CydiaSource_; bool Changed_; static time_t now_; @@ -4097,8 +4096,6 @@ static _H Diversions_; return @"removeButton"; else if (selector == @selector(saveConfig)) return @"saveConfig"; - else if (selector == @selector(setCydiaSource:)) - return @"setCydiaSource"; else if (selector == @selector(setMetadataValue::)) return @"setMetadataValue"; else if (selector == @selector(setSessionValue::)) @@ -4213,25 +4210,6 @@ static _H Diversions_; return value; } -- (void) _setCydiaSource:(NSString *)source { - @synchronized (HostConfig_) { - CydiaSource_ = source; - [Metadata_ setObject:source forKey:@"CydiaSource"]; - } - - Changed_ = true; -} - -- (void) setCydiaSource:(NSString *)source { - [self performSelectorOnMainThread:@selector(_setCydiaSource:) withObject:source waitUntilDone:NO]; -} - -- (NSString *) cydiaSource { - @synchronized (HostConfig_) { - return (id) CydiaSource_ ?: [NSNull null]; - } -} - - (NSArray *) getMetadataKeys { @synchronized (Values_) { return [Values_ allKeys]; @@ -10262,10 +10240,6 @@ int main(int argc, char *argv[]) { Token_ = [Metadata_ objectForKey:@"Token"]; Version_ = [Metadata_ objectForKey:@"Version"]; - - @synchronized (HostConfig_) { - CydiaSource_ = [Metadata_ objectForKey:@"CydiaSource"]; - } } if (Settings_ != nil) @@ -10291,13 +10265,6 @@ int main(int argc, char *argv[]) { [Metadata_ setObject:Version_ forKey:@"Version"]; } - @synchronized (HostConfig_) { - if (CydiaSource_ == nil) { - CydiaSource_ = @"apt.saurik.com"; - [Metadata_ setObject:CydiaSource_ forKey:@"CydiaSource"]; - } - } - if ([Version_ unsignedIntValue] == 0) { CydiaAddSource(@"http://apt.thebigboss.org/repofiles/cydia/", @"stable", [NSMutableArray arrayWithObject:@"main"]); CydiaAddSource(@"http://apt.modmyi.com/", @"stable", [NSMutableArray arrayWithObject:@"main"]); diff --git a/Sources.mm b/Sources.mm index 79ae3d4..6073622 100644 --- a/Sources.mm +++ b/Sources.mm @@ -44,7 +44,6 @@ #include extern _H Sources_; -extern _H CydiaSource_; extern _H System_; extern bool Changed_; @@ -56,10 +55,7 @@ void CydiaWriteSources() { if (System_ != nil) distribution = [distribution stringByAppendingString:[NSString stringWithFormat:@"/%@", (id) System_]]; - fprintf(file, "deb http://%s/ %s main\n", - [CydiaSource_ UTF8String], - [distribution UTF8String] - ); + fprintf(file, "deb http://apt.saurik.com/ %s main\n", [distribution UTF8String]); for (NSString *key in [Sources_ allKeys]) { NSDictionary *source([Sources_ objectForKey:key]); diff --git a/postinst.mm b/postinst.mm index b11a9ac..70a87f1 100644 --- a/postinst.mm +++ b/postinst.mm @@ -8,7 +8,6 @@ #include "CyteKit/PerlCompatibleRegEx.hpp" _H Sources_; -_H CydiaSource_; bool Changed_; _H System_; @@ -30,15 +29,11 @@ int main(int argc, const char *argv[]) { if (metadata != nil) { Sources_ = [metadata objectForKey:@"Sources"]; - CydiaSource_ = [metadata objectForKey:@"CydiaSource"]; if (NSNumber *number = [metadata objectForKey:@"Version"]) version = [number unsignedIntValue]; } - if (CydiaSource_ == nil) - CydiaSource_ = @"apt.saurik.com"; - if (Sources_ == nil) Sources_ = [NSMutableDictionary dictionaryWithCapacity:8]; -- cgit v1.2.3