#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]);
}
}
+- (void) tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath {
+ [self updateButtonsForEditingStatusAnimated:YES];
+}
+
- (void) complete {
[delegate_ addTrivialSource:href_];
href_ = nil;
case 1: {
NSString *href = [[alert textField] text];
+ 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:@"/"];
else
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();