<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 5/14/2022 4:13 AM, Hilaire Fernandes via Cuis-dev wrote:
<blockquote cite="mid:b4cf4471-175b-8b00-d093-40eb3f0dc6bd@drgeo.eu"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<p> Yes it is fine. </p>
<p> I am wondering: when executing "PreferenceNG initialize" in an
image with vector graphics it seems to break the image. I guess
a race condition. </p>
<p> To avoid this situation, I suggest you edit this method as
follow: </p>
<p> PreferenceNG>>initialize<br>
ThePreferences ifNil: [ThePreferences _ Dictionary new].<br>
... <br>
</p>
<p> It will allow to add the new preferences from the data array
and reset the existing ones with the default values from the
array (this what happen when requesting a new preference already
in the system, it just updates the existing one). A few
limitation: </p>
<ul>
<li> It will not migrate type of existing preference (should be
done by hand by inspecting the object or removing the whole
preference and initialize again), I prevent it by purpose so a
user does not mess up with the type. </li>
<li> it will not remove deprecated preferences (the ones not
anymore in the data array). Should be removed by hand.<br>
</li>
</ul>
<p>Hilaire<br>
</p>
<div>Le 13/05/2022 à 22:42, Juan Vuletich via Cuis-dev a écrit :<br>
</div>
<blockquote type="cite" cite="mid:627EC2AC.4000100@zoho.com">Hilaire,
please check that the use of Preference NG is reasonable.<br>
</blockquote>
<pre>--
GNU Dr. Geo
<a moz-do-not-send="true" href="http://drgeo.eu">http://drgeo.eu</a>
<a moz-do-not-send="true" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</blockquote>
<br>
I think that #initialize should discard everything and start anew.<br>
<br>
Please review the attach. It creates a new dictionary, populates it,
and only then installs it as the new ThePreferences. This is a
pattern that has been used in Squeak/Cuis many times.<br>
<br>
BTW, I removed #select:, and renamed #all to #allPreferences. I
think this makes the stuff easier to find with senders/implementors
(by reducing false polymorphism). I kept your author initials, as
this is essentially just some refactoring.<br>
<br>
Thanks,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
<a class="moz-txt-link-freetext" href="https://independent.academia.edu/JuanVuletich">https://independent.academia.edu/JuanVuletich</a>
<a class="moz-txt-link-freetext" href="https://www.researchgate.net/profile/Juan-Vuletich">https://www.researchgate.net/profile/Juan-Vuletich</a>
<a class="moz-txt-link-freetext" href="https://patents.justia.com/inventor/juan-manuel-vuletich">https://patents.justia.com/inventor/juan-manuel-vuletich</a>
<a class="moz-txt-link-freetext" href="https://twitter.com/JuanVuletich">https://twitter.com/JuanVuletich</a></pre>
</body>
</html>