Revision: 3008
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3008&view=rev
Author:   hofman
Date:     2007-10-02 07:51:23 -0700 (Tue, 02 Oct 2007)

Log Message:
-----------
Load PDFDocument from data rather than the URL, so it does not lock the file.

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

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-10-02 11:10:18 UTC (rev 3007)
+++ trunk/SKDocument.m  2007-10-02 14:51:23 UTC (rev 3008)
@@ -542,7 +542,7 @@
     
     if ([docType isEqualToString:SKPDFDocumentType]) {
         if ((data = [[NSData alloc] initWithContentsOfURL:absoluteURL 
options:NSUncachedRead error:&error]) &&
-            (pdfDoc = [[PDFDocument alloc] initWithURL:absoluteURL])) {
+            (pdfDoc = [[PDFDocument alloc] initWithData:data])) {
             if ([self readNotesFromExtendedAttributesAtURL:absoluteURL 
error:&error] == NO) {
                 NSAlert *alert = [NSAlert 
alertWithMessageText:NSLocalizedString(@"Unable to Read Notes", @"Message in 
alert dialog") 
                                                  
defaultButton:NSLocalizedString(@"No", @"Button title")
@@ -583,7 +583,7 @@
         if (pdfFile) {
             NSURL *pdfURL = [NSURL fileURLWithPath:[path 
stringByAppendingPathComponent:pdfFile]];
             if ((data = [[NSData alloc] initWithContentsOfURL:pdfURL 
options:NSUncachedRead error:&error]) &&
-                (pdfDoc = [[PDFDocument alloc] initWithURL:pdfURL])) {
+                (pdfDoc = [[PDFDocument alloc] initWithData:data])) {
                 NSString *skimFile = [[NSFileManager defaultManager] 
subfileWithExtension:@"skim" inPDFBundleAtPath:path];
                 if (skimFile) {
                     NSArray *array = [NSKeyedUnarchiver 
unarchiveObjectWithFile:[path stringByAppendingPathComponent:skimFile]];


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to