mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:10:47 +00:00
Better fix for opening directories
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5326 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7ff76a1ff8
commit
76b168ec8e
2 changed files with 25 additions and 5 deletions
|
@ -1224,6 +1224,9 @@
|
||||||
// Nothing selected
|
// Nothing selected
|
||||||
if (i == NSNotFound)
|
if (i == NSNotFound)
|
||||||
return nil;
|
return nil;
|
||||||
|
// Nothing selected in rightmost column
|
||||||
|
if (i < [self lastColumn])
|
||||||
|
return nil;
|
||||||
|
|
||||||
matrix = [self matrixInColumn: i];
|
matrix = [self matrixInColumn: i];
|
||||||
return [matrix selectedCells];
|
return [matrix selectedCells];
|
||||||
|
|
|
@ -182,11 +182,24 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
||||||
NSMutableArray *ret = [NSMutableArray array];
|
NSMutableArray *ret = [NSMutableArray array];
|
||||||
NSString *dir = [self directory];
|
NSString *dir = [self directory];
|
||||||
|
|
||||||
dir = [dir stringByDeletingLastPathComponent];
|
if ([_browser selectedColumn] != [_browser lastColumn])
|
||||||
while ((currCell = [cellEnum nextObject]))
|
|
||||||
{
|
{
|
||||||
[ret addObject: [NSString stringWithFormat: @"%@/%@", dir,
|
/*
|
||||||
[currCell stringValue]]];
|
* The last column doesn't have anything selected - so we must
|
||||||
|
* have selected a directory.
|
||||||
|
*/
|
||||||
|
if (_canChooseDirectories == YES)
|
||||||
|
{
|
||||||
|
[ret addObject: dir];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while ((currCell = [cellEnum nextObject]))
|
||||||
|
{
|
||||||
|
[ret addObject: [NSString stringWithFormat: @"%@/%@", dir,
|
||||||
|
[currCell stringValue]]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +286,7 @@ createRowsForColumn: (int)column
|
||||||
NSString *path = [sender pathToColumn: column], *file;
|
NSString *path = [sender pathToColumn: column], *file;
|
||||||
NSArray *files = [fm directoryContentsAtPath: path showHidden: NO];
|
NSArray *files = [fm directoryContentsAtPath: path showHidden: NO];
|
||||||
NSArray *extArray = [NSArray arrayWithObjects: @"app",
|
NSArray *extArray = [NSArray arrayWithObjects: @"app",
|
||||||
@"bundle", @"debug", @"profile", nil];
|
@"bundle", @"debug", @"palette", @"profile", nil];
|
||||||
unsigned i, count;
|
unsigned i, count;
|
||||||
BOOL exists, isDir;
|
BOOL exists, isDir;
|
||||||
NSBrowserCell *cell;
|
NSBrowserCell *cell;
|
||||||
|
@ -285,6 +298,10 @@ createRowsForColumn: (int)column
|
||||||
if ([files lastObject] == nil)
|
if ([files lastObject] == nil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ([_fileTypes count] > 0)
|
||||||
|
{
|
||||||
|
extArray = [extArray arrayByAddingObjectsFromArray: _fileTypes];
|
||||||
|
}
|
||||||
|
|
||||||
// sort list of files to display
|
// sort list of files to display
|
||||||
if (_delegateHasCompareFilter == YES)
|
if (_delegateHasCompareFilter == YES)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue