--- a/HierarchicalFileList.st Wed Sep 07 04:47:27 2011 +0200
+++ b/HierarchicalFileList.st Wed Sep 07 14:40:14 2011 +0200
@@ -397,7 +397,20 @@
"find last item which matches the path or file
returns the item or nil if not contained in self"
- |file searchItem rootDir rootComponents searchComponents|
+ (aPathOrFile isNil or:[root isNil]) ifTrue:[
+ ^ nil
+ ].
+
+ ^ self findLastForFile:aPathOrFile inRoot:(root fileName asAbsoluteFilename)
+
+ "Modified: / 07-09-2011 / 12:15:35 / cg"
+!
+
+findLastForFile:aPathOrFile inRoot:rootDir
+ "find last item which matches the path or file
+ returns the item or nil if not contained in self"
+
+ |file searchItem rootComponents searchComponents|
(aPathOrFile isNil or:[root isNil]) ifTrue:[
^ nil
@@ -406,10 +419,8 @@
file := aPathOrFile asFilename.
file exists ifFalse:[ ^ nil ].
- rootDir := root fileName asAbsoluteFilename.
"/ file := file asAbsoluteFilename.
-
"/ (file pathName startsWith:(rootDir pathName)) ifFalse:[
(file asString startsWith:(rootDir pathName,Filename separator)) ifFalse:[
"not included"
@@ -428,6 +439,7 @@
^ searchItem
"Modified: / 11-07-2010 / 11:46:59 / cg"
+ "Created: / 07-09-2011 / 12:14:20 / cg"
! !
!HierarchicalFileList methodsFor:'update'!
@@ -1407,11 +1419,11 @@
!HierarchicalFileList class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalFileList.st,v 1.75 2011-03-24 14:34:28 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalFileList.st,v 1.76 2011-09-07 12:40:14 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalFileList.st,v 1.75 2011-03-24 14:34:28 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalFileList.st,v 1.76 2011-09-07 12:40:14 cg Exp $'
! !
HierarchicalFileList::Directory initialize!