On Feb 18, 2009, at 3:17 AM, Krzysztof KosiĆski wrote:
Ted Gould wrote:
Heh, or maybe just use GConf ;)
There was a discussion earlier about this. I was a big proponent of it. In fact it was one of the reasons I refactored prefs handling into a single object and kept the XML implementation details of Inkscape::Preferences inaccessible from its public interface. We decided against it because it would cause Inkscape to have two sets of preferences for people who use both KDE and Gnome (in Gnome it would use GConf, but in KDE it would fall back to a different set of preferences from the XML file). If you can come up with a good idea how to handle this case, we might reconsider it.
There are a few issues with things, but I think the main thing we're seeing now is lack of modularity.
I'll have to dig in on some actual design details with various patterns, but off-hand I can describe it that we need to use some adapters and also to switch some things to push instead of poll.
In one sense we can view the preferences as a global variable, which is slightly evil. However, once we change code to have its values pushed in, instead of having each little sub-bit of code poll the preferences thing, then we can switch even more easily.
Another issue we have that is showing some problem with this is the toolbars.
I think one pattern I've heard used is "dependency injection". Many aspects of that address what we're seeing in the code now.