gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug in NSDocumentController


From: Fred Kiefer
Subject: Re: Possible bug in NSDocumentController
Date: Wed, 25 Dec 2013 14:32:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 24.12.2013 19:41, Germán Arias wrote:
> El mar, 24-12-2013 a las 11:23 +0100, Wolfgang Lux escribió:
>>> Is this correct? (line 1218 NSDocumentController.m)
>>>
>>> name = [[NSBundle mainBundle] localizedStringForKey: type
>>>                                    value: type
>>>                                    table: @"InfoPlist"];
>>>
>>>
>>> Don't should be NSHumanReadableNameKey the first "type".
>>
>> looking at Apple's documentation for the -displayNameForType: method (which 
>> contains your code excerpt) [1], I'd say the implementation is correct. The 
>> documentation contains an example showing how to provide a name for a file 
>> type called '
>> BinaryFile' and it states that
>>  you could provide a descriptive name by adding an entry in the 
>> InfoPlist.strings file:
>>  BinaryFile = "Binary file format";
>> so the lookup should indeed use type for the key argument.
>>
>> Wolfgang
>>
>> [1] 
>> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSDocumentController_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDocumentController/displayNameForType:
> 
> Well, I'm having a problem in Windows with WinUXTheme when the type is
> an array. For example:
> 
> NSHumanReadableName = "Text Document";
> NSUnixExtensions = ( txt, TXT );
> NSDOSExtensions = ( txt, TXT );
> 
> In this case:
> 
> [dc displayNameForType: type];
> 
> where type is "txt, TXT", return the same string not "Text Document", as
> expected. But no idea where is the problem.

I must admit I don't quite understand the issue at hand. You say that
the string type has the value "txt, TXT". This looks wrong to me, why
would a string that is an array of file extensions ever get used as an
argument to displayNameForType:? In GNUstep gui the only place I could
find where we call this method is NSDocument
_addItemsToSpaButtonFromArray: and this method should get a list of type
names (plus something called NSExportableAsKey which I don't remember).

Could you please give more information on the context? Or better point
to the application that shows this behaviour? And does it show up
without the WinUXTheme as well? And what about a Unix environment?
I would be surprised to learn that themes affect the working of
NSDocumentController, but then I was surprised to see my name in the
code of WinUXTheme.

Fred





reply via email to

[Prev in Thread] Current Thread [Next in Thread]