#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;
char version_[8];
char name_[];
-};
+} _packed;
struct MetaValue :
Cytore::Block
{
uint32_t active_;
Cytore::Offset<PackageValue> packages_[1 << 16];
-};
+} _packed;
static Cytore::File<MetaValue> MetaFile_;
// }}}
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];
[Sources_ removeObjectForKey:[source key]];
- [delegate_ _saveConfig];
- [delegate_ reloadDataWithInvocation:nil];
+ [delegate_ syncData];
}
}
[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];
- (void) reloadSpringBoard {
if (kCFCoreFoundationVersionNumber >= 700) // XXX: iOS 6.x
- system("/bin/launchctl stop com.apple.backboardd");
+ system("/usr/libexec/cydia/cydo /bin/launchctl stop com.apple.backboardd");
else
- system("/bin/launchctl stop com.apple.SpringBoard");
+ system("/usr/libexec/cydia/cydo /bin/launchctl stop com.apple.SpringBoard");
sleep(15);
system("/usr/bin/killall backboardd SpringBoard");
}
[super applicationSuspend];
}
-- (void) applicationSuspend:(__GSEvent *)event {
+- (void) applicationSuspend:(GSEventRef)event {
if ([self isSafeToSuspend])
[super applicationSuspend:event];
}