Revision: 28889
          http://sourceforge.net/p/bibdesk/svn/28889
Author:   hofman
Date:     2024-05-05 22:11:21 +0000 (Sun, 05 May 2024)
Log Message:
-----------
copy files to app support in applicationWillFinishLaunching, so template files 
are present before any document is opened and possibly use templates for 
previewing

Modified Paths:
--------------
    trunk/bibdesk/BDSKAppController.m

Modified: trunk/bibdesk/BDSKAppController.m
===================================================================
--- trunk/bibdesk/BDSKAppController.m   2024-05-05 21:46:39 UTC (rev 28888)
+++ trunk/bibdesk/BDSKAppController.m   2024-05-05 22:11:21 UTC (rev 28889)
@@ -313,6 +313,17 @@
     
     // register URL handler
     [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self 
andSelector:@selector(handleGetURLEvent:withReplyEvent:) 
forEventClass:kInternetEventClass andEventID:kAEGetURL];
+
+    // copy files to application support, do this before any document may be 
opened
+    NSFileManager *fileManager = [NSFileManager defaultManager];
+    [fileManager copyFileFromSharedSupportToApplicationSupport:@"Templates" 
overwrite:NO];
+    [fileManager 
copyFileFromSharedSupportToApplicationSupport:@"previewtemplate.tex" 
overwrite:NO];
+    [fileManager copyFileFromSharedSupportToApplicationSupport:@"template.txt" 
overwrite:NO];
+    [fileManager 
copyFileFromSharedSupportToApplicationSupport:@"Bookmarks.plist" overwrite:NO];
+    
+    NSURL *scriptsURL = [[fileManager applicationSupportDirectoryURL] 
URLByAppendingPathComponent:@"Scripts" isDirectory:YES];
+    if ([scriptsURL checkResourceIsReachableAndReturnError:NULL] == NO)
+        [fileManager createDirectoryAtURL:scriptsURL 
withIntermediateDirectories:NO attributes:nil error:NULL];
 }
 
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{
@@ -340,17 +351,6 @@
         [self showReadMeFile:nil];
     [[NSUserDefaults standardUserDefaults] setObject:versionString 
forKey:BDSKLastVersionLaunchedKey];
     
-    // copy files to application support
-    NSFileManager *fileManager = [NSFileManager defaultManager];
-    [fileManager copyFileFromSharedSupportToApplicationSupport:@"Templates" 
overwrite:NO];        
-    [fileManager 
copyFileFromSharedSupportToApplicationSupport:@"previewtemplate.tex" 
overwrite:NO];
-    [fileManager copyFileFromSharedSupportToApplicationSupport:@"template.txt" 
overwrite:NO];   
-    [fileManager 
copyFileFromSharedSupportToApplicationSupport:@"Bookmarks.plist" overwrite:NO]; 
  
-
-    NSURL *scriptsURL = [[fileManager applicationSupportDirectoryURL] 
URLByAppendingPathComponent:@"Scripts" isDirectory:YES];
-    if ([scriptsURL checkResourceIsReachableAndReturnError:NULL] == NO)
-        [fileManager createDirectoryAtURL:scriptsURL 
withIntermediateDirectories:NO attributes:nil error:NULL];
-    
     // Ensure the previewer and TeX task get created now in order to avoid a 
spurious "unable to copy helper file" warning when quit->document window 
closes->first call to [BDSKPreviewer sharedPreviewer]
     if([[NSUserDefaults standardUserDefaults] boolForKey:BDSKUsesTeXKey])
         [BDSKPreviewer sharedPreviewer];

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to