#BUGFIX by cg
class: ResourcePack class
added: #newDefaultResourcePackForPackage:
changed: #forPackage:resourceFileName:cached:
--- a/ResourcePack.st Wed Oct 24 14:36:56 2018 +0200
+++ b/ResourcePack.st Wed Oct 24 18:07:22 2018 +0200
@@ -355,7 +355,7 @@
package isNil ifTrue:[
'[ResourcePack] warning: nil package asking for resource file'.
- ^ self newDefaultResourcePack
+ ^ self newDefaultResourcePackForPackage:package
].
fullName := (package copyReplaceAll:$: with:$/),'/resources/',resourceFileName.
@@ -366,7 +366,7 @@
(FailedToLoadPacks includes:fullName) ifTrue:[
"/ it already failed to load - do not try again
- pack := self newDefaultResourcePack.
+ pack := self newDefaultResourcePackForPackage:package.
self addAdditionalSuperPacksForPackage:package to:pack.
^ pack
].
@@ -398,7 +398,7 @@
].
FailedToLoadPacks add:fullName.
- pack := self newDefaultResourcePack.
+ pack := self newDefaultResourcePackForPackage:package.
self addAdditionalSuperPacksForPackage:package to:pack.
^ pack
@@ -412,7 +412,7 @@
"
"Modified: / 28-09-2011 / 15:55:30 / cg"
- "Modified: / 17-09-2018 / 12:55:54 / Claus Gittinger"
+ "Modified: / 24-10-2018 / 18:06:02 / Claus Gittinger"
!
fromFile:aFileName
@@ -476,6 +476,26 @@
].
superPack notNil ifTrue:[ rsrcs addSuperPack:superPack ].
^ rsrcs
+!
+
+newDefaultResourcePackForPackage:package
+ |rsrcs cls superPack|
+
+ rsrcs := ResourcePack new.
+ package ~= 'stx:libtool' ifTrue:[
+ (cls := Smalltalk classNamed:'stx_libtool') notNil ifTrue:[
+ superPack := cls classResources
+ ].
+ ].
+ package ~= 'stx:libview' ifTrue:[
+ (cls := Smalltalk classNamed:'stx_libview') notNil ifTrue:[
+ superPack := cls classResources
+ ].
+ ].
+ superPack notNil ifTrue:[ rsrcs addSuperPack:superPack ].
+ ^ rsrcs
+
+ "Created: / 24-10-2018 / 18:07:25 / Claus Gittinger"
! !
!ResourcePack class methodsFor:'private'!