Heh, been there done that, for exactly the same reason.  Leopard's gcc  
now catches it if I leave off a nil terminator on those, but it sadly  
can't check ordering for me.

On Dec 16, 2007, at 3:02 AM, Christiaan Hofman wrote:

> Oh sorry, I was cxonfused. I was thinking "key-value" pair, not
> "value-key" (not the first time, whoeever designed that?)
>
> Christiaan
>
> On 16 Dec 2007, at 8:36 AM, Adam R. Maxwell wrote:
>
>> Uh, what am I missing here?  It's enumerating the keys and looking  
>> for
>> each key in the current tc identifiers.  So a quick test inserting a
>> legacy key "Added" into the array using the code as-is does
>> nothing...hence my change earlier, which you just reverted!  I  
>> believe
>> it should be looking for "Added" and replacing it with
>> BDSKDateAddedString.
>>
>> 2007-12-15 23:32:09.409 BibDesk[56086:10b] (
>>     Keywords,
>>     Title,
>>     "1st Author",
>>     "Publication Date",
>>     "Local-Url",
>>     "Item Number",
>>     Url,
>>     Rating,
>>     Read,
>>     Added
>> )
>> 2007-12-15 23:32:09.414 BibDesk[56086:10b] didFixIdentifier = 0
>>
>> static void fixLegacyTableColumnIdentifiers()
>> {
>>     OFPreferenceWrapper *pw = [OFPreferenceWrapper
>> sharedPreferenceWrapper];
>>     NSMutableArray *fixedTableColumnIdentifiers = [[[pw
>> arrayForKey:BDSKShownColsNamesKey] mutableCopy] autorelease];
>>
>>     [fixedTableColumnIdentifiers addObject:@"Added"];
>>     NSLog(@"%@", fixedTableColumnIdentifiers);
>>
>>     unsigned idx;
>>     BOOL didFixIdentifier = NO;
>>
>>     NSDictionary *legacyKeys = [NSDictionary
>> dictionaryWithObjectsAndKeys:@"Added", BDSKDateAddedString,
>> @"Created", BDSKDateAddedString, @"Modified", BDSKDateModifiedString,
>> @"Authors Or Editors", BDSKAuthorEditorString, @"Authors",
>> BDSKAuthorString, nil];
>>     NSEnumerator *keyEnum = [legacyKeys keyEnumerator];
>>     NSString *key;
>>
>>     while (key = [keyEnum nextObject]) {
>>         if ((idx = [fixedTableColumnIdentifiers indexOfObject:key]) !
>> = NSNotFound) {
>>             NSLog(@"found old ident %@ at %d", key, idx);
>>             didFixIdentifier = YES;
>>             [fixedTableColumnIdentifiers replaceObjectAtIndex:idx
>> withObject:[legacyKeys objectForKey:key]];
>>         }
>>     }
>>     NSLog(@"didFixIdentifier = %d", didFixIdentifier);
>>     if (didFixIdentifier)
>>         [pw setObject:fixedTableColumnIdentifiers
>> forKey:BDSKShownColsNamesKey];
>> }
>>
>>
>> On Dec 15, 2007, at 2:09 PM, [EMAIL PROTECTED] wrote:
>>
>>> Revision: 11927
>>>         http://bibdesk.svn.sourceforge.net/bibdesk/?
>>> rev=11927&view=rev
>>> Author:   hofman
>>> Date:     2007-12-15 14:09:45 -0800 (Sat, 15 Dec 2007)
>>>
>>> Log Message:
>>> -----------
>>> Invert dictionary with legacy column identifiers.
>>>
>>> Modified Paths:
>>> --------------
>>>   trunk/bibdesk/BDSKAppController.m
>>>
>>> Modified: trunk/bibdesk/BDSKAppController.m
>>> ===================================================================
>>> --- trunk/bibdesk/BDSKAppController.m       2007-12-15 19:40:24 UTC (rev
>>> 11926)
>>> +++ trunk/bibdesk/BDSKAppController.m       2007-12-15 22:09:45 UTC (rev
>>> 11927)
>>> @@ -91,7 +91,7 @@
>>>
>>>    unsigned idx;
>>>    BOOL didFixIdentifier = NO;
>>> -    NSDictionary *legacyKeys = [NSDictionary
>>> dictionaryWithObjectsAndKeys:BDSKDateAddedString, @"Added",
>>> BDSKDateAddedString, @"Created", BDSKDateModifiedString,
>>> @"Modified", BDSKAuthorEditorString, @"Authors Or Editors",
>>> BDSKAuthorString, @"Authors", nil];
>>> +    NSDictionary *legacyKeys = [NSDictionary
>>> dictionaryWithObjectsAndKeys:@"Added", BDSKDateAddedString,
>>> @"Created", BDSKDateAddedString, @"Modified",
>>> BDSKDateModifiedString, @"Authors Or Editors",
>>> BDSKAuthorEditorString, @"Authors", BDSKAuthorString, nil];
>>>    NSEnumerator *keyEnum = [legacyKeys keyEnumerator];
>>>    NSString *key;
>>>
>>>
>>>
>>> This was sent by the SourceForge.net collaborative development
>>> platform, the world's largest Open Source development site.
>>>
>>> ---------------------------------------------------------------------
>>> ----
>>> SF.Net email is sponsored by:
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services
>>> for just about anything Open Source.
>>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/
>>> marketplace
>>> _______________________________________________
>>> Bibdesk-commit mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/bibdesk-commit
>>
>>
>> ----------------------------------------------------------------------
>> ---
>> SF.Net email is sponsored by:
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services
>> for just about anything Open Source.
>> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/
>> marketplace
>> _______________________________________________
>> Bibdesk-develop mailing list
>> Bibdesk-develop@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bibdesk-develop
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Bibdesk-develop mailing list
> Bibdesk-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bibdesk-develop


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to