Revision: 4384
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4384&view=rev
Author:   hofman
Date:     2008-08-12 00:36:51 +0000 (Tue, 12 Aug 2008)

Log Message:
-----------
Don't use CFURL functions to get a path from a file system representation, as 
that does not work with relative paths.

Modified Paths:
--------------
    trunk/Files_SKExtensions.h
    trunk/Files_SKExtensions.m
    trunk/SKPDFSynchronizer.m

Modified: trunk/Files_SKExtensions.h
===================================================================
--- trunk/Files_SKExtensions.h  2008-08-12 00:01:34 UTC (rev 4383)
+++ trunk/Files_SKExtensions.h  2008-08-12 00:36:51 UTC (rev 4384)
@@ -47,7 +47,6 @@
 extern BOOL SKFileIsInTrash(NSURL *fileURL);
 extern BOOL SKFileExistsAtPath(NSString *path);
 extern NSDate *SKFileModificationDateAtPath(NSString *path);
-extern NSString *SKPathFromFileSystemRepresentation(const char *path);
 extern NSURL *SKResolvedURLFromPath(NSString *path);
 
 extern NSString *SKUniqueDirectoryCreating(NSString *basePath, BOOL create);

Modified: trunk/Files_SKExtensions.m
===================================================================
--- trunk/Files_SKExtensions.m  2008-08-12 00:01:34 UTC (rev 4383)
+++ trunk/Files_SKExtensions.m  2008-08-12 00:36:51 UTC (rev 4384)
@@ -112,18 +112,6 @@
         return nil;
 }
 
-NSString *SKPathFromFileSystemRepresentation(const char *path) {
-    NSString *thePath = nil;
-    if (path != NULL) {
-        CFURLRef theURL = 
CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8 *)path, 
strlen(path), NO);
-        if (theURL != NULL) {
-            thePath = [(NSURL *)theURL path];
-            CFRelease(theURL);
-        }
-    }
-    return thePath;
-}
-
 extern NSURL *SKResolvedURLFromPath(NSString *path) {
     NSURL *url = nil;
     FSRef fileRef;

Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m   2008-08-12 00:01:34 UTC (rev 4383)
+++ trunk/SKPDFSynchronizer.m   2008-08-12 00:36:51 UTC (rev 4384)
@@ -570,7 +570,7 @@
     if (scanner)
         synctex_scanner_free(scanner);
     if (scanner = synctex_scanner_new_with_output_file([theFileName 
fileSystemRepresentation])) {
-        NSString *theSyncFileName = 
SKPathFromFileSystemRepresentation(synctex_scanner_get_synctex(scanner));
+        NSString *theSyncFileName = [(NSString 
*)CFStringCreateWithFileSystemRepresentation(NULL, 
synctex_scanner_get_synctex(scanner)) autorelease];
         if ([theSyncFileName isAbsolutePath] == NO)
             theSyncFileName = [[theFileName stringByDeletingLastPathComponent] 
stringByAppendingPathComponent:theSyncFileName];
         theSyncFileName = [theSyncFileName stringByStandardizingPath];
@@ -580,12 +580,11 @@
         else
             filenames = (NSMutableDictionary 
*)CFDictionaryCreateMutable(kCFAllocatorDefault, 0, 
&kSKCaseInsensitiveStringDictionaryKeyCallBacks, 
&kCFTypeDictionaryValueCallBacks);
         NSString *basePath = [theSyncFileName 
stringByDeletingLastPathComponent];
-        NSString *file, *filename;
+        NSString *filename;
         synctex_node_t node = synctex_scanner_input(scanner);
         do {
-            filename = 
SKPathFromFileSystemRepresentation(synctex_scanner_get_name(scanner, 
synctex_node_tag(node)));
-            file = SKTeXSourceFile(filename, basePath);
-            [filenames setObject:filename forKey:file];
+            filename = [(NSString 
*)CFStringCreateWithFileSystemRepresentation(NULL, 
synctex_scanner_get_name(scanner, synctex_node_tag(node))) autorelease];
+            [filenames setObject:filename forKey:SKTeXSourceFile(filename, 
basePath)];
         } while (node = synctex_node_next(node));
         isPdfsync = NO;
         rv = [self shouldKeepRunning];
@@ -599,7 +598,7 @@
         synctex_node_t node = synctex_next_result(scanner);
         if (node) {
             *line = synctex_node_line(node) - 1;
-            *file = 
SKTeXSourceFile(SKPathFromFileSystemRepresentation(synctex_scanner_get_name(scanner,
 synctex_node_tag(node))), [[self syncFileName] 
stringByDeletingLastPathComponent]);
+            *file = SKTeXSourceFile([(NSString 
*)CFStringCreateWithFileSystemRepresentation(NULL, 
synctex_scanner_get_name(scanner, synctex_node_tag(node))) autorelease], [[self 
syncFileName] stringByDeletingLastPathComponent]);
             rv = YES;
         }
     }


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