[squeak-dev] The Trunk: Tools-nice.213.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Mar 21 20:51:16 UTC 2010
Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.213.mcz
==================== Summary ====================
Name: Tools-nice.213
Author: nice
Time: 21 March 2010, 9:50:48.016 pm
UUID: 2d2bc707-c5e3-0648-b612-51feb01345b7
Ancestors: Tools-bf.212
1) Avoid sending at: to a DirectoryEntry, it is deprecated
2) replace SortedCollection with #sort:
=============== Diff against Tools-bf.212 ===============
Item was changed:
----- Method: FileList2>>listForPatterns: (in category 'volume list and pattern') -----
listForPatterns: anArray
"Make the list be those file names which match the patterns."
| sizePad newList |
directory ifNil: [^#()].
(fileSelectionBlock isKindOf: MessageSend) ifTrue: [
fileSelectionBlock arguments: {directory entries}.
newList := fileSelectionBlock value.
fileSelectionBlock arguments: #().
] ifFalse: [
newList := Set new.
anArray do: [ :pat |
newList addAll: (directory entries select: [:entry | fileSelectionBlock value: entry value: pat]) ].
].
+ newList := newList asArray sort: self sortBlock.
- newList := newList asSortedCollection: self sortBlock.
sizePad := (newList inject: 0 into: [:mx :entry | mx max: entry fileSize])
asStringWithCommas size.
+ ^newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ]!
- newList := newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ].
- ^ newList asArray!
Item was changed:
----- Method: PluggableFileList>>listForPattern: (in category 'file list menu') -----
listForPattern: pat
"Make the list be those file names which match the pattern."
| entries sizePad newList allFiles |
entries := directory entries select: fileFilterBlock.
+ sizePad := (entries inject: 0 into: [:mx :entry | mx max: entry fileSize])
- sizePad := (entries inject: 0 into: [:mx :entry | mx max: (entry at: 5)])
asStringWithCommas size - 1.
+ newList := OrderedCollection new: entries size.
- newList := (SortedCollection new: 30) sortBlock: self sortBlock.
allFiles := pat = '*'.
entries do:
[:entry | "<dirflag><name><creationTime><modificationTime><fileSize>"
+ (allFiles or: [entry isDirectory or: [pat match: entry name]]) ifTrue:
- (allFiles or: [entry isDirectory or: [pat match: entry first]]) ifTrue:
[newList add: entry]].
+ newList := newList asArray sort: self sortBlock.
-
newList := newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ].
volList size = 1 ifTrue:
["Include known servers along with other desktop volumes"
+ ^newList ,
+ (ServerDirectory serverNames collect: [:n | '^' , n , self folderString])].
- ^ newList asArray ,
- (ServerDirectory serverNames collect: [:n | '^' , n , self folderString])].
newFiles := OrderedCollection new.
+ ^ newList!
- ^ newList asArray.!
Item was changed:
----- Method: FileList>>listForPattern: (in category 'volume list and pattern') -----
listForPattern: pat
"Make the list be those file names which match the pattern."
| sizePad newList |
+ newList := (self entriesMatching: pat) asArray sort: self sortBlock.
- newList := (self entriesMatching: pat) asSortedCollection: self sortBlock.
sizePad := (newList inject: 0 into: [:mx :entry | mx max: (entry at: 5)])
asStringWithCommas size - 1.
newList := newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ].
volList size = 1 ifTrue:
["Include known servers along with other desktop volumes"
+ ^ newList ,
- ^ newList asArray ,
(ServerDirectory serverNames collect: [:n | '^' , n , self folderString])].
+ ^ newList!
- ^ newList asArray!
Item was changed:
----- Method: FileList>>listForPatterns: (in category 'private') -----
listForPatterns: anArray
"Make the list be those file names which match the pattern."
| sizePad newList |
newList := Set new.
anArray do: [ :pat | newList addAll: (self entriesMatching: pat) ].
+ newList := newList asArray sort: self sortBlock.
+ sizePad := (newList inject: 0 into: [:mx :entry | mx max: entry fileSize])
- newList := (SortedCollection sortBlock: self sortBlock) addAll: newList; yourself.
- sizePad := (newList inject: 0 into: [:mx :entry | mx max: (entry fileSize)])
asStringWithCommas size.
newList := newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ].
volList size = 1 ifTrue:
["Include known servers along with other desktop volumes"
+ ^ newList ,
+ (ServerDirectory serverNames collect: [:n | '^' , n , self folderString])].
+ ^ newList!
- ^ newList asArray ,
- (ServerDirectory serverNames collect: [:n | '^' , n , self folderString])].
- ^ newList asArray!
Item was changed:
----- Method: FileList2>>listForPattern: (in category 'volume list and pattern') -----
listForPattern: pat
"Make the list be those file names which match the pattern."
| sizePad newList entries |
directory ifNil: [^#()].
entries := (Preferences eToyLoginEnabled
and: [Utilities authorNamePerSe notNil])
ifTrue: [directory matchingEntries: {'submittedBy: ' , Utilities authorName.} ]
ifFalse: [directory entries].
(fileSelectionBlock isKindOf: MessageSend) ifTrue: [
fileSelectionBlock arguments: {entries}.
newList := fileSelectionBlock value.
fileSelectionBlock arguments: #().
] ifFalse: [
newList := entries select: [:entry | fileSelectionBlock value: entry value: pat].
].
+ newList := newList asArray sort: self sortBlock.
+ sizePad := (newList inject: 0 into: [:mx :entry | mx max: entry fileSize])
- newList := newList asSortedCollection: self sortBlock.
- sizePad := (newList inject: 0 into: [:mx :entry | mx max: (entry at: 5)])
asStringWithCommas size - 1.
+ ^newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ]!
- newList := newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ].
- ^ newList asArray!
More information about the Squeak-dev
mailing list
|