smalltalk.rc
branchjv
changeset 1513 4b7b0f9a8506
parent 1486 f2eb1c4525e3
--- a/smalltalk.rc	Mon Jun 05 22:10:20 2017 +0100
+++ b/smalltalk.rc	Wed Jun 07 14:41:35 2017 +0100
@@ -579,27 +579,14 @@
     idx ~~ 0 ifTrue:[
 	Smalltalk commandLineArguments removeAtIndex: idx.
     ] ifFalse:[
-
-	'smalltalk.rc [info]: reading preferences ' infoPrint.
 	( AbortOperationRequest , TerminateProcessRequest , Parser parseErrorSignal ) handle:[:ex |
 	    'READ FAILED: ' errorPrint.
 	    ex description errorPrintCR.
 	    ex return.
 	    1 halt.
-	] do:[
-	    "JV@2012-03-07: Try following settings files:
-	       $HOME/.smalltalk/settings.stx
-	       $HOME/.smalltalk/settings.rc
-	       $PWD/settings.stx
-	       $PWD/settings.rc
-
-	    in that order. Whichever is found, it is read and the rest
-	    is not used. Also, path to the file which has beed read is
-	    stored in 'UserPreferences current at:#settingsFilename'
-	    "
-	    | files continue |
-
-	    files := nil.
+	] do:[	
+	    | settings continue |
+	    
 
 	    idx := Smalltalk commandLineArguments indexOf: '--preferences'.
 	    idx ~~ 0 ifTrue:[
@@ -625,31 +612,14 @@
 		    '' errorPrintCR.
 		    ('smalltalk.rc [error]: preference file ''', file pathName,''' is not a readable (check permissions)') errorPrintCR.
 		    Smalltalk exit: 1.
-		].
-		files := Array with: file.
+		].		
 		Smalltalk commandLineArguments removeAtIndex: idx + 1.
 		Smalltalk commandLineArguments removeAtIndex: idx.
-	    ].
-	    files isNil ifTrue:[
-		files := {
-			    (Filename homeDirectory / '.smalltalk' / 'settings.stx') . "/ per-user settings file (new default?)
-			    (Filename homeDirectory / '.smalltalk' / 'settings.rc') .  "/ for backward compatibility with jv-branch
-			    (Smalltalk getSystemFileName: 'settings.stx') .            "/ old stx default
-			    (Smalltalk getSystemFileName: 'settings.rc') .             "/ for backward compatibility with jv-branch
-			 }.
+		settings := UserPreferences loadSettingsFrom: file.
+	    ] ifFalse:[
+	    	settings := UserPreferences loadSettings.
 	    ].
-	    continue := true.
-	    files do:[:each|
-		| eachFile |
-
-		(continue and:[each notNil and:[(eachFile := each asFilename) exists]]) ifTrue:[
-		    continue := false.
-		    eachFile pathName infoPrintCR.
-		    eachFile fileIn.
-		    UserPreferences current at:#settingsFilename put: eachFile pathName.
-		].
-	    ].
-	    continue ifTrue:[ '(none found)' infoPrintCR ].
+	    UserPreferences setCurrent: settings.	    
 	].
     ].
 ].