Revision: 23940
http://sourceforge.net/p/bibdesk/svn/23940
Author: hofman
Date: 2019-07-04 21:37:47 +0000 (Thu, 04 Jul 2019)
Log Message:
-----------
local variable for user defaults
Modified Paths:
--------------
trunk/bibdesk/BibDocument.m
Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2019-07-04 06:30:48 UTC (rev 23939)
+++ trunk/bibdesk/BibDocument.m 2019-07-04 21:37:47 UTC (rev 23940)
@@ -2085,6 +2085,7 @@
- (void)importPublications:(NSArray *)newPubs publicationsToAutoFile:(NSArray
*)pubsToAutoFile temporaryCiteKey:(NSString *)tmpCiteKey
options:(BDSKImportOptions)options {
BibItem *pub;
+ NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
if ((options & BDSKImportSelectLibrary))
[self selectLibraryGroup:nil];
@@ -2092,7 +2093,7 @@
if ([self hasGroupTypeSelected:BDSKLibraryGroupType])
[self selectPublications:newPubs];
- BOOL autoGenerate = [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKCiteKeyAutogenerateKey];
+ BOOL autoGenerate = [sud boolForKey:BDSKCiteKeyAutogenerateKey];
NSMutableArray *autogeneratePubs = [NSMutableArray
arrayWithCapacity:[newPubs count]];
BOOL hasDuplicateCiteKey = NO;
@@ -2106,7 +2107,7 @@
}
[self generateCiteKeysForPublications:autogeneratePubs];
- BOOL useLocalUrlAndUrl = [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKUseLocalUrlAndUrlKey];
+ BOOL useLocalUrlAndUrl = [sud boolForKey:BDSKUseLocalUrlAndUrlKey];
for (pub in pubsToAutoFile) {
if (useLocalUrlAndUrl) {
@@ -2117,9 +2118,9 @@
}
}
- if ([[NSUserDefaults standardUserDefaults]
boolForKey:BDSKDownloadImportedURLsKey]) {
- BOOL replace = [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKReplaceDownloadedURLsKey];
- NSArray *types = [[NSUserDefaults standardUserDefaults]
stringArrayForKey:BDSKURLTypesToDownloadKey];
+ if ([sud boolForKey:BDSKDownloadImportedURLsKey]) {
+ BOOL replace = [sud boolForKey:BDSKReplaceDownloadedURLsKey];
+ NSArray *types = [sud stringArrayForKey:BDSKURLTypesToDownloadKey];
for (pub in newPubs) {
if (useLocalUrlAndUrl) {
if ([pub canDownloadURLForField:BDSKUrlString] && [types
containsObject:[[[pub remoteURLForField:BDSKUrlString] pathExtension]
lowercaseString] ?: @""])
@@ -2140,7 +2141,7 @@
for (pub in newPubs)
[pub setField:BDSKDateAddedString toValue:importDate];
- if((options & BDSKImportNoEdit) == 0 && [[NSUserDefaults
standardUserDefaults] boolForKey:BDSKEditOnPasteKey])
+ if((options & BDSKImportNoEdit) == 0 && [sud
boolForKey:BDSKEditOnPasteKey])
[self editPublications:newPubs]; // this will ask the user when
there are many pubs
[[self undoManager] setActionName:NSLocalizedString(@"Add Publication",
@"Undo action name")];
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