From: <ama...@us...> - 2007-07-30 16:26:49
|
Revision: 10875 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=10875&view=rev Author: amaxwell Date: 2007-07-30 09:26:51 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Fix smart groups that depend on "Any Field" and were created prior to my changes of April 2007 (Search Kit). Like an idiot, I haven't been paying enough attention to my own bib file, since this broke 4 of my groups. Modified Paths: -------------- trunk/bibdesk/BDSKCondition.m Modified: trunk/bibdesk/BDSKCondition.m =================================================================== --- trunk/bibdesk/BDSKCondition.m 2007-07-30 14:57:39 UTC (rev 10874) +++ trunk/bibdesk/BDSKCondition.m 2007-07-30 16:26:51 UTC (rev 10875) @@ -90,6 +90,11 @@ - (id)initWithDictionary:(NSDictionary *)dictionary { if (self = [self init]) { NSString *aKey = [dictionary objectForKey:@"key"]; + + // Backwards compatibility check. Old versions of BibDesk used BDSKAllFieldsString = NSLocalizedString(@"Any Field", @""). Before the first localization was introduced, the definition was changed to @"AllFields", which is locale-independent and more clearly related to the constant string; unfortunately, I didn't realize the definition was being saved to disk in smart groups. Rather than change the definition back again and break groups added in the meantime, we'll just check for "Any Field" here (must be unlocalized) and use the new constant string. + if ([aKey isEqualToString:@"Any Field"]) + aKey = BDSKAllFieldsString; + NSString *aValue = [[dictionary objectForKey:@"value"] stringByUnescapingGroupPlistEntities]; NSNumber *comparisonNumber = [dictionary objectForKey:@"comparison"]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |