summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-05-14 03:19:09 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-05-14 03:20:43 -0700
commit9ed626f1f7add027a9b9ab4b7a56fa12172af0ec (patch)
tree2d1673d5849f21b68e32778989a68b64c006a20e
parent21ac0ce2e7b9efaea52a836de3dabb74a9bb5d1e (diff)
Force clear all source's fetches when fetch stops.
-rw-r--r--MobileCydia.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index a68c466..d2a1b76 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -1082,6 +1082,7 @@ typedef std::map< unsigned long, _H<Source> > 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<NSString> *mapped;