Added option to show directories always in top of the list in directory contents view.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 12 Aug 2014 14:18:00 +0200
changeset 14707 3c6471ac9f14
parent 14706 9fe30ef8880f
child 14708 2a1c1f6e9e0f
Added option to show directories always in top of the list in directory contents view. It is false by default - this is the old behaviour.
DirectoryContentsBrowser.st
--- a/DirectoryContentsBrowser.st	Mon Aug 11 13:09:50 2014 +0200
+++ b/DirectoryContentsBrowser.st	Tue Aug 12 14:18:00 2014 +0200
@@ -1223,9 +1223,10 @@
 
 setBrowserItemList:aFilteredItems
 
-    |showDir directoryUpItem locItems browserList|
+    |showDir showDirsOnTop directoryUpItem locItems browserList|
 
     showDir := self viewDirsInContentsBrowser value.
+    showDirsOnTop := self showDirectoriesOnTop value.
 
     (showDir and:[self directory notNil and:[self directory isRootDirectory not]]) ifTrue:[
         locItems := OrderedCollection new.
@@ -1237,6 +1238,9 @@
     ] ifFalse:[
         locItems := aFilteredItems.
     ].
+    (showDir and:[showDirsOnTop]) ifTrue:[ 
+        locItems := (locItems select:[ :e | e isDirectory ]) , (locItems reject:[ :e | e isDirectory])
+    ].
     self updateToExternFileHolderLock doLocked:[
         browserList := self browserItemList.
 
@@ -1251,6 +1255,7 @@
     self selectCurrentFiles.
 
     "Modified: / 20-03-2012 / 12:17:14 / cg"
+    "Modified: / 12-08-2014 / 13:14:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateDiskUsage
@@ -3487,10 +3492,10 @@
 !DirectoryContentsBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.265 2014-07-04 10:21:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.266 2014-08-12 12:18:00 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.265 2014-07-04 10:21:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.266 2014-08-12 12:18:00 vrany Exp $'
 ! !