From: <ho...@us...> - 2008-02-01 17:25:16
|
Revision: 12742 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12742&view=rev Author: hofman Date: 2008-02-01 09:25:13 -0800 (Fri, 01 Feb 2008) Log Message: ----------- Remove a level of if-clause. Modified Paths: -------------- trunk/bibdesk/BibItem.m Modified: trunk/bibdesk/BibItem.m =================================================================== --- trunk/bibdesk/BibItem.m 2008-02-01 06:45:21 UTC (rev 12741) +++ trunk/bibdesk/BibItem.m 2008-02-01 17:25:13 UTC (rev 12742) @@ -2739,20 +2739,16 @@ if (converted == NO) { BDSKLinkedFile *file = [[BDSKLinkedFile alloc] initWithURL:urlValue delegate:self]; NSURL *fileURL = [file URL]; - // check again, because the URL may be given in a diffreent form, e.g. with an extra slash at the end for a folder - converted = [currentURLs containsObject:fileURL]; - if (converted == NO) { - if (fileURL) { - [self->files addObject:file]; - converted = YES; - (ctxt->numberOfAddedFiles)++; - } - else { - // @@ this error message is lame - NSDictionary *message = [[NSDictionary alloc] initWithObjectsAndKeys:urlValue, @"URL", NSLocalizedString(@"File or URL not found", @""), @"error", nil]; - [ctxt->messages addObject:message]; - [message release]; - } + if (fileURL == nil) { + // @@ this error message is lame + NSDictionary *message = [[NSDictionary alloc] initWithObjectsAndKeys:urlValue, @"URL", NSLocalizedString(@"File or URL not found", @""), @"error", nil]; + [ctxt->messages addObject:message]; + [message release]; + } else if ([currentURLs containsObject:fileURL] == NO) { + // checked again for containment, as fileURL may not be exactly the same as urlValue, e.g. an extra slash at the end for a folder + [self->files addObject:file]; + converted = YES; + (ctxt->numberOfAddedFiles)++; } [file release]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |