[squeak-dev] The Trunk: Network-topa.221.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 7 21:47:12 UTC 2018


Tobias Pape uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-topa.221.mcz

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

Name: Network-topa.221
Author: topa
Time: 7 March 2018, 10:47:10.905474 pm
UUID: 97fe2e2e-af08-4563-be27-8eb163d1bafe
Ancestors: Network-tpr.220

Slight improvement to tim's improvement

=============== Diff against Network-tpr.220 ===============

Item was changed:
  ----- Method: MailComposition>>addAttachment (in category 'actions') -----
  addAttachment
- 	| file  fileName |
- 	
- 	self saveFields.
- 	fileName := FileChooserDialog openOn: FileDirectory default pattern: nil label: 'Choose attachment'.
- 	fileName ifNil: [^self].
  
+ 	self saveFields.
+ 	(FileChooserDialog openOn: FileDirectory default pattern: nil label: 'Choose attachment') ifNotNil:
+ 		[:fileName |
+ 		FileStream readOnlyFileNamed: fileName do: 
+ 			[:file |
+ 			file binary.
+ 			mailMessage
+ 				addAttachmentFrom: file
+ 				withName: (FileDirectory localNameFor: fileName)].
+ 			self changed: #messageText]. !
- 	file := FileStream readOnlyFileNamed: fileName.
- 	file ifNotNil: [file binary.
- 			mailMessage addAttachmentFrom: file withName:  (FileDirectory localNameFor: fileName) .
- 			file close.
- 			self changed: #messageText] !



More information about the Squeak-dev mailing list