Use Filename instead of obsolete FileDirectory.
authorStefan Vogel <sv@exept.de>
Fri, 19 Sep 1997 00:52:39 +0200
changeset 1330 21a3d397233e
parent 1329 cf4ff8c407ad
child 1331 5661f0647ca0
Use Filename instead of obsolete FileDirectory.
FSelList.st
FileSelectionList.st
--- a/FSelList.st	Thu Sep 18 23:04:36 1997 +0200
+++ b/FSelList.st	Fri Sep 19 00:52:39 1997 +0200
@@ -10,8 +10,6 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:3.1.9 on 8-sep-1997 at 12:45:25 am'                  !
-
 SelectionInListView subclass:#FileSelectionList
 	instanceVariableNames:'pattern directory timeStamp directoryId directoryName
 		directoryContents directoryFileTypes fileTypes realAction
@@ -598,27 +596,21 @@
 
     |oldPath name|
 
-    nameOrDirectory isString ifTrue:[
-	name := nameOrDirectory
-    ] ifFalse:[
-	nameOrDirectory isNil ifTrue:[
-	    directory := nil.
-	    ^ self updateList
-	].
-	name := nameOrDirectory pathName
+    nameOrDirectory isNil ifTrue:[
+        directory := nil.
+        ^ self updateList
+    ].
+    directory notNil ifTrue:[
+        oldPath := directory pathName.
     ].
-    directory isNil ifTrue:[
-	directory := FileDirectory new.
-	oldPath := nil
-    ] ifFalse:[
-	oldPath := directory pathName.
-    ].
-    directory pathName:name.
+    directory := nameOrDirectory asFilename.
     realized ifTrue:[
-	(directory pathName = oldPath) ifFalse:[
-	    self updateList
-	]
+        (directory pathName = oldPath) ifFalse:[
+            self updateList
+        ]
     ]
+
+    "Modified: 18.9.1997 / 23:42:27 / stefan"
 !
 
 selectedPathname
@@ -629,9 +621,10 @@
 
     sel := self selectionValue.
     sel isNil ifTrue:[^ nil].
-    ^ directory pathName asFilename constructString:sel.
+    ^ directory constructString:sel.
 
     "Modified: 7.9.1997 / 23:49:01 / cg"
+    "Modified: 18.9.1997 / 23:49:16 / stefan"
 ! !
 
 !FileSelectionList methodsFor:'drawing'!
@@ -737,7 +730,7 @@
 !FileSelectionList methodsFor:'initialization'!
 
 initialize
-    directory := FileDirectory currentDirectory.
+    directory := Filename currentDirectory.
     stayInDirectory := ignoreParentDirectory := ignoreDirectories := false.
     ignoreFiles := quickDirectoryChange := false.
     markDirectories := true.
@@ -755,6 +748,7 @@
     "
 
     "Modified: 18.4.1996 / 18:49:19 / cg"
+    "Modified: 18.9.1997 / 18:52:03 / stefan"
 !
 
 initializeAction
@@ -768,8 +762,10 @@
 !
 
 reinitialize
-    directory := FileDirectory currentDirectory.
+    directory := Filename currentDirectory.
     super reinitialize
+
+    "Modified: 18.9.1997 / 18:52:16 / stefan"
 ! !
 
 !FileSelectionList methodsFor:'private'!
@@ -787,16 +783,15 @@
     ].
 
     ok := false.
-    oldDir := directory pathName asFilename baseName.
-
-    newDir := directory pathName , Filename separator asString , entry.
+    oldDir := directory baseName.
+    newDir := directory construct:entry.
 
     (directoryChangeCheckBlock isNil
     or:[directoryChangeCheckBlock value:newDir]) ifTrue:[
-        (directory isReadable:entry) ifFalse:[
+        newDir isReadable ifFalse:[
             warnMessage := 'not allowed to read directory %1'
         ] ifTrue:[
-            (directory isExecutable:entry) ifFalse:[
+            newDir isExecutable ifFalse:[
                 warnMessage := 'not allowed to change to directory %1'
             ] ifTrue:[
                 ok := true.
@@ -817,6 +812,7 @@
 
     "Created: 4.3.1996 / 17:45:18 / cg"
     "Modified: 26.5.1996 / 15:03:21 / cg"
+    "Modified: 18.9.1997 / 23:34:39 / stefan"
 !
 
 selectionIsDirectory
@@ -828,9 +824,10 @@
     (entry endsWith:' ...') ifTrue:[
         entry := entry copyWithoutLast:4.
     ].
-    ^ (directory typeOf:entry) == #directory
+    ^ (directory construct:entry) type == #directory
 
     "Created: 4.3.1996 / 17:43:26 / cg"
+    "Modified: 18.9.1997 / 23:37:05 / stefan"
 !
 
 updateList
@@ -855,15 +852,15 @@
     obsolete := directoryId ~~ directory id
                 or:[directoryName ~= directory pathName
                 or:[timeStamp notNil
-                    and:[directory timeOfLastChange > timeStamp]]].
+                    and:[directory modificationTime > timeStamp]]].
 
     obsolete ifTrue:[
-        timeStamp := directory timeOfLastChange.
+        timeStamp := directory modificationTime.
         directoryId := directory id.
         directoryName := directory pathName.
-        directoryContents := directory asStringCollection sort.
+        directoryContents := directory directoryContents sort.
         directoryFileTypes := OrderedCollection new.
-        directoryContents do:[:name | directoryFileTypes add:(directory typeOf:name)].
+        directoryContents do:[:name | directoryFileTypes add:(directory construct:name)type].
     ].
 
     files := directoryContents.
@@ -924,6 +921,7 @@
     self cursor:oldCursor.
 
     "Modified: 7.9.1997 / 23:50:45 / cg"
+    "Modified: 18.9.1997 / 23:43:52 / stefan"
 !
 
 visibleLineNeedsSpecialCare:visLineNr
@@ -953,7 +951,7 @@
     super realize.
 
     (timeStamp isNil 
-     or:[(directory timeOfLastChange > timeStamp) 
+     or:[(directory modificationTime > timeStamp) 
      or:[(directoryId isNil)
      or:[directoryId ~~ directory id]]]) ifTrue:[
         directoryId := nil.
@@ -961,10 +959,11 @@
     ].
 
     "Created: 24.7.1997 / 18:24:36 / cg"
+    "Modified: 18.9.1997 / 23:36:10 / stefan"
 ! !
 
 !FileSelectionList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelList.st,v 1.37 1997-09-08 18:33:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelList.st,v 1.38 1997-09-18 22:52:39 stefan Exp $'
 ! !
--- a/FileSelectionList.st	Thu Sep 18 23:04:36 1997 +0200
+++ b/FileSelectionList.st	Fri Sep 19 00:52:39 1997 +0200
@@ -10,8 +10,6 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:3.1.9 on 8-sep-1997 at 12:45:25 am'                  !
-
 SelectionInListView subclass:#FileSelectionList
 	instanceVariableNames:'pattern directory timeStamp directoryId directoryName
 		directoryContents directoryFileTypes fileTypes realAction
@@ -598,27 +596,21 @@
 
     |oldPath name|
 
-    nameOrDirectory isString ifTrue:[
-	name := nameOrDirectory
-    ] ifFalse:[
-	nameOrDirectory isNil ifTrue:[
-	    directory := nil.
-	    ^ self updateList
-	].
-	name := nameOrDirectory pathName
+    nameOrDirectory isNil ifTrue:[
+        directory := nil.
+        ^ self updateList
+    ].
+    directory notNil ifTrue:[
+        oldPath := directory pathName.
     ].
-    directory isNil ifTrue:[
-	directory := FileDirectory new.
-	oldPath := nil
-    ] ifFalse:[
-	oldPath := directory pathName.
-    ].
-    directory pathName:name.
+    directory := nameOrDirectory asFilename.
     realized ifTrue:[
-	(directory pathName = oldPath) ifFalse:[
-	    self updateList
-	]
+        (directory pathName = oldPath) ifFalse:[
+            self updateList
+        ]
     ]
+
+    "Modified: 18.9.1997 / 23:42:27 / stefan"
 !
 
 selectedPathname
@@ -629,9 +621,10 @@
 
     sel := self selectionValue.
     sel isNil ifTrue:[^ nil].
-    ^ directory pathName asFilename constructString:sel.
+    ^ directory constructString:sel.
 
     "Modified: 7.9.1997 / 23:49:01 / cg"
+    "Modified: 18.9.1997 / 23:49:16 / stefan"
 ! !
 
 !FileSelectionList methodsFor:'drawing'!
@@ -737,7 +730,7 @@
 !FileSelectionList methodsFor:'initialization'!
 
 initialize
-    directory := FileDirectory currentDirectory.
+    directory := Filename currentDirectory.
     stayInDirectory := ignoreParentDirectory := ignoreDirectories := false.
     ignoreFiles := quickDirectoryChange := false.
     markDirectories := true.
@@ -755,6 +748,7 @@
     "
 
     "Modified: 18.4.1996 / 18:49:19 / cg"
+    "Modified: 18.9.1997 / 18:52:03 / stefan"
 !
 
 initializeAction
@@ -768,8 +762,10 @@
 !
 
 reinitialize
-    directory := FileDirectory currentDirectory.
+    directory := Filename currentDirectory.
     super reinitialize
+
+    "Modified: 18.9.1997 / 18:52:16 / stefan"
 ! !
 
 !FileSelectionList methodsFor:'private'!
@@ -787,16 +783,15 @@
     ].
 
     ok := false.
-    oldDir := directory pathName asFilename baseName.
-
-    newDir := directory pathName , Filename separator asString , entry.
+    oldDir := directory baseName.
+    newDir := directory construct:entry.
 
     (directoryChangeCheckBlock isNil
     or:[directoryChangeCheckBlock value:newDir]) ifTrue:[
-        (directory isReadable:entry) ifFalse:[
+        newDir isReadable ifFalse:[
             warnMessage := 'not allowed to read directory %1'
         ] ifTrue:[
-            (directory isExecutable:entry) ifFalse:[
+            newDir isExecutable ifFalse:[
                 warnMessage := 'not allowed to change to directory %1'
             ] ifTrue:[
                 ok := true.
@@ -817,6 +812,7 @@
 
     "Created: 4.3.1996 / 17:45:18 / cg"
     "Modified: 26.5.1996 / 15:03:21 / cg"
+    "Modified: 18.9.1997 / 23:34:39 / stefan"
 !
 
 selectionIsDirectory
@@ -828,9 +824,10 @@
     (entry endsWith:' ...') ifTrue:[
         entry := entry copyWithoutLast:4.
     ].
-    ^ (directory typeOf:entry) == #directory
+    ^ (directory construct:entry) type == #directory
 
     "Created: 4.3.1996 / 17:43:26 / cg"
+    "Modified: 18.9.1997 / 23:37:05 / stefan"
 !
 
 updateList
@@ -855,15 +852,15 @@
     obsolete := directoryId ~~ directory id
                 or:[directoryName ~= directory pathName
                 or:[timeStamp notNil
-                    and:[directory timeOfLastChange > timeStamp]]].
+                    and:[directory modificationTime > timeStamp]]].
 
     obsolete ifTrue:[
-        timeStamp := directory timeOfLastChange.
+        timeStamp := directory modificationTime.
         directoryId := directory id.
         directoryName := directory pathName.
-        directoryContents := directory asStringCollection sort.
+        directoryContents := directory directoryContents sort.
         directoryFileTypes := OrderedCollection new.
-        directoryContents do:[:name | directoryFileTypes add:(directory typeOf:name)].
+        directoryContents do:[:name | directoryFileTypes add:(directory construct:name)type].
     ].
 
     files := directoryContents.
@@ -924,6 +921,7 @@
     self cursor:oldCursor.
 
     "Modified: 7.9.1997 / 23:50:45 / cg"
+    "Modified: 18.9.1997 / 23:43:52 / stefan"
 !
 
 visibleLineNeedsSpecialCare:visLineNr
@@ -953,7 +951,7 @@
     super realize.
 
     (timeStamp isNil 
-     or:[(directory timeOfLastChange > timeStamp) 
+     or:[(directory modificationTime > timeStamp) 
      or:[(directoryId isNil)
      or:[directoryId ~~ directory id]]]) ifTrue:[
         directoryId := nil.
@@ -961,10 +959,11 @@
     ].
 
     "Created: 24.7.1997 / 18:24:36 / cg"
+    "Modified: 18.9.1997 / 23:36:10 / stefan"
 ! !
 
 !FileSelectionList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionList.st,v 1.37 1997-09-08 18:33:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionList.st,v 1.38 1997-09-18 22:52:39 stefan Exp $'
 ! !