| replaced by or:
authorClaus Gittinger <cg@exept.de>
Mon, 29 Oct 2012 13:19:04 +0100
changeset 2938 8e9207531826
parent 2937 7c1b0cbd5862
child 2939 5e2872ba0b95
| replaced by or:
DirectoryView.st
--- a/DirectoryView.st	Mon Oct 29 12:53:35 2012 +0100
+++ b/DirectoryView.st	Mon Oct 29 13:19:04 2012 +0100
@@ -920,16 +920,14 @@
 
 validateAttributes
 
-    |info mode| 
+    |info mode suffix| 
 
     permissions := String new:9 withAll:$-.
 
-    (info := fileName info) isNil
-    ifTrue:
-    [
+    (info := fileName info) isNil ifTrue:[
         iconKey := #lockedFileIcon.
         size    := owner := group := '?'.
-      ^ self
+        ^ self
     ].        
     size   := info size.
     modified := info modificationTime printString.
@@ -944,45 +942,29 @@
         ]
     ].
 
-    fileName isReadable
-    ifTrue:
-    [
-        info type == #symbolicLink
-        ifTrue:
-        [
-            ^iconKey := #linkedFileIcon
-        ]
-        ifFalse:
-        [       
-            ((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol))
-            or:
-            [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)])
-            ifFalse:
-            [
-                iconKey := #fileIcon.
-                (Image isImageFileSuffix:fileName suffix)
-                ifTrue:
-                [
-                    ^iconKey := #imageFileIcon
-                ].
-                (fileName suffix = 'o') | (fileName suffix = 'so')
-                ifTrue:
-                [
-                    ^iconKey := #binaryFileIcon
-                ].
-
-                fileName isExecutableProgram
-                ifTrue:
-                [
-                    ^iconKey := #exeFileIcon
-                ]
-            ]
-        ]
-    ] 
-    ifFalse:
-    [
+    fileName isReadable ifFalse:[
         ^iconKey := #lockedFileIcon
     ].
+    info type == #symbolicLink ifTrue:[
+        ^ iconKey := #linkedFileIcon
+    ].
+    suffix := fileName suffix.
+
+    ((DirectoryView::FileRow class implements: (iconKey := (suffix, 'FileIcon') asSymbol))
+        or: [DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)]
+    ) ifFalse:[
+        iconKey := #fileIcon.
+        ((suffix = 'o') or:[suffix = 'so']) ifTrue: [
+            ^iconKey := #binaryFileIcon
+        ].
+        (Image isImageFileSuffix:suffix) ifTrue: [
+            ^iconKey := #imageFileIcon
+        ].
+
+        fileName isExecutableProgram ifTrue:[
+            ^iconKey := #exeFileIcon
+        ]
+    ]
 ! !
 
 !DirectoryView class methodsFor:'documentation'!