[FIX] [BUG] [ENH] Directories w/out subdirectories appear as such in FileList2

thierry_reignier <thierry_Reignier at hotmail.com> thierry_Reignier at hotmail.com
Mon Dec 9 10:45:06 UTC 2002


Hi,

> Currently in the hierarchy list FileList2, all folders have toggles
> that make them appear to have subfolders. 

my fix was not complete... See below
but now I get further problems running
FileList2 modalFileSelectorForSuffixes: #('txt' 'rtf' 'doc')
in 3.4b

A 'C:\System Volume Information' is not understood as a file
by primLookupEntryIn: fullPath index: index. Any clue?

FileDirectoryWrapper>>hasContents
	"Return whether this directory has subfolders. The value is cached to
avoid a performance penalty.
	Also for performance reasons, the code below will just assume that
the directory does indeed have contents in a couple of cases: 
			1. If the item is not a FileDirectory (thus avoiding the cost
			of refreshing directories that are not local)
			2. If it's the root directory of a given volume"

	| parts |
	hasContents isNil ifTrue:[
		hasContents _ true. "default"
		"Divide and conquer test strategy"
		"Best test I could think of for determining if this is a local
directory"
		(item isKindOf: FileDirectory) ifFalse: [^hasContents].
		"Test to see that it's not the root directory"
		parts := item pathParts.
		(parts size = 1 or: [parts size = 2 and: [parts last ~= 'System
Volume Information']]) 
			ifTrue: [^hasContents].
		hasContents _ self contents notEmpty].
	^hasContents





More information about the Squeak-dev mailing list