[Cuis-dev] Preference behavior and Parameters

Hilaire Fernandes hilaire at drgeo.eu
Thu May 5 03:34:35 PDT 2022


Hi Luciano,

Le 05/05/2022 à 08:08, Luciano Notarfrancesco a écrit :
> PreferenceNG class>>#detectType: is intended to be used for importing 
> the old preferences and will later be removed? I see it is 
> inconsistent with the initialization method that just sets

No it will not be removed. It is needed when instantiating the default 
preferences whose data are in Array like:

cuisDefaultsFont
     ^ #(
         # (aaFontsColormapDepth 4)
         #(cacheTrueTypeGlyphs true )
         #(loadOnlyLatinGlyphData true )
         #(properDisplayAlphaForFonts false )
         #(subPixelRenderColorFonts true )
     )

> type to 'aValue class' if aType is nil. To ensure consistency, the 
> initialization method could call #detectType:, unless it's going to be 
> removed. This is specially important for Booleans,

Good catch. Indeed the initialization should use the method detectType: 
when necessary. Fixed

> otherwise the preference will be stuck in true or false. And should we 
> set the type to the value class or species? Anyway, I'm not sure it's 
> a good idea to do this automatic detection of
> type, maybe it would be better to just leave it in nil.

I am not sure either. We can make it to evolve later.

>
> Also, PreferenceNG>>#printOn: capitalizes the name of the preference. 
> Since this name is used as a key to identify the preference, I think 
> it's better to show it as it is without capitalization.

Yes you are right. Now it prints as a symbol:

  PreferenceNG (#haloHandleSize = BlockClosure::[closure] in 
PreferenceNG class>>installMiscPreferences)

Hilaire

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220505/9d1eeddb/attachment.htm>


More information about the Cuis-dev mailing list