From 32edb11f80893a8053c8943d15c44fc8479b10db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Tue, 8 Apr 2014 17:40:14 +0200 Subject: [PATCH 1/5] Use DEVELOPER_DIR instead of SYSTEM_APPS_DIR This fixes compilation if Xcode was renamed. --- Polychromatic.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polychromatic.xcodeproj/project.pbxproj b/Polychromatic.xcodeproj/project.pbxproj index 0edb710..7bd44e6 100644 --- a/Polychromatic.xcodeproj/project.pbxproj +++ b/Polychromatic.xcodeproj/project.pbxproj @@ -361,8 +361,8 @@ DSTROOT = "$(HOME)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", + "$(DEVELOPER_DIR)/../Frameworks", + "$(DEVELOPER_DIR)/../SharedFrameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Polychromatic/Polychromatic-Prefix.pch"; @@ -386,8 +386,8 @@ DSTROOT = "$(HOME)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", + "$(DEVELOPER_DIR)/../Frameworks", + "$(DEVELOPER_DIR)/../SharedFrameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Polychromatic/Polychromatic-Prefix.pch"; From f9ca55356148404022b9ec0ac85820109f80d224 Mon Sep 17 00:00:00 2001 From: Michael Conrads Date: Wed, 9 Apr 2014 14:10:43 +0200 Subject: [PATCH 2/5] quick fix for issue #14, this prevents just the crash and does not solve the origin of the bug --- Polychromatic/Utilities/PLYVariableManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polychromatic/Utilities/PLYVariableManager.m b/Polychromatic/Utilities/PLYVariableManager.m index 1d87c81..551d5dd 100644 --- a/Polychromatic/Utilities/PLYVariableManager.m +++ b/Polychromatic/Utilities/PLYVariableManager.m @@ -59,7 +59,7 @@ - (NSColor *)colorForVariable:(NSString *)variable inWorkspace:(IDEWorkspace *)w { NSMutableOrderedSet *variables = [self variableSetForWorkspace:workspace]; - if (!variables) + if (!variables && workspace.filePath.pathString) { variables = [[NSMutableOrderedSet alloc] init]; [self.workspaces setObject:variables forKey:workspace.filePath.pathString]; From 67a4b81df025d2e820a6e16848d8b5973eb36fe1 Mon Sep 17 00:00:00 2001 From: Kolin Krewinkel Date: Thu, 10 Apr 2014 14:45:48 -0700 Subject: [PATCH 3/5] Remove < Xcode 5.1 compatibility. Closes #13. --- Polychromatic/Polychromatic-Info.plist | 1 - 1 file changed, 1 deletion(-) diff --git a/Polychromatic/Polychromatic-Info.plist b/Polychromatic/Polychromatic-Info.plist index 2dbbc3a..2d2abb4 100644 --- a/Polychromatic/Polychromatic-Info.plist +++ b/Polychromatic/Polychromatic-Info.plist @@ -26,7 +26,6 @@ A2E4D43F-41F4-4FB9-BB94-7177011C9AED 640F884E-CE55-4B40-87C0-8869546CAB7A - 37B30044-3B14-46BA-ABAA-F01000C27B63 NSPrincipalClass Polychromatic From 6e5ba2822b8441e9e85b5755e8bf29fb888a14c9 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 11 Apr 2014 22:30:08 +0530 Subject: [PATCH 4/5] Create the themes directory before installing them [Fixes] https://github.com/kolinkrewinkel/Polychromatic/issues/19 --- Polychromatic/Polychromatic.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Polychromatic/Polychromatic.m b/Polychromatic/Polychromatic.m index 25ea5dd..68bd1d6 100755 --- a/Polychromatic/Polychromatic.m +++ b/Polychromatic/Polychromatic.m @@ -88,7 +88,10 @@ - (void)showInstallWindow:(id)sender [themes enumerateObjectsUsingBlock:^(NSString *themePath, NSUInteger idx, BOOL *stop) { NSString *replacementName = [themePath.lastPathComponent stringByReplacingOccurrencesOfString:@".dvtcolortheme" withString:@" (Polychromatic).dvtcolortheme"]; - [[NSFileManager defaultManager] copyItemAtPath:[NSString stringWithFormat:@"%@/%@", basePath, themePath] toPath:[NSString stringWithFormat:@"%@/Library/Developer/Xcode/UserData/FontAndColorThemes/%@", NSHomeDirectory(), replacementName] error:&error]; + NSString *destinationDirectory = [NSString stringWithFormat:@"%@/Library/Developer/Xcode/UserData/FontAndColorThemes", NSHomeDirectory()]; + [[NSFileManager defaultManager] createDirectoryAtPath:destinationDirectory withIntermediateDirectories:YES attributes:nil error:NULL]; + NSString *destinationPath = [NSString stringWithFormat:@"%@/%@", destinationDirectory, replacementName]; + [[NSFileManager defaultManager] copyItemAtPath:[NSString stringWithFormat:@"%@/%@", basePath, themePath] toPath:destinationPath error:&error]; }]; } } From b430d67c8116014d651dc062818fa47752788a34 Mon Sep 17 00:00:00 2001 From: Kolin Krewinkel Date: Fri, 11 Apr 2014 20:39:59 -0700 Subject: [PATCH 5/5] Code style fix for theme directory stuff. --- Polychromatic/Polychromatic.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polychromatic/Polychromatic.m b/Polychromatic/Polychromatic.m index 68bd1d6..982ff70 100755 --- a/Polychromatic/Polychromatic.m +++ b/Polychromatic/Polychromatic.m @@ -89,8 +89,9 @@ - (void)showInstallWindow:(id)sender [themes enumerateObjectsUsingBlock:^(NSString *themePath, NSUInteger idx, BOOL *stop) { NSString *replacementName = [themePath.lastPathComponent stringByReplacingOccurrencesOfString:@".dvtcolortheme" withString:@" (Polychromatic).dvtcolortheme"]; NSString *destinationDirectory = [NSString stringWithFormat:@"%@/Library/Developer/Xcode/UserData/FontAndColorThemes", NSHomeDirectory()]; - [[NSFileManager defaultManager] createDirectoryAtPath:destinationDirectory withIntermediateDirectories:YES attributes:nil error:NULL]; NSString *destinationPath = [NSString stringWithFormat:@"%@/%@", destinationDirectory, replacementName]; + + [[NSFileManager defaultManager] createDirectoryAtPath:destinationDirectory withIntermediateDirectories:YES attributes:nil error:NULL]; [[NSFileManager defaultManager] copyItemAtPath:[NSString stringWithFormat:@"%@/%@", basePath, themePath] toPath:destinationPath error:&error]; }]; }