Smalltalk.st
changeset 10072 1bdc8f3c8583
parent 10071 c3ac1c847c22
child 10087 eb69f28fda88
--- a/Smalltalk.st	Wed Oct 11 13:36:45 2006 +0200
+++ b/Smalltalk.st	Wed Oct 11 13:53:50 2006 +0200
@@ -591,7 +591,6 @@
     Stdout reOpen. Stderr reOpen. Stdin reOpen.
 ! !
 
-
 !Smalltalk class methodsFor:'Compatibility-Squeak'!
 
 beep
@@ -905,6 +904,7 @@
     "Created: 20.6.1997 / 16:58:28 / cg"
 ! !
 
+
 !Smalltalk class methodsFor:'browsing'!
 
 browseAllCallsOn:aSelectorSymbol
@@ -5113,43 +5113,52 @@
      then in the package directory if existing.
      Return a path or nil.
      Search order is:
-	bitmaps/<pkg>/file
-	resources/<pkg>/bitmaps/file
-	<pkg>/bitmaps/file
+        bitmaps/<pkg>/file
+        resources/<pkg>/bitmaps/file
+        <pkg>/bitmaps/file
     "
 
     |f dir packageDir pF|
 
+    ((f := aFileName asString) startsWith:'bitmaps/') ifTrue:[
+        f := aFileName copyFrom:('bitmaps/' size + 1).
+    ].
+
     aPackageIDOrNil isNil ifTrue:[
-	'Smalltalk [warning]: bitmap file access without package info' infoPrintCR.
-
-	pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps').
-	pF notNil ifTrue:[
-	    ^ pF.
-	].
-	^ nil
+        "/ this will be an error in the future
+"/        'Smalltalk [warning]: bitmap file access without package: ' infoPrint. aFileName infoPrintCR.
+"/        self halt.
+
+        pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps').
+        pF notNil ifTrue:[
+            ^ pF.
+        ].
+        f ~= aFileName ifTrue:[
+            pF := self searchPath:(self realSystemPath) for:f in:('bitmaps').
+            pF notNil ifTrue:[
+                ^ pF.
+            ].
+        ].
+        ^ nil
     ].
 
     packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
-    ((f := aFileName) startsWith:'bitmaps/') ifTrue:[
-	f := aFileName copyFrom:('bitmaps/' size + 1).
-    ].
 
     pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps/',packageDir).
     pF notNil ifTrue:[
-	^ pF.
+        ^ pF.
     ].
     pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/',packageDir,'/bitmaps').
     pF notNil ifTrue:[
-	^ pF.
+        ^ pF.
     ].
 
     dir := self projectDirectoryForPackage:aPackageIDOrNil.
     dir notNil ifTrue:[
-	pF := (dir asFilename construct:'bitmaps') constructString:f.
-	pF asFilename exists ifTrue:[
-	    ^ pF.
-	].
+        pF := (dir asFilename construct:'bitmaps') constructString:f.
+        pF asFilename exists ifTrue:[
+            ^ pF.
+        ].
     ].
     ^ nil
 
@@ -5160,7 +5169,7 @@
      Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg'
     "
 
-    "Modified: / 08-09-2006 / 18:02:04 / cg"
+    "Modified: / 11-10-2006 / 13:53:18 / cg"
 !
 
 getFileInFileName:aFileName
@@ -5295,42 +5304,51 @@
      and in a packages directory.
      Return the absolute filename or nil if none is found.
      Search order is:
-	resources/<pkg>/file
-	<pkg>/resources/file
+        resources/<pkg>/file
+        <pkg>/resources/file
     "
 
     |pF f dir packageDir|
 
+    ((f := aFileName asString) startsWith:'resources/') ifTrue:[
+        f := aFileName copyFrom:('resources/' size + 1).
+    ].
+
     aPackageIDOrNil isNil ifTrue:[
-	'Smalltalk [warning]: resource file access without package info' infoPrintCR.
-
-	pF := self searchPath:(self realSystemPath) for:aFileName in:('resources').
-	pF notNil ifTrue:[
-	    ^ pF.
-	].
-	^ nil
+        "/ this will be an error in the future
+"/        'Smalltalk [warning]: resource file access without package: ' infoPrint. aFileName infoPrintCR.
+"/        self halt.
+
+        pF := self searchPath:(self realSystemPath) for:aFileName in:('resources').
+        pF notNil ifTrue:[
+            ^ pF.
+        ].
+        f ~= aFileName ifTrue:[
+            pF := self searchPath:(self realSystemPath) for:f in:('resources').
+            pF notNil ifTrue:[
+                ^ pF.
+            ].
+        ].
+        ^ nil
     ].
 
     packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
-    ((f := aFileName asString) startsWith:'resources/') ifTrue:[
-	f := aFileName copyFrom:('resources/' size + 1).
-    ].
 
     pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/',packageDir).
     pF notNil ifTrue:[
-	^ pF.
+        ^ pF.
     ].
 
     dir := self projectDirectoryForPackage:aPackageIDOrNil.
     dir notNil ifTrue:[
-	pF := (dir asFilename construct:'resources') constructString:f.
-	pF asFilename exists ifTrue:[
-	    ^ pF.
-	].
-	pF := (dir asFilename construct:'styles') constructString:f.
-	pF asFilename exists ifTrue:[
-	    ^ pF.
-	].
+        pF := (dir asFilename construct:'resources') constructString:f.
+        pF asFilename exists ifTrue:[
+            ^ pF.
+        ].
+        pF := (dir asFilename construct:'styles') constructString:f.
+        pF asFilename exists ifTrue:[
+            ^ pF.
+        ].
     ].
     ^ nil
 
@@ -5340,6 +5358,8 @@
      Smalltalk getResourceFileName:'mswindowsXP.style' forPackage:'stx:libview'
      Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview'
     "
+
+    "Modified: / 11-10-2006 / 13:53:43 / cg"
 !
 
 getSourceFileName:aFileName
@@ -6853,5 +6873,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.765 2006-10-11 11:36:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.766 2006-10-11 11:53:50 cg Exp $'
 ! !