Revision: 4409
http://skim-app.svn.sourceforge.net/skim-app/?rev=4409&view=rev
Author: hofman
Date: 2008-08-14 23:42:02 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
Look for sync editor tool in /usr/bin and /usr/local/bin first, in case it's
installed.
Modified Paths:
--------------
trunk/SKPDFDocument.m
Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m 2008-08-14 20:39:46 UTC (rev 4408)
+++ trunk/SKPDFDocument.m 2008-08-14 23:42:02 UTC (rev 4409)
@@ -1414,26 +1414,33 @@
if ([editorPreset isEqualToString:@""] == NO) {
NSString *appPath = [[NSWorkspace sharedWorkspace]
fullPathForApplication:editorPreset];
if (appPath) {
+ NSFileManager *fm = [NSFileManager defaultManager];
NSBundle *appBundle = [NSBundle bundleWithPath:appPath];
- NSString *toolPath = [appBundle pathForResource:editorCmd
ofType:nil];
- if (toolPath && [[NSFileManager defaultManager]
isExecutableFileAtPath:toolPath]) {
+ NSString *toolPath;
+ if ((toolPath = [@"/usr/bin"
stringByAppendingPathComponent:editorCmd]) &&
+ [fm isExecutableFileAtPath:toolPath]) {
editorCmd = toolPath;
+ } else if ((toolPath = [@"/usr/local/bin"
stringByAppendingPathComponent:editorCmd]) &&
+ [fm isExecutableFileAtPath:toolPath]) {
+ editorCmd = toolPath;
+ } else if (toolPath = [appBundle pathForResource:editorCmd
ofType:nil]) {
+ editorCmd = toolPath;
} else if (toolPath = [appBundle
pathForAuxiliaryExecutable:editorCmd]) {
editorCmd = toolPath;
} else if (toolPath = [appBundle
pathForAuxiliaryExecutable:[@"bin" stringByAppendingPathComponent:editorCmd]]) {
// Emacs has its tool in Emacs.app/Contents/MacOS/bin/
editorCmd = toolPath;
} else if ((toolPath = [[appBundle sharedSupportPath]
stringByAppendingPathComponent:editorCmd]) &&
- [[NSFileManager defaultManager]
isExecutableFileAtPath:toolPath]) {
+ [fm isExecutableFileAtPath:toolPath]) {
editorCmd = toolPath;
} else if ((toolPath = [[[appBundle sharedSupportPath]
stringByAppendingPathComponent:@"bin"]
stringByAppendingPathComponent:editorCmd]) &&
- [[NSFileManager defaultManager]
isExecutableFileAtPath:toolPath]) {
+ [fm isExecutableFileAtPath:toolPath]) {
editorCmd = toolPath;
} else if ((toolPath = [[appBundle resourcePath]
stringByAppendingPathComponent:editorCmd]) &&
- [[NSFileManager defaultManager]
isExecutableFileAtPath:toolPath]) {
+ [fm isExecutableFileAtPath:toolPath]) {
editorCmd = toolPath;
} else if ((toolPath = [[[appBundle resourcePath]
stringByAppendingPathComponent:@"bin"]
stringByAppendingPathComponent:editorCmd]) &&
- [[NSFileManager defaultManager]
isExecutableFileAtPath:toolPath]) {
+ [fm isExecutableFileAtPath:toolPath]) {
editorCmd = toolPath;
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit