[Pkg] The Trunk: SMLoader-nice.89.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jun 10 15:56:11 UTC 2017


Nicolas Cellier uploaded a new version of SMLoader to project The Trunk:
http://source.squeak.org/trunk/SMLoader-nice.89.mcz

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

Name: SMLoader-nice.89
Author: nice
Time: 10 June 2017, 5:56:06.103149 pm
UUID: 627d6699-93f3-4d5e-af7b-d8effb9da17e
Ancestors: SMLoader-mt.88

Massively replace ifNotNilDo: by ifNotNil:
We don't need two different selectors to do a single thing.

=============== Diff against SMLoader-mt.88 ===============

Item was changed:
  ----- Method: SMLoader>>selectedCategory (in category 'accessing') -----
  selectedCategory
  	"Return selected category."
+ 	^selectedCategoryWrapper ifNotNil: [:w | w withoutListWrapper]!
- 	^selectedCategoryWrapper ifNotNilDo: [:w | w withoutListWrapper]!

Item was changed:
  ----- Method: SMLoader>>selectedPackageOrRelease (in category 'private') -----
  selectedPackageOrRelease
  	"Return selected package or package release."
  
+ 	^self selectedItemWrapper ifNotNil: [:w | w withoutListWrapper]!
- 	^self selectedItemWrapper ifNotNilDo: [:w | w withoutListWrapper]!

Item was changed:
  ----- Method: SMLoaderPlus>>selectedCategoryPath (in category 'accessing') -----
  selectedCategoryPath
  	"Return selected category's path."
  	| path |
  	path := #().
  	selectedCategory
  		ifNotNil: [selectedCategory parent
+ 				ifNotNil: [:p | path := path copyWith: p].
- 				ifNotNilDo: [:p | path := path copyWith: p].
  			path := path copyWith: selectedCategory].
  	^ path!

Item was changed:
  ----- Method: SMLoaderPlus>>updateLabel: (in category 'lists') -----
  updateLabel: packagesShown
  	"Update the label of the window."
+ 	window ifNotNil: [:w | w setLabel: (self labelForShown: packagesShown)]!
- 	window ifNotNilDo: [:w | w setLabel: (self labelForShown: packagesShown)]!

Item was changed:
  ----- Method: SMPackageRelease>>httpPostContent (in category '*smloader') -----
  httpPostContent
  	"Answer the url-encoded parameters for this object."
  	| allCategories |
  	^ String streamContents:
  		[ : stream | self isNewObject
  			ifTrue:
  				[ "Make the parent release the selected."
  				self parentReleaseIndex > 0 ifTrue: [ stream nextPutAll: '1-1=' , self parentReleaseIndex , '&' ] ]
  			ifFalse:
  				[ "Make this release the selected."
  				self releaseIndex > 0 ifTrue: [ stream nextPutAll: '1-1=' , self releaseIndex , '&' ] ].
  		"The following category fields must remain in alphabetical order.  Add 1 to category indexes because web-server expects the first item to always be nil."
  		stream
  			 nextPutAll: '1-3=' , self version asString encodeForHTTP ;
  			 nextPutAll: '&1-4=' , (self compatibilityIndex + 1) ;
  			 nextPutAll: '&1-5=' , (self licenseIndex + 1) ;
  			 nextPutAll: '&1-6=' , (self maturityIndex + 1) ;
  			 nextPutAll: '&1-7=' , (self squeakVersionIndex + 1) ;
  			 nextPutAll: '&1-8=' , self downloadUrl "already http encoded" ;
  			 nextPutAll: '&1-9=1&1-10=&1-11=' "No file selection, 'cool' name or summary".
  		"Specify only the mandatory categories for 'additional categories', otherwise prior mandatory selections will be reflected in the objects categories, causing the highest-in-the-list to always win.  Ugh.."
  		allCategories := SMSqueakMap default sortedCategories.
  		{allCategories indexOf: self compatibility. 
  		allCategories indexOf: self license. 
  		allCategories indexOf: self maturity. 
  		allCategories indexOf: self squeakVersion} do:
  			[ : each | stream nextPutAll: '&1-12=' , each asString ].
  		self isCommunitySupported ifTrue: [ stream nextPutAll: '&1-12=', (allCategories indexOf: self communitySupportedCategory) asString ].
  		stream nextPutAll: '&1-13=' , self note asString encodeForHTTP.
  		self isNewObject
  			ifTrue: [ stream nextPutAll: '&1-18=Save+as+new+release' ]
  			ifFalse: [ stream nextPutAll: '&1-17=Save+changes' ].
+ 		self parentRelease ifNotNil:
- 		self parentRelease ifNotNilDo:
  			[ : pr | stream nextPutAll: '&1-19=' , pr releaseIndex ] ]!

Item was changed:
  ----- Method: SMReleaseBrowser>>parentVersion (in category 'model access') -----
  parentVersion
+ 	^ self parentRelease ifNotNil:
- 	^ self parentRelease ifNotNilDo:
  		[ : pr | pr version ]!



More information about the Packages mailing list