- (Source *) getSource:(pkgCache::PkgFileIterator)file;
- (void) setFetch:(bool)fetch forURI:(const char *)uri;
+- (void) resetFetch;
- (NSString *) mappedSectionForPointer:(const char *)pointer;
} else (*item)->ID = 0;
return ![delegate_ isSourceCancelled];
}
+
+ virtual void Stop() {
+ pkgAcquireStatus::Stop();
+ [database_ resetFetch];
+ }
};
/* }}} */
/* ProgressEvent Implementation {{{ */
- (NSURL *) iconURL;
- (void) setFetch:(bool)fetch forURI:(const char *)uri;
+- (void) resetFetch;
@end
[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 {{{ */
[source setFetch:fetch forURI:uri];
}
+- (void) resetFetch {
+ for (Source *source in (id) sourceList_)
+ [source resetFetch];
+}
+
- (NSString *) mappedSectionForPointer:(const char *)section {
_H<NSString> *mapped;
_H<UIProgressHUD> hud_;
_H<NSError> error_;
- //NSURLConnection *installer_;
NSURLConnection *trivial_bz2_;
NSURLConnection *trivial_gz_;
- //NSURLConnection *automatic_;
BOOL cydia_;
}
}
- (void) dealloc {
- //[self _releaseConnection:installer_];
[self _releaseConnection:trivial_gz_];
[self _releaseConnection:trivial_bz2_];
- //[self _releaseConnection:automatic_];
[super dealloc];
}
}
}
+- (void) tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath {
+ [self updateButtonsForEditingStatusAnimated:YES];
+}
+
- (void) complete {
[delegate_ addTrivialSource:href_];
href_ = nil;
case 1: {
NSString *href = [[alert textField] text];
- //installer_ = [[self _requestHRef:href method:@"GET"] retain];
+ static Pcre href_r("^http(s?)://[^# ]*$");
+ if (!href_r(href)) {
+ UIAlertView *alert = [[[UIAlertView alloc]
+ initWithTitle:Error_
+ message:UCLocalize("INVALID_URL")
+ delegate:self
+ cancelButtonTitle:UCLocalize("OK")
+ otherButtonTitles:nil
+ ] autorelease];
+
+ [alert setContext:@"badurl"];
+ [alert show];
+
+ break;
+ }
if (![href hasSuffix:@"/"])
href_ = [href stringByAppendingString:@"/"];
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;
Changed_ = true;
}
+
+ _H<NSMutableArray> broken([NSMutableArray array]);
+ for (NSString *key in (id) Sources_)
+ if ([key rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"# "]].location != NSNotFound)
+ [broken addObject:key];
+ if ([broken count] != 0) {
+ for (NSString *key in (id) broken)
+ [Sources_ removeObjectForKey:key];
+ Changed_ = true;
+ } broken = nil;
/* }}} */
CydiaWriteSources();