X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/21ac0ce2e7b9efaea52a836de3dabb74a9bb5d1e..299aeacd7d337a1e57ca14660a151f5a9fd453e2:/MobileCydia.mm diff --git a/MobileCydia.mm b/MobileCydia.mm index a68c4662..e0539fa0 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -1082,6 +1082,7 @@ typedef std::map< unsigned long, _H > SourceMap; - (Source *) getSource:(pkgCache::PkgFileIterator)file; - (void) setFetch:(bool)fetch forURI:(const char *)uri; +- (void) resetFetch; - (NSString *) mappedSectionForPointer:(const char *)pointer; @@ -1128,6 +1129,11 @@ class SourceStatus : } else (*item)->ID = 0; return ![delegate_ isSourceCancelled]; } + + virtual void Stop() { + pkgAcquireStatus::Stop(); + [database_ resetFetch]; + } }; /* }}} */ /* ProgressEvent Implementation {{{ */ @@ -1428,6 +1434,7 @@ static void PackageImport(const void *key, const void *value, void *context) { - (NSURL *) iconURL; - (void) setFetch:(bool)fetch forURI:(const char *)uri; +- (void) resetFetch; @end @@ -1759,6 +1766,11 @@ static void PackageImport(const void *key, const void *value, void *context) { [delegate_ performSelectorOnMainThread:@selector(setFetch:) withObject:[NSNumber numberWithBool:[self fetch]] waitUntilDone:NO]; } +- (void) resetFetch { + fetches_.clear(); + [delegate_ performSelectorOnMainThread:@selector(setFetch:) withObject:[NSNumber numberWithBool:NO] waitUntilDone:NO]; +} + @end /* }}} */ /* CydiaOperation Class {{{ */ @@ -3964,6 +3976,11 @@ class CydiaLogCleaner : [source setFetch:fetch forURI:uri]; } +- (void) resetFetch { + for (Source *source in (id) sourceList_) + [source resetFetch]; +} + - (NSString *) mappedSectionForPointer:(const char *)section { _H *mapped; @@ -8171,10 +8188,8 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi _H hud_; _H error_; - //NSURLConnection *installer_; NSURLConnection *trivial_bz2_; NSURLConnection *trivial_gz_; - //NSURLConnection *automatic_; BOOL cydia_; } @@ -8195,10 +8210,8 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi } - (void) dealloc { - //[self _releaseConnection:installer_]; [self _releaseConnection:trivial_gz_]; [self _releaseConnection:trivial_bz2_]; - //[self _releaseConnection:automatic_]; [super dealloc]; } @@ -8441,8 +8454,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi case 1: { NSString *href = [[alert textField] text]; - //installer_ = [[self _requestHRef:href method:@"GET"] retain]; - if (![href hasSuffix:@"/"]) href_ = [href stringByAppendingString:@"/"]; else @@ -8450,7 +8461,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi trivial_bz2_ = [[self _requestHRef:[href_ stringByAppendingString:@"Packages.bz2"] method:@"HEAD"] retain]; trivial_gz_ = [[self _requestHRef:[href_ stringByAppendingString:@"Packages.gz"] method:@"HEAD"] retain]; - //trivial_bz2_ = [[self _requestHRef:[href stringByAppendingString:@"dists/Release"] method:@"HEAD"] retain]; cydia_ = false;