# HG changeset patch # User Claus Gittinger # Date 1351513144 -3600 # Node ID 8e9207531826c01652e30a59df4a6bf8425af499 # Parent 7c1b0cbd586218304fabffba3df7046640836720 | replaced by or: diff -r 7c1b0cbd5862 -r 8e9207531826 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'!