#include <QuartzCore/CALayer.h>
#include <WebCore/WebCoreThread.h>
-#include <WebKit/DOMHTMLIFrameElement.h>
#include <algorithm>
#include <fstream>
+ (Database *) sharedInstance;
- (unsigned) era;
+- (bool) hasPackages;
- (void) _readCydia:(NSNumber *)fd;
- (void) _readStatus:(NSNumber *)fd;
CFArrayRemoveAllValues(packages_);
}
+- (bool) hasPackages {
+ return CFArrayGetCount(packages_) != 0;
+}
+
- (void) dealloc {
// XXX: actually implement this thing
_assert(false);
}
- (NSString *) substitutePackageNames:(NSString *)message {
+ auto database([Database sharedInstance]);
+
+ // XXX: this check is less racy than you'd expect, but this entire concept is a little awkward
+ if (![database hasPackages])
+ return message;
+
NSMutableArray *words([[[message componentsSeparatedByString:@" "] mutableCopy] autorelease]);
for (size_t i(0), e([words count]); i != e; ++i) {
NSString *word([words objectAtIndex:i]);
- if (Package *package = [[Database sharedInstance] packageWithName:word])
+ if (Package *package = [database packageWithName:word])
[words replaceObjectAtIndex:i withObject:[package name]];
}
[self setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/#!/progress/", UI_]]];
- [scroller_ setBackgroundColor:[UIColor blackColor]];
+ [self setPageColor:[UIColor blackColor]];
[[self navigationItem] setHidesBackButton:YES];
[alert setNumberOfRows:1];
[alert addTextFieldWithValue:@"http://" label:@""];
- UITextInputTraits *traits = [[alert textField] textInputTraits];
+ NSObject<UITextInputTraits> *traits = [[alert textField] textInputTraits];
[traits setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[traits setAutocorrectionType:UITextAutocorrectionTypeNo];
[traits setKeyboardType:UIKeyboardTypeURL];
[super applicationSuspend];
}
-- (void) applicationSuspend:(__GSEvent *)event {
+- (void) applicationSuspend:(GSEventRef)event {
if ([self isSafeToSuspend])
[super applicationSuspend:event];
}