Revision: 18516
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18516&view=rev
Author:   hofman
Date:     2012-02-23 12:49:28 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
make sure the URL for a document is always a file path URL, otherwise saving 
leads to big trouble

Modified Paths:
--------------
    trunk/bibdesk/BDSKDocumentController.m
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/NSURL_BDSKExtensions.h

Modified: trunk/bibdesk/BDSKDocumentController.m
===================================================================
--- trunk/bibdesk/BDSKDocumentController.m      2012-02-22 15:49:55 UTC (rev 
18515)
+++ trunk/bibdesk/BDSKDocumentController.m      2012-02-23 12:49:28 UTC (rev 
18516)
@@ -51,6 +51,7 @@
 #import "BDSKTemplateDocument.h"
 #import "BDSKTask.h"
 #import "BDSKOpenAccessoryViewController.h"
+#import "NSURL_BDSKExtensions.h"
 
 enum {
     BDSKOpenDefault,
@@ -304,6 +305,9 @@
         
     } else {
         
+        if ([absoluteURL isFileURL] && [absoluteURL 
respondsToSelector:@selector(filePathURL)])
+            absoluteURL = [absoluteURL filePathURL];
+        
         document = [super openDocumentWithContentsOfURL:absoluteURL 
display:displayDocument error:outError];
         
         if (displayDocument && openType == BDSKOpenUsingPhonyCiteKeys)

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2012-02-22 15:49:55 UTC (rev 18515)
+++ trunk/bibdesk/BibDocument.m 2012-02-23 12:49:28 UTC (rev 18516)
@@ -166,10 +166,6 @@
 - (void)changeSaveType:(id)sender;
 @end
 
-@interface NSURL (BDSKSnowLeopardDeclarations)
-- (NSURL *)filePathURL;
-@end
-
 @implementation BibDocument
 
 static NSOperationQueue *metadataCacheQueue = nil;

Modified: trunk/bibdesk/NSURL_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSURL_BDSKExtensions.h        2012-02-22 15:49:55 UTC (rev 
18515)
+++ trunk/bibdesk/NSURL_BDSKExtensions.h        2012-02-23 12:49:28 UTC (rev 
18516)
@@ -79,6 +79,7 @@
 - (NSString *)pathExtension;
 - (NSURL *)URLByDeletingLastPathComponent;
 - (NSURL *)URLByDeletingPathExtension;
+- (NSURL *)filePathURL;
 @end
 #endif
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to