Revision: 4359
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4359&view=rev
Author:   hofman
Date:     2008-08-06 16:10:29 +0000 (Wed, 06 Aug 2008)

Log Message:
-----------
Resolve alias file for Open PDF action in notes document.

Modified Paths:
--------------
    trunk/SKNotesDocument.m

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2008-08-06 09:41:34 UTC (rev 4358)
+++ trunk/SKNotesDocument.m     2008-08-06 16:10:29 UTC (rev 4359)
@@ -283,8 +283,13 @@
     if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
         FSRef ref;
         NSURL *url = nil;
-        if (noErr == FSPathMakeRef((const unsigned char *)[[path 
stringByResolvingSymlinksInPath] fileSystemRepresentation], &ref, NULL))
-            url = [(NSURL *)CFURLCreateFromFSRef(NULL, &ref) autorelease];
+        Boolean isFolder, wasAliased;
+        if (noErr == FSPathMakeRef((const unsigned char *)[[path 
stringByResolvingSymlinksInPath] fileSystemRepresentation], &ref, NULL)) {
+            CFStringRef theUTI = NULL;
+            if (noErr == LSCopyItemAttribute(&ref, kLSRolesAll, 
kLSItemContentType, (CFTypeRef *)&theUTI) && theUTI && UTTypeConformsTo(theUTI, 
kUTTypeResolvable))
+                FSResolveAliasFileWithMountFlags(&ref, TRUE, &isFolder, 
&wasAliased, kARMNoUI);
+           url = [(NSURL *)CFURLCreateFromFSRef(NULL, &ref) autorelease];
+        }
         if (url == nil)
             url = [NSURL fileURLWithPath:path];
         if (nil == [[NSDocumentController sharedDocumentController] 
openDocumentWithContentsOfURL:url display:YES error:&error])


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

Reply via email to