Migration Guide : Migrating from Version 8.0.3 : Change to CgScreen class>>bitmapPath and Locale class>>nlsPath
Change to CgScreen class>>bitmapPath and Locale class>>nlsPath
Reason for change
Previously there was no standardization for the representation of directory path strings that were retrieved from the INI file. Sometimes these strings were stripped of their trailing path separator when saved, sometimes a path separator was added when they were stored, and sometimes they were stored as entered (for example, from the Common Graphics bitmapPath= setting in the INI file).
Change
The Preference Settings Framework introduced in this release standardizes the representation of directory path names to include the trailing directory separator character. This affects all directory path preferences read from the INI file using the new Preference Settings Framework:
[CommonGraphics] bitmapPath=
[CommonPrinting] printPath=
[NLS Config] nlsPath=
[VAST 5.0 Compatibility] installPath=
Most of these INI file settings are normally used only by internal VA Smalltalk routines. However, user applications may have references to these setting values:
CgScreen class>>bitmapPath will now always answer an array of directory names with a trailing directory separator. There will be no empty strings (‘’) in the array.
Locale class>>nlsPath will now always answer an array of directory names with a trailing directory separator. There will be no empty strings (‘’) in the array.
Action required
You should examine your application code for senders of the methods mentioned above. Because of the inconsistency in the way directory names were previously handled, such references will often include code to add a missing directory separator before appending a filename to the directory name. Therefore, code that looks like this:
Locale nlsPath do: [:aPath | | path |
path := (aPath notEmpty and: [ aPath last = CfsDirectoryDescriptor pathSeparator ])
ifTrue: [ aPath, aFilename ]
ifFalse: [ aPath, CfsFileDescriptor pathSeparatorString, aFilename ].
“Code that does something with aPath” ]
Can be changed to this:
Locale nlsPath do: [:aPath | | path |
path := aPath, aFilename.
“Code that does something with aPath” ]
You should also example your application code for any code that sets either of these values (senders of Locale class>>nlsPath: or CgScreen class>>bitmapPath:). Ensure that the arguments to these setters are correctly constructed (Array of directory names with trailing directory separator, no empty entries).
Last modified date: 07/01/2019