#BUGFIX by cg draft
authorClaus Gittinger <cg@exept.de>
Wed, 13 Sep 2017 10:15:45 +0200
changeset 3491 c1333ee85336
parent 3490 e3b6106384a8
child 3492 f212578d1276
#BUGFIX by cg class: DirectoryView::FileRow comment/format in: #iconOn: #retrieveImageFromFileAndRegisterOn: changed: #size #validateAttributes (send #fileSize instead of #size)
DirectoryView.st
--- a/DirectoryView.st	Wed Sep 13 10:15:21 2017 +0200
+++ b/DirectoryView.st	Wed Sep 13 10:15:45 2017 +0200
@@ -940,21 +940,23 @@
 !
 
 iconOn:aGC
-
     |icon|
-    iconKey isNil 
-    ifTrue: 
-    [
+    
+    iconKey isNil ifTrue: [
         self validateAttributes.
-        (imageFromFile isNil and: [iconKey == #imageFileIcon])
-            ifTrue:  [icon := self retrieveImageFromFileAndRegisterOn: aGC]
+        (imageFromFile isNil and: [iconKey == #imageFileIcon]) ifTrue:  [
+            icon := self retrieveImageFromFileAndRegisterOn: aGC
+        ]
     ].
-    imageFromFile == true
-        ifFalse: [icon := aGC registerImage: (self class perform: iconKey) key: iconKey]
-        ifTrue:  [icon := aGC registeredImageAt: iconKey].
-    ^icon
+    imageFromFile == true ifFalse: [
+        icon := aGC registerImage: (self class perform: iconKey) key: iconKey
+    ] ifTrue:  [
+        icon := aGC registeredImageAt: iconKey
+    ].
+    ^ icon
 
-    "Modified: / 18.2.1998 / 18:01:52 / cg"
+    "Modified: / 18-02-1998 / 18:01:52 / cg"
+    "Modified (format): / 13-09-2017 / 09:57:53 / cg"
 !
 
 modified
@@ -980,8 +982,7 @@
     maxImageFileSize := MaxImageFileSize ? 20000.
 
     imageFromFile := false.       
-    (image := aGC registeredImageAt: fileName name asSymbol) isNil
-    ifTrue:[            
+    (image := aGC registeredImageAt: fileName name asSymbol) isNil ifTrue:[            
         size < maxImageFileSize ifTrue:[     
             Error handle: [:ex|]
             do:[   
@@ -996,16 +997,25 @@
     ].
     image notNil ifTrue: [imageFromFile := true. iconKey := fileName name asSymbol].
     ^image
+
+    "Modified (format): / 13-09-2017 / 09:58:19 / cg"
 !
 
 size
+    size isNil ifTrue:[
+        self validateAttributes.
+    ].
+    
     size isNumber ifFalse:[^ size].
+
+    "/ ^ UnitConverter fileSizeStringFor:size.
+    
     size < 1000        ifTrue: [^ size printString].
     size < (100*1024)  ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb'].
     size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb'].
     ^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb'
 
-    "Modified: / 6.2.1998 / 03:38:45 / cg"
+    "Modified: / 13-09-2017 / 09:58:42 / cg"
 ! !
 
 !DirectoryView::FileRow methodsFor:'private'!
@@ -1020,7 +1030,7 @@
         size    := owner := group := '?'.
         ^ self
     ].        
-    size   := info size.
+    size   := info fileSize.
     modified := info modificationTime printString.
     owner  := OperatingSystem getUserNameFromID: info uid.
     group  := OperatingSystem getGroupNameFromID: info gid.
@@ -1056,6 +1066,8 @@
             ^ iconKey := #exeFileIcon
         ]
     ]
+
+    "Modified: / 13-09-2017 / 10:00:42 / cg"
 ! !
 
 !DirectoryView class methodsFor:'documentation'!