Revision: 15496
          http://sourceforge.net/p/skim-app/code/15496
Author:   hofman
Date:     2025-06-18 15:48:40 +0000 (Wed, 18 Jun 2025)
Log Message:
-----------
get preference only when not already failing

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

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2025-06-18 15:42:54 UTC (rev 15495)
+++ trunk/SKMainDocument.m      2025-06-18 15:48:40 UTC (rev 15496)
@@ -939,16 +939,18 @@
                 pdfDoc = nil;
                 error = [NSError userCancelledErrorWithUnderlyingError:error];
             }
-            NSInteger readOption = [[NSUserDefaults standardUserDefaults] 
integerForKey:foundEANotes ? SKReadNonMissingNotesFromSkimFileOptionKey : 
SKReadMissingNotesFromSkimFileOptionKey];
-            if (pdfDoc && readOption != SKOptionNever) {
-                NSURL *notesURL = [absoluteURL 
URLReplacingPathExtension:@"skim"];
-                if ([notesURL checkResourceIsReachableAndReturnError:NULL]) {
-                    readOption = [self definitiveOption:readOption 
usingMessageText:NSLocalizedString(@"Found Separate Notes", @"Message in alert 
dialog") informativeText:foundEANotes ? NSLocalizedString(@"A Skim notes file 
with the same name was found.  Do you want Skim to read the notes from this 
file?", @"Informative text in alert dialog") : [NSString 
stringWithFormat:NSLocalizedString(@"Unable to read notes for %@, but a Skim 
notes file with the same name was found.  Do you want Skim to read the notes 
from this file?", @"Informative text in alert dialog"), [[absoluteURL path] 
stringByAbbreviatingWithTildeInPath]]];
-                    if (readOption == SKOptionAlways) {
-                        array = [[NSFileManager defaultManager] 
readSkimNotesFromSkimFileAtURL:notesURL error:NULL];
-                        if ([array count] && [array isEqualToArray:[tmpData 
noteDicts]] == NO) {
-                            [tmpData setNoteDicts:array];
-                            [self updateChangeCount:NSChangeReadOtherContents];
+            if (pdfDoc) {
+                NSInteger readOption = [[NSUserDefaults standardUserDefaults] 
integerForKey:foundEANotes ? SKReadNonMissingNotesFromSkimFileOptionKey : 
SKReadMissingNotesFromSkimFileOptionKey];
+                if (readOption != SKOptionNever) {
+                    NSURL *notesURL = [absoluteURL 
URLReplacingPathExtension:@"skim"];
+                    if ([notesURL 
checkResourceIsReachableAndReturnError:NULL]) {
+                        readOption = [self definitiveOption:readOption 
usingMessageText:NSLocalizedString(@"Found Separate Notes", @"Message in alert 
dialog") informativeText:foundEANotes ? NSLocalizedString(@"A Skim notes file 
with the same name was found.  Do you want Skim to read the notes from this 
file?", @"Informative text in alert dialog") : [NSString 
stringWithFormat:NSLocalizedString(@"Unable to read notes for %@, but a Skim 
notes file with the same name was found.  Do you want Skim to read the notes 
from this file?", @"Informative text in alert dialog"), [[absoluteURL path] 
stringByAbbreviatingWithTildeInPath]]];
+                        if (readOption == SKOptionAlways) {
+                            array = [[NSFileManager defaultManager] 
readSkimNotesFromSkimFileAtURL:notesURL error:NULL];
+                            if ([array count] && [array 
isEqualToArray:[tmpData noteDicts]] == NO) {
+                                [tmpData setNoteDicts:array];
+                                [self 
updateChangeCount:NSChangeReadOtherContents];
+                            }
                         }
                     }
                 }

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to