From: <ama...@us...> - 2006-10-03 02:19:15
|
Revision: 7778 http://svn.sourceforge.net/bibdesk/?rev=7778&view=rev Author: amaxwell Date: 2006-10-02 19:19:13 -0700 (Mon, 02 Oct 2006) Log Message: ----------- Make sure Spotlight metadata files are saved at least once per session. Modified Paths: -------------- trunk/bibdesk/BibItem.m Modified: trunk/bibdesk/BibItem.m =================================================================== --- trunk/bibdesk/BibItem.m 2006-10-03 00:13:36 UTC (rev 7777) +++ trunk/bibdesk/BibItem.m 2006-10-03 02:19:13 UTC (rev 7778) @@ -186,9 +186,6 @@ if (self) { // reset this here, since designated init's updateMetadataForKey set it to YES [self setHasBeenEdited:NO]; - - // new items need to be updated on the next save - spotlightMetadataChanged = YES; } return self; } @@ -226,7 +223,8 @@ [self updateMetadataForKey:nil]; // used for determining if we need to re-save Spotlight metadata - spotlightMetadataChanged = NO; + // set to YES initially so the first save after opening a file always writes the metadata, since we don't know beforehand if it's been written + spotlightMetadataChanged = YES; } return self; @@ -234,8 +232,7 @@ // Never copy between different documents, as this messes up the macroResolver for complex string values - (id)copyWithZone:(NSZone *)zone{ - // we set isNew to YES as copied items are always added as new items to a document, e.g. for duplicates and text import, so the Date-Added should be reset - // note that unless someone uses Date-Added or Date-Modified as a default field, a copy is equal according to isEqualToItem: + // We set isNew to YES as copied items are always added as new items to a document, e.g. for duplicates and text import, so the Date-Added should be reset. Note that unless someone uses Date-Added or Date-Modified as a default field, a copy is equal according to isEqualToItem: BibItem *theCopy = [[[self class] allocWithZone: zone] initWithType:pubType fileType:fileType pubFields:pubFields isNew:YES]; [theCopy setCiteKeyString: citeKey]; [theCopy setDate: pubDate]; @@ -259,7 +256,7 @@ document = nil; hasBeenEdited = [coder decodeBoolForKey:@"hasBeenEdited"]; // we don't bother encoding this - spotlightMetadataChanged = NO; + spotlightMetadataChanged = YES; } } else { [[super init] release]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |