gnustep-dev
[Top][All Lists]
Advanced

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

Re: Possible bug in NSDocumentController


From: Germán Arias
Subject: Re: Possible bug in NSDocumentController
Date: Wed, 25 Dec 2013 14:07:37 -0600

El mié, 25-12-2013 a las 14:32 +0100, Fred Kiefer escribió:
> 
> 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
> 

Right, the type "txt, TXT" is wrong, I put the comma inside the double
quotes. But after fix this I'm facing annoying problems. 


This problem only occurs on Windows (latest installers) with native
open/save panels and when the document type have more than one
extension. With current implementation the function
filter_string_from_types() at WinNSOpenPanel class, build an entry with
all types in the array. For open panels there isn't problem, because
this load all supported types. But for save panels this don't allow
change the type, because there is present only one type (the current
type).

So, in the attached patch, I change the function
filter_string_from_types() to build one entry for each type. The result,
for open panels, is the attached image panel1. As you can see, the "txt"
and "TXT" don't show the corresponding name. The test app is Ink, where
I change the InkInfo.plist to add "TXT" in Text Document.

For save panels I use -writableTypes to pass all the available types. So
the user can change the format. The attached image panel2 show the
result, as you can see the extension for "Text document" is wrong.

Germán.


Attachment: changes.patch
Description: Text Data

Attachment: open1.jpg
Description: JPEG image

Attachment: panel2.jpg
Description: JPEG image


reply via email to

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