mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 20:50:38 +00:00
* Source/NSOpenPanel.m: Use the NSSavePanel _allowedFileTypes ivar
in place of the _fileTypes ivar. Replace calls to _setupForTypes: with -setAllowedFileTypes:. * Headers/AppKit/NSOpenPanel.h: Remove now unused _fileTypes ivar * Source/NSSavePanel.m: Treat directories whose names have extensions in the _allowedFileTypes array as file packages. Previously, we only relied on -[NSWorkspace isFilePackageAtPath:], to determine if a director is a file package, which only considers the info.plists of installed applications. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
26e09cb5f2
commit
ae4c28c8d2
4 changed files with 17 additions and 21 deletions
|
@ -100,7 +100,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
- (BOOL) _shouldShowExtension: (NSString *)extension
|
||||
{
|
||||
if (_canChooseFiles == NO ||
|
||||
(_fileTypes != nil && [_fileTypes containsObject: extension] == NO))
|
||||
(_allowedFileTypes != nil && [_allowedFileTypes containsObject: extension] == NO))
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
|
@ -211,16 +211,6 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
[super _setupForDirectory: path file: filename];
|
||||
}
|
||||
|
||||
- (void) _setupForTypes: (NSArray *)fileTypes
|
||||
{
|
||||
if (_fileTypes != fileTypes)
|
||||
{
|
||||
BOOL reload = ![_fileTypes isEqual: fileTypes];
|
||||
ASSIGN (_fileTypes, fileTypes);
|
||||
if (reload)
|
||||
[self _reloadBrowser];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
/**
|
||||
|
@ -272,12 +262,6 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
return _gs_gui_open_panel;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
TEST_RELEASE(_fileTypes);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
|
@ -474,7 +458,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
{
|
||||
[self _setupForTypes: fileTypes];
|
||||
[self setAllowedFileTypes: fileTypes];
|
||||
return [self runModalForDirectory: path
|
||||
file: name];
|
||||
}
|
||||
|
@ -484,7 +468,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
types: (NSArray *)fileTypes
|
||||
relativeToWindow: (NSWindow*)window
|
||||
{
|
||||
[self _setupForTypes: fileTypes];
|
||||
[self setAllowedFileTypes: fileTypes];
|
||||
return [self runModalForDirectory: path
|
||||
file: name
|
||||
relativeToWindow: window];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue