Skip to content
Browse files

Printing out some debug info in case you can't launch an app.

  • Loading branch information...
1 parent af7b3d2 commit 66374d3f568cec12ad364bf77ac5c35f4147890d @ccgus committed Feb 17, 2012
Showing with 29 additions and 29 deletions.
  1. +13 −5 experimental/src/JSTalk.m
  2. +7 −19 jstalk.xcodeproj/project.pbxproj
  3. +9 −5 src/JSTalk.m
View
18 experimental/src/JSTalk.m
@@ -371,27 +371,35 @@ + (id)application:(NSString*)app {
if (!appPath) {
NSLog(@"Could not find application '%@'", app);
+ // fixme: why are we returning a bool?
return [NSNumber numberWithBool:NO];
}
NSBundle *appBundle = [NSBundle bundleWithPath:appPath];
NSString *bundleId = [appBundle bundleIdentifier];
-
// make sure it's running
NSArray *runningApps = [[[NSWorkspace sharedWorkspace] launchedApplications] valueForKey:@"NSApplicationBundleIdentifier"];
if (![runningApps containsObject:bundleId]) {
- [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:bundleId
- options:NSWorkspaceLaunchWithoutActivation | NSWorkspaceLaunchAsync
- additionalEventParamDescriptor:nil
- launchIdentifier:nil];
+ BOOL launched = [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:bundleId
+ options:NSWorkspaceLaunchWithoutActivation | NSWorkspaceLaunchAsync
+ additionalEventParamDescriptor:nil
+ launchIdentifier:nil];
+ if (!launched) {
+ NSLog(@"Could not open up %@", appPath);
+ return 0x00;
+ }
}
return [self applicationOnPort:[NSString stringWithFormat:@"%@.JSTalk", bundleId]];
}
++ (id)app:(NSString*)app {
+ return [self application:app];
+}
+
+ (id)proxyForApp:(NSString*)app {
return [self application:app];
}
View
26 jstalk.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -922,8 +922,11 @@
/* Begin PBXProject section */
2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0430;
+ };
buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "jstalk" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -1193,7 +1196,6 @@
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/JSTalk_Prefix.pch;
@@ -1238,8 +1240,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -1255,8 +1256,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Release;
};
@@ -1269,7 +1269,6 @@
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_GC = supported;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1289,7 +1288,6 @@
AppKit,
"-lexpat",
);
- PREBINDING = NO;
PRODUCT_NAME = JSTalk;
};
name = Debug;
@@ -1302,7 +1300,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_GC = supported;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/JSTalk_Prefix.pch;
@@ -1320,7 +1317,6 @@
"-lexpat",
"-lffi",
);
- PREBINDING = NO;
PRODUCT_NAME = JSTalk;
};
name = Release;
@@ -1331,7 +1327,6 @@
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/JSTalk_Prefix.pch;
@@ -1346,7 +1341,6 @@
"-framework",
AppKit,
);
- PREBINDING = NO;
PRODUCT_NAME = JSTalkRunner;
};
name = Debug;
@@ -1356,7 +1350,6 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/JSTalk_Prefix.pch;
INFOPLIST_FILE = "res/JSTalkRunner-Info.plist";
@@ -1369,7 +1362,6 @@
"-framework",
AppKit,
);
- PREBINDING = NO;
PRODUCT_NAME = JSTalkRunner;
};
name = Release;
@@ -1380,7 +1372,6 @@
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/JSTalk_Prefix.pch;
@@ -1394,7 +1385,6 @@
"-framework",
AppKit,
);
- PREBINDING = NO;
PRODUCT_NAME = jstalk;
};
name = Debug;
@@ -1404,7 +1394,6 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/JSTalk_Prefix.pch;
INSTALL_PATH = /usr/local/bin;
@@ -1416,7 +1405,6 @@
"-framework",
AppKit,
);
- PREBINDING = NO;
PRODUCT_NAME = jstalk;
};
name = Release;
View
14 src/JSTalk.m
@@ -372,21 +372,25 @@ + (id)application:(NSString*)app {
if (!appPath) {
NSLog(@"Could not find application '%@'", app);
+ // fixme: why are we returning a bool?
return [NSNumber numberWithBool:NO];
}
NSBundle *appBundle = [NSBundle bundleWithPath:appPath];
NSString *bundleId = [appBundle bundleIdentifier];
-
// make sure it's running
NSArray *runningApps = [[[NSWorkspace sharedWorkspace] launchedApplications] valueForKey:@"NSApplicationBundleIdentifier"];
if (![runningApps containsObject:bundleId]) {
- [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:bundleId
- options:NSWorkspaceLaunchWithoutActivation | NSWorkspaceLaunchAsync
- additionalEventParamDescriptor:nil
- launchIdentifier:nil];
+ BOOL launched = [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:bundleId
+ options:NSWorkspaceLaunchWithoutActivation | NSWorkspaceLaunchAsync
+ additionalEventParamDescriptor:nil
+ launchIdentifier:nil];
+ if (!launched) {
+ NSLog(@"Could not open up %@", appPath);
+ return 0x00;
+ }
}

0 comments on commit 66374d3

Please sign in to comment.
Something went wrong with that request. Please try again.