gnustep-dev
[Top][All Lists]
Advanced

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

Re: Methods +readable/writableTypes


From: Fred Kiefer
Subject: Re: Methods +readable/writableTypes
Date: Wed, 12 Feb 2014 21:32:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 12.02.2014 08:39, Germán Arias wrote:
> On 2014-02-11 15:44:16 -0600 Fred Kiefer <address@hidden> wrote:
> 
>>> The parameter fileTypes only contains the extension of the
>>> document that will be saved. On Ink is "RTF", in Gorm is "gorm".
>>> So, I'm trying to get all available types.
>> 
>> That is interesting. If this is the case, then it is a bug in the 
>> GNUstep code. I looked through the code in NSOpenPanel and
>> NSSavePanel and the only place that looks dubious in that regard
>> is -setRequiredFileType: which calls -setAllowedFileTypes:, but
>> even that looks correct to me. Could you please provide a stack
>> trace that shows where this issue comes from?
> 
> I added a break point inside -runModalForDirectory:file:... in
> WinNSOpenPanel.m (implementation of WinNSSavePanel). But this method
> never is called (in both, Ink and Gorm), which explain why my code
> don't works. And I can anticipate something similar occurs with the
> same method at implementation of WinNSOpenPanel. GNUstep is using
> other method to launch the panels.

Now I am completely confused. From inspecting the code I would say that
this method must get called.

The whole process of saving a file should start from
-_runSavePanelForSaveOperation: in NSDocument. This calls
-runModalSavePanel:withAccessoryView: and there we either call
-runModalForDirectory:file: or -runModal on the save panel. The later
method calls the former, which means we must end up there.
I just tested that with the standard NSSavePanel and it worked as
expected. (Apart from freezing my machine as I had a breakpoint in a
method called from a menu action. I really need to remove the
_captureMouse: calls you placed in NSMenuView years ago :-)

The only method that doesn't end there is -beginSheetForDirectory:... in
WinNSSavePanel, maybe you are taking that code path? In that case you
should move your breakpoint to
-runModalForDirectory:file:types:relativeToWindow:
Anyway, the filetypes you get passed into this methods should be the
result of -allowedFileTypes. You really should use that value.

Fred



reply via email to

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