#include <CoreFoundation/CFInternal.h>
#endif
-#include <CoreFoundation/CFPriv.h>
#include <CoreFoundation/CFUniChar.h>
#include <SystemConfiguration/SystemConfiguration.h>
}
- (bool) isInstalledAndUnfiltered:(NSNumber *)number {
- return ![self uninstalled] && (![number boolValue] && role_ != 7 || [self unfiltered]);
+ return ![self uninstalled] && role_ <= ([number boolValue] ? 1 : 3);
}
- (bool) isVisibleInSection:(NSString *)name source:(Source *)source {
reason = @"virtual";
}
- NSDictionary *version(start.TargetVer() == 0 ? [NSNull null] : [NSDictionary dictionaryWithObjectsAndKeys:
+ NSDictionary *version(start.TargetVer() == 0 ? (NSDictionary *) [NSNull null] : [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithUTF8String:start.CompType()], @"operator",
[NSString stringWithUTF8String:start.TargetVer()], @"value",
nil]);
section_ = [section localized];
name_ = section_ == nil || [section_ length] == 0 ? UCLocalize("NO_SECTION") : (NSString *) section_;
- count_ = [NSString stringWithFormat:@"%d", [section count]];
+ count_ = [NSString stringWithFormat:@"%zd", [section count]];
if (editing_)
[switch_ setOn:(isSectionVisible(basic_) ? 1 : 0) animated:NO];
}
- (void) beginUpdate {
+ if (updating_)
+ return;
+
UIViewController *controller([[self viewControllers] objectAtIndex:1]);
UITabBarItem *item([controller tabBarItem]);
_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();