diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-18 17:10:59 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-18 17:10:59 -0800 |
commit | 4ba8f30aea8b6c587ebb4d241a3324630c1496f1 (patch) | |
tree | 2ea50940fe79c0791b4d955bfbc6f28ed18357d0 | |
parent | 45447dc330ae258caf674d1895fe2db6d38cff02 (diff) |
Allow an invocation during reloading data.
-rw-r--r-- | MobileCydia.mm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 4a9ba45..133fbcf 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -1156,6 +1156,7 @@ bool isSectionVisible(NSString *section) { - (void) removeProgressHUD:(UIProgressHUD *)hud; - (CYViewController *) pageForPackage:(NSString *)name; - (void) showActionSheet:(UIActionSheet *)sheet fromItem:(UIBarButtonItem *)item; +- (void) reloadDataWithInvocation:(NSInvocation *)invocation; @end static id<CydiaDelegate> CydiaApp; @@ -1335,7 +1336,7 @@ typedef std::map< unsigned long, _H<Source> > SourceMap; - (NSArray *) packages; - (NSArray *) sources; - (Source *) sourceWithKey:(NSString *)key; -- (void) reloadData; +- (void) reloadDataWithInvocation:(NSInvocation *)invocation; - (void) configure; - (bool) prepare; @@ -3438,7 +3439,7 @@ static NSString *Warning_; return [self popErrorWithTitle:title] || !success; } -- (void) reloadData { CYPoolStart() { +- (void) reloadDataWithInvocation:(NSInvocation *)invocation { CYPoolStart() { @synchronized (self) { ++era_; @@ -3474,6 +3475,9 @@ static NSString *Warning_; if (chk != -1) close(chk); + if (invocation != nil) + [invocation invoke]; + NSString *title(UCLocalize("DATABASE")); _trace(); @@ -8812,11 +8816,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [NSThread detachNewThreadSelector:@selector(_refreshIfPossible) toTarget:self withObject:nil]; } -- (void) _reloadData { +- (void) _reloadDataWithInvocation:(NSInvocation *)invocation { UIProgressHUD *hud(loaded_ ? [self addProgressHUD] : nil); [hud setText:UCLocalize("RELOADING_DATA")]; - [database_ yieldToSelector:@selector(reloadData) withObject:nil]; + [database_ yieldToSelector:@selector(reloadDataWithInvocation:) withObject:invocation]; if (hud != nil) [self removeProgressHUD:hud]; @@ -8898,12 +8902,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { ]; } -- (void) reloadData { +- (void) reloadDataWithInvocation:(NSInvocation *)invocation { @synchronized (self) { - [self _reloadData]; + [self _reloadDataWithInvocation:invocation]; } } +- (void) reloadData { + [self reloadDataWithInvocation:nil]; +} + - (void) resolve { pkgProblemResolver *resolver = [database_ resolver]; @@ -8984,7 +8992,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) complete { @synchronized (self) { - [self _reloadData]; + [self _reloadDataWithInvocation:nil]; } } |