From: <ama...@us...> - 2006-07-04 18:22:32
|
Revision: 7008 Author: amaxwell Date: 2006-07-04 11:22:12 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/bibdesk/?rev=7008&view=rev Log Message: ----------- Revert to using URL setting from Finder comment as hidden default (RFE #1517089). Modified Paths: -------------- trunk/bibdesk/BibItem.m Modified: trunk/bibdesk/BibItem.m =================================================================== --- trunk/bibdesk/BibItem.m 2006-07-04 05:44:31 UTC (rev 7007) +++ trunk/bibdesk/BibItem.m 2006-07-04 18:22:12 UTC (rev 7008) @@ -2662,8 +2662,20 @@ [self rebuildPeople]; } - if([BDSKLocalUrlString isEqualToString:key]) + if([BDSKLocalUrlString isEqualToString:key]){ [self setNeedsToBeFiled:NO]; + // If the Finder comment from this file has a useful URL and our BibItem has an empty remote URL field, use the Finder comment as remote URL. Do this before autofiling the paper, since we know the path to the file now (hidden user default). + if(MDItemCreate != NULL && [[NSUserDefaults standardUserDefaults] boolForKey:@"BDSKShouldUseSpotlightCommentForURL"]){ + MDItemRef mdItem = NULL; + if(mdItem = MDItemCreate(kCFAllocatorDefault, (CFStringRef)[self localFilePathForField:key])){ + NSString *remoteURLString = (NSString *)MDItemCopyAttribute(mdItem, kMDItemFinderComment); + CFRelease(mdItem); + if(remoteURLString && [NSURL URLWithString:remoteURLString]!= nil && [self remoteURL] == nil) + [self setField:BDSKUrlString toValue:remoteURLString]; + [remoteURLString release]; + } + } + } // see if we need to use the crossref workaround (BibTeX bug) if([BDSKTitleString isEqualToString:key] && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |