Revision: 28328
          http://sourceforge.net/p/bibdesk/svn/28328
Author:   hofman
Date:     2023-07-19 16:38:54 +0000 (Wed, 19 Jul 2023)
Log Message:
-----------
open documents from filter or tmp cite keys without fileURL

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

Modified: trunk/bibdesk/BDSKDocumentController.m
===================================================================
--- trunk/bibdesk/BDSKDocumentController.m      2023-07-19 15:58:31 UTC (rev 
28327)
+++ trunk/bibdesk/BDSKDocumentController.m      2023-07-19 16:38:54 UTC (rev 
28328)
@@ -350,8 +350,10 @@
             NSURL *tmpFileURL = [[NSFileManager defaultManager] 
temporaryFileURLWithBasename:tmpFileName];
             
             if ([filteredString writeToURL:tmpFileURL atomically:YES 
encoding:encoding error:outError]) {
-                if ((doc = [super makeDocumentWithContentsOfURL:tmpFileURL 
ofType:BDSKBibTeXDocumentType error:outError]))
+                if ((doc = [super makeDocumentForURL:nil 
withContentsOfURL:tmpFileURL ofType:BDSKBibTeXDocumentType error:outError])) {
+                    [doc setDisplayName:[[absoluteURL lastPathComponent] 
stringByDeletingPathExtension]];
                     [(BibDocument *)doc markAsImported];
+                }
                 [[NSFileManager defaultManager] removeItemAtPath:[tmpFileURL 
path] error:NULL];
             }
         }

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-07-19 15:58:31 UTC (rev 28327)
+++ trunk/bibdesk/BibDocument.m 2023-07-19 16:38:54 UTC (rev 28328)
@@ -1975,16 +1975,11 @@
 #pragma mark -
 
 - (void)markAsImported {
-    NSString *fileName = [[[self fileURL] lastPathComponent] 
stringByDeletingPathExtension];
-    [self setFileURL:nil];
-    if (fileName)
-        [self setDisplayName:fileName];
     // set date-added for imports
     NSDate *importDate = [NSDate date];
     NSString *importDateDescription = [importDate standardDescription];
     for (BibItem *pub in publications)
         [pub markNeWithDate:importDate description:importDateDescription];
-    [[self undoManager] removeAllActions];
     // mark as dirty, since we've changed the content
     [self updateChangeCount:NSChangeReadOtherContents];
 }

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to