Do not scan the disk at each keystrock.
Fixes
MODIFY
src/PharoLauncher-Spec2/PhLImageCreationPresenter.class.st
src/PharoLauncher-Spec2/PhLImageCreationPresenter.class.st
@@ -12,6 +12,7 @@ Class {
#traits : 'TPhLInteractionTrait',
#classTraits : 'TPhLInteractionTrait classTrait',
#instVars : [
+ 'reservedImagesNamesCache',
'isNameOk',
'imageName',
'createButton',
@@ -61,7 +62,7 @@ PhLImageCreationPresenter >> checkNewName: name [
I use a variable to know the state during the last validation."
| isValid |
- isValid := name isEmpty or: [ self application imageRepository hasImageNamed: name ].
+ isValid := name isEmpty or: [ reservedImagesNamesCache includes: name asLowercase ].
"Image already in the right state. We skip."
isNameOk = isValid ifTrue: [ ^ self ].
@@ -116,6 +117,12 @@ PhLImageCreationPresenter >> initializationScripts [
select: [ :file | file extension = 'st' ]
]
+{ #category : #initialization }
+PhLImageCreationPresenter >> initialize [
+ super initialize.
+ reservedImagesNamesCache := self application imageRepository imageNames collect: #asLowercase
+]
+
{ #category : #initialization }
PhLImageCreationPresenter >> initializePresenters [
imageName := self newTextInput

Do not scan the disk at each keystrock. 

Fixes #412