summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-20 03:59:02 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-20 03:59:02 -0700
commit8d7f5af91ae603ddfbddc0f926eed23cee2c1024 (patch)
treee78765a603a159b55c78c324b19abf42b773ae99
parent407564b5683493323368fbbb22850d67b47e4743 (diff)
Remove setCydiaSource().
-rw-r--r--MobileCydia.mm33
-rw-r--r--Sources.mm6
-rw-r--r--postinst.mm5
3 files changed, 1 insertions, 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<NSMutableDictionary> Sources_;
static _transient NSNumber *Version_;
-_H<NSString> CydiaSource_;
bool Changed_;
static time_t now_;
@@ -4097,8 +4096,6 @@ static _H<NSMutableSet> 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<NSMutableSet> 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 <cstdio>
extern _H<NSMutableDictionary> Sources_;
-extern _H<NSString> CydiaSource_;
extern _H<NSString> 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<NSMutableDictionary> Sources_;
-_H<NSString> CydiaSource_;
bool Changed_;
_H<NSString> 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];