From: Jay Freeman (saurik) Date: Wed, 14 May 2014 10:19:09 +0000 (-0700) Subject: Force clear all source's fetches when fetch stops. X-Git-Tag: v1.1.10~72 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/9ed626f1f7add027a9b9ab4b7a56fa12172af0ec?hp=21ac0ce2e7b9efaea52a836de3dabb74a9bb5d1e Force clear all source's fetches when fetch stops. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index a68c4662..d2a1b76f 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;