load resources from package directory, if present
authorClaus Gittinger <cg@exept.de>
Wed, 01 Dec 1999 20:04:00 +0100
changeset 3049 d5f2b3f66e37
parent 3048 df43567e46cd
child 3050 55940674bfa4
load resources from package directory, if present
ResourcePack.st
--- a/ResourcePack.st	Wed Dec 01 19:42:26 1999 +0100
+++ b/ResourcePack.st	Wed Dec 01 20:04:00 1999 +0100
@@ -195,29 +195,16 @@
     "get the full resource definitions for aClass (i.e. with super packs).
      Also leave the resulting pack in the cache for faster access next time."
 
-    |nm pack superPack pkg prj prjDir baseName pathes|
+    |nm pack superPack pkg prj prjDir baseName path|
 
     nm := aClass resourcePackName.
     pack := self searchCacheFor:nm.
     pack notNil ifTrue:[^ pack].
 
-    pkg := aClass package.
-    "/ search in the classes package directory first ...
+    baseName := (Smalltalk fileNameForClass:nm) , '.rs'.
 
-    "/ there might be a package specific resource directory ...
-    "/ in the directory, from which the project was loaded
-    prj := Project projectWithId:pkg.
-    prj notNil ifTrue:[
-        prjDir := prj directory.
-    ] ifFalse:[
-        prjDir := 'packages/' , (pkg copyReplaceAll:$: with:$/).
-        pathes := Smalltalk constructPathFor:prjDir.
-        pathes size > 0 ifTrue:[
-            prjDir := pathes first , '/' , prjDir
-        ]
-    ].
-
-    baseName := (Smalltalk fileNameForClass:nm) , '.rs'.
+    "/ search in the classes package directory first ...
+    prjDir := Smalltalk projectDirectoryForClass:aClass.
 
     (prjDir notNil 
     and:[(prjDir := prjDir asFilename) exists
@@ -238,7 +225,7 @@
      ResourcePack for:TextView     
      ResourcePack for:CodeView
      ResourcePack for:Workspace  
-     ResourcePack for:View  
+     ResourcePack for:View      
      ResourcePack for:ErrorLogger 
      Workspace classResources
     "
@@ -751,6 +738,6 @@
 !ResourcePack class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.57 1999-12-01 18:32:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.58 1999-12-01 19:04:00 cg Exp $'
 ! !
 ResourcePack initialize!