Revision: 22532
http://sourceforge.net/p/bibdesk/svn/22532
Author: hofman
Date: 2018-08-26 16:08:05 +0000 (Sun, 26 Aug 2018)
Log Message:
-----------
Always add URL field to item from web parser
Modified Paths:
--------------
trunk/bibdesk/BDSKCOinSParser.m
trunk/bibdesk/BDSKIACRParser.m
Modified: trunk/bibdesk/BDSKCOinSParser.m
===================================================================
--- trunk/bibdesk/BDSKCOinSParser.m 2018-08-26 15:51:33 UTC (rev 22531)
+++ trunk/bibdesk/BDSKCOinSParser.m 2018-08-26 16:08:05 UTC (rev 22532)
@@ -115,7 +115,7 @@
NSString * auLast = nil;
NSString * auInitials = nil;
NSString * auSuffix = nil;
- BOOL useUrl = [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKUseLocalUrlAndUrlKey];
+ BOOL addLinkedFiles = NO == [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKUseLocalUrlAndUrlKey];
for (NSString *component in components) {
NSArray * keyValue = [component
componentsSeparatedByString:@"="];
@@ -222,9 +222,8 @@
NSURL * URL = [NSURL URLWithString:value];
if (URL && ([@"http"
isCaseInsensitiveEqual:[URL scheme]] || [@"https" isCaseInsensitiveEqual:[URL
scheme]])) {
// add http/https URLs to the FileView items only, rather
than the Url field. This lets us process more than one of them and avoid adding
links to library catalogue entries to the BibTeX record. I haven't seen other
usable URL typese yet.
- if (useUrl)
- [fieldsDict setObject:value forKey:BDSKUrlString];
- else
+ [fieldsDict setObject:value forKey:BDSKUrlString];
+ if (addLinkedFiles)
[files addObject:[BDSKLinkedFile linkedFileWithURL:URL
delegate:nil]];
}
if ([value rangeOfString:@"doi"
options:NSCaseInsensitiveSearch].location != NSNotFound) {
Modified: trunk/bibdesk/BDSKIACRParser.m
===================================================================
--- trunk/bibdesk/BDSKIACRParser.m 2018-08-26 15:51:33 UTC (rev 22531)
+++ trunk/bibdesk/BDSKIACRParser.m 2018-08-26 16:08:05 UTC (rev 22532)
@@ -71,7 +71,7 @@
// is this a search results page or an individual article?
BOOL isSearch = [[[url path] lowercaseString]
isEqualToString:@"/cgi-bin/search.pl"];
- BOOL useUrl = [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKUseLocalUrlAndUrlKey];
+ BOOL addLinkedFiles = NO == [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKUseLocalUrlAndUrlKey];
// construct the source item(s) to parse
NSArray *sources = nil;
@@ -133,9 +133,8 @@
if ((year != nil) && (reportNum != nil)) {
[pubFields setValue:year forKey:BDSKYearString];
[pubFields setValue:[NSString
stringWithFormat:@"Cryptology ePrint Archive, Report %@/%@", year, reportNum]
forKey:@"Note"];
- if (useUrl) {
- [pubFields setValue:[urlBaseString
stringByAppendingPathExtension:@"pdf"] forKey:BDSKUrlString];
- } else {
+ [pubFields setValue:[urlBaseString
stringByAppendingPathExtension:@"pdf"] forKey:BDSKUrlString];
+ if (addLinkedFiles) {
filesArray = [NSArray arrayWithObjects:
[BDSKLinkedFile linkedFileWithURL:[NSURL
URLWithString:[urlBaseString stringByAppendingPathExtension:@"pdf"]]
delegate:nil],
[BDSKLinkedFile linkedFileWithURL:[NSURL
URLWithString:urlBaseString] delegate:nil], nil];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit