The Trunk: Files-tpr.177.mcz

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

The Trunk: Files-tpr.177.mcz

tim Rowledge uploaded a new version of Files to project The Trunk:

==================== Summary ====================

Name: Files-tpr.177
Author: tpr
Time: 8 January 2018, 2:42:23.914232 pm
UUID: c7c9aa30-635c-40a5-abff-1001a16e85ea
Ancestors: Files-tpr.176

Remove a spurious use of #checkName:fixErrors: that wilfully mangled filenames - it wasn't even the right thing to do since the #newFileNamed: carefully uses it within each path segment.

The writeSourceCode... method is still insane even after this. It looks like it is something left over from the partial i18n era.
See also crazy things like #multiCs.
See also the apparent complete nonsense of the supposed html flag; I can't find any places where actual html is generated and the only effect seems to be the file extension used ?

=============== Diff against Files-tpr.176 ===============

Item was changed:
  ----- Method: FileDirectory>>writeSourceCodeFrom:baseName:isSt:useHtml: (in category 'utilities') -----
  writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml
  "Write the source code from aStream into a file."
  | extension converter f fileName |
  aStream contents isAsciiString ifTrue: [
  stOrCsFlag ifTrue: [
  extension := (FileDirectory dot, FileStream st).
  ] ifFalse: [
  extension := (FileDirectory dot, FileStream cs).
  converter := MacRomanTextConverter new.
  ] ifFalse: [
  stOrCsFlag ifTrue: [
  extension := (FileDirectory dot, FileStream st "multiSt").
  ] ifFalse: [
  extension := (FileDirectory dot, FileStream cs "multiCs").
  converter := UTF8TextConverter new.
  fileName := useHtml ifTrue: [baseName, '.html'] ifFalse: [baseName, extension].
- fileName := self checkName: fileName fixErrors: true.
  f := self newFileNamed: fileName.
  f ifNil: [^ self error: 'Cannot open file'].
  (converter isMemberOf: UTF8TextConverter)
  ifTrue: [f binary.
  UTF8TextConverter writeBOMOn: f].
  f text.
  f converter: converter.
  f nextPutAll: aStream contents.
  f close.