keep info instead of type alone
authorca
Thu, 10 Oct 2002 17:45:21 +0200
changeset 1099 81e2d4217524
parent 1098 4b5a0721ec55
child 1100 a8c44ef83781
keep info instead of type alone
DirectoryContents.st
--- a/DirectoryContents.st	Thu Oct 10 09:40:55 2002 +0200
+++ b/DirectoryContents.st	Thu Oct 10 17:45:21 2002 +0200
@@ -22,7 +22,7 @@
 !
 
 Object subclass:#DirectoryContentsItem
-	instanceVariableNames:'type fileName'
+	instanceVariableNames:'info fileName'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:DirectoryContents
@@ -439,11 +439,10 @@
 
             mountInfo := mountPoints detect:[:mInfo | mInfo mountPointPath = file name] ifNone:nil.
             (mountInfo notNil and:[mountInfo isRemote]) ifTrue:[
-                type := #remoteDirectory.
+                eachItem info:#remoteDirectory.
             ] ifFalse:[
-                type := file type
+                eachItem info:file info.
             ].
-            eachItem type:type.
         ].
     ].
 ! !
@@ -502,16 +501,18 @@
     fileName := something.
 !
 
+info:something
+    "set the value of the instance variable 'type' (automatically generated)"
+
+    info := something.
+!
+
 type
     "return the value of the instance variable 'type' (automatically generated)"
 
-    ^ type
-!
-
-type:something
-    "set the value of the instance variable 'type' (automatically generated)"
-
-    type := something.
+    info isSymbol ifTrue:[^ info].
+    info isNil ifTrue:[^ info].
+    ^ info type
 ! !
 
 !DirectoryContents::DirectoryContentsItem methodsFor:'printing'!
@@ -524,17 +525,20 @@
 !DirectoryContents::DirectoryContentsItem methodsFor:'queries'!
 
 isDirectory
-    ^ (type == #directory or:[type == #remoteDirectory])
+    |t|
+
+    t := self type.
+    ^ (t == #directory or:[t == #remoteDirectory])
 !
 
 isRemoteDirectory
-    ^ type == #remoteDirectory
+    ^ info == #remoteDirectory
 ! !
 
 !DirectoryContents class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/DirectoryContents.st,v 1.18 2002-10-10 07:33:55 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/DirectoryContents.st,v 1.19 2002-10-10 15:45:21 ca Exp $'
 ! !
 
 DirectoryContents initialize!