From 0cd0a60cafe8b7a026eb82b6c49ab83dc507ac84 Mon Sep 17 00:00:00 2001 From: Craig Hockenberry Date: Sat, 2 Nov 2013 15:55:58 -0700 Subject: [PATCH] Sanding. --- Provisioning/GeneratePreviewForURL.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Provisioning/GeneratePreviewForURL.m b/Provisioning/GeneratePreviewForURL.m index bf6c9f6..6557e42 100644 --- a/Provisioning/GeneratePreviewForURL.m +++ b/Provisioning/GeneratePreviewForURL.m @@ -60,6 +60,7 @@ void displayKeyAndValue(NSUInteger level, NSString *key, id value, NSMutableStri } } +// all code in Mavericks needs to be signed, so we don't get some nice features... #define SIGNED_CODE 1 OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options) @@ -83,12 +84,13 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, if (! QLPreviewRequestIsCancelled(preview)) { #if !SIGNED_CODE +#if 1 // get the iOS devices that Xcode has seen, which only works if the plug-in is not running in a sandbox NSUserDefaults *xcodeDefaults = [NSUserDefaults new]; [xcodeDefaults addSuiteNamed:@"com.apple.dt.XCode"]; NSArray *savedDevices = [xcodeDefaults objectForKey:@"DVTSavediPhoneDevices"]; NSLog(@"savedDevices = %@", savedDevices); - +#else // the sandbox also thwarts attempts to read the data from the shell command // $ defaults read com.apple.dt.XCode DVTSavediPhoneDevices NSTask *task = [NSTask new]; @@ -100,6 +102,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, NSData *pipeData = [[[task standardOutput] fileHandleForReading] readDataToEndOfFile]; NSString *pipeString = [[NSString alloc] initWithData:pipeData encoding:NSUTF8StringEncoding]; NSLog(@"pipeString = %@", pipeString); +#endif #endif NSURL *htmlURL = [[NSBundle bundleWithIdentifier:@"com.iconfactory.Provisioning"] URLForResource:@"template" withExtension:@"html"];