Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.296.mcz ==================== Summary ==================== Name: EToys-nice.296 Author: nice Time: 26 April 2017, 10:58:40.211195 pm UUID: 5d6e88cb-95d4-4aea-87f1-3e8e97c96a1b Ancestors: EToys-ul.295 Favour usage of the regular #findLastOccurrenceOfString:startingAt: over the (un-)deprecated #findLastOccuranceOfString:startingAt: =============== Diff against EToys-ul.295 =============== Item was changed: ----- Method: FileList>>removeVersionNumberFromFileName (in category '*Etoys-Squeakland-file menu action') ----- removeVersionNumberFromFileName "The selected filename has a version number in it. Rename the file such that the version number is removed." | localName fullName dotPosition beforeDot earlierDotPosition within newLocalName | fullName := directory fullNameFor: fileName. localName := FileDirectory localNameFor: fullName. dotPosition := localName findLastOccuranceOfString: FileDirectory dot startingAt: 1. dotPosition > 0 ifTrue: [beforeDot := localName copyFrom: 1 to: dotPosition - 1. + earlierDotPosition := beforeDot findLastOccurrenceOfString: FileDirectory dot startingAt: 1. - earlierDotPosition := beforeDot findLastOccuranceOfString: FileDirectory dot startingAt: 1. earlierDotPosition > 0 ifTrue: [within := beforeDot copyFrom: (earlierDotPosition + 1) to: beforeDot size. (within size > 0 and: [within isAllDigits]) ifTrue: ["whew" newLocalName := (localName copyFrom: 1 to: (earlierDotPosition - 1)), (localName copyFrom: dotPosition to: localName size). (directory fileNames includes: newLocalName) ifTrue: [(self confirm: ('do you want to clobber the existing' translated, ' ', newLocalName, '?') orCancel: [^ self]) ifFalse: [^ self]. directory deleteFileNamed: localName]. directory rename: localName toBe: newLocalName. self updateFileList]]]. ! |
You missed the other send a few lines above.
Levente On Wed, 26 Apr 2017, [hidden email] wrote: > Nicolas Cellier uploaded a new version of EToys to project The Trunk: > http://source.squeak.org/trunk/EToys-nice.296.mcz > > ==================== Summary ==================== > > Name: EToys-nice.296 > Author: nice > Time: 26 April 2017, 10:58:40.211195 pm > UUID: 5d6e88cb-95d4-4aea-87f1-3e8e97c96a1b > Ancestors: EToys-ul.295 > > Favour usage of the regular #findLastOccurrenceOfString:startingAt: over the (un-)deprecated #findLastOccuranceOfString:startingAt: > > =============== Diff against EToys-ul.295 =============== > > Item was changed: > ----- Method: FileList>>removeVersionNumberFromFileName (in category '*Etoys-Squeakland-file menu action') ----- > removeVersionNumberFromFileName > "The selected filename has a version number in it. Rename the file such that the version number is removed." > > | localName fullName dotPosition beforeDot earlierDotPosition within newLocalName | > > fullName := directory fullNameFor: fileName. > localName := FileDirectory localNameFor: fullName. > dotPosition := localName findLastOccuranceOfString: FileDirectory dot startingAt: 1. > dotPosition > 0 ifTrue: > [beforeDot := localName copyFrom: 1 to: dotPosition - 1. > + earlierDotPosition := beforeDot findLastOccurrenceOfString: FileDirectory dot startingAt: 1. > - earlierDotPosition := beforeDot findLastOccuranceOfString: FileDirectory dot startingAt: 1. > earlierDotPosition > 0 ifTrue: > [within := beforeDot copyFrom: (earlierDotPosition + 1) to: beforeDot size. > (within size > 0 and: [within isAllDigits]) ifTrue: > ["whew" > newLocalName := (localName copyFrom: 1 to: (earlierDotPosition - 1)), > (localName copyFrom: dotPosition to: localName size). > (directory fileNames includes: newLocalName) > ifTrue: > [(self confirm: ('do you want to clobber the existing' translated, ' > ', newLocalName, '?') orCancel: [^ self]) ifFalse: [^ self]. > directory deleteFileNamed: localName]. > directory rename: localName toBe: newLocalName. > self updateFileList]]]. > ! |
Oh! How can I have missed that? Thanks!
2017-04-26 23:04 GMT+02:00 Levente Uzonyi <[hidden email]>: You missed the other send a few lines above. |
Free forum by Nabble | Edit this page |