NSString *Simplify(NSString *title) {
const char *data = [title UTF8String];
- size_t size = [title length];
+ size_t size = [title lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
static Pcre square_r("^\\[(.*)\\]$");
if (square_r(data, size))
return false;
}
+ if ([tabbar_ modalViewController] != nil)
+ return false;
+
// Use external process status API internally.
// This is probably a really bad idea.
// XXX: what is the point of this? does this solve anything at all?
MSHook(BOOL, CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync, CFXPreferencesPropertyListSource *self, SEL _cmd) {
NSURL *&url(MSHookIvar<NSURL *>(self, "_url")), *old(url);
NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
+
url = MobilizeURL(url);
- BOOL value(_CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(self, _cmd));
- //NSLog(@"%@ %s", [url absoluteString], value ? "YES" : "NO");
- url = old;
+ BOOL value; @try {
+ value = _CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(self, _cmd);
+ //NSLog(@"CFX %@ %s", [url absoluteString], value ? "YES" : "NO");
+ } @finally {
+ url = old;
+ }
+
[pool release];
return value;
}
MSHook(void *, CFXPreferencesPropertyListSource$createPlistFromDisk, CFXPreferencesPropertyListSource *self, SEL _cmd) {
NSURL *&url(MSHookIvar<NSURL *>(self, "_url")), *old(url);
NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
+
url = MobilizeURL(url);
- void *value(_CFXPreferencesPropertyListSource$createPlistFromDisk(self, _cmd));
- //NSLog(@"%@ %@", [url absoluteString], value);
- url = old;
+ void *value; @try {
+ value = _CFXPreferencesPropertyListSource$createPlistFromDisk(self, _cmd);
+ //NSLog(@"CFX %@ %@", [url absoluteString], value);
+ } @finally {
+ url = old;
+ }
+
[pool release];
return value;
}
if (Method method = class_getInstanceMethod($WAKWindow, @selector(screenSize)))
method_setImplementation(method, (IMP) &$WAKWindow$screenSize);
- $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSource");
+ $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSourceSynchronizer");
+ if ($CFXPreferencesPropertyListSource == Nil)
+ $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSource");
Method CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(class_getInstanceMethod($CFXPreferencesPropertyListSource, @selector(_backingPlistChangedSinceLastSync)));
if (CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync != NULL) {