On Sun, 2009-03-15 at 16:26 -0700, Krzysztof KosiĆski wrote:
Also -- and we have been talking about this forever, and we really NEED to start thinking
about implementing it -- stop using C or C++ strings for paths, and
start
using URIs.
Simply using URIs instead of paths doesn't solve much, because we would still use hardcoded path (or URI) fragments in many places. A better solution would be to abstract away asset management (markers, palettes, gradients, dash patterns...) into a class, with functions like getTemplateList(), getMarkerList(), getPaletteList(), etc. (what those methods would return needs some thought.) That way the code that uses them need not be concerned with where those assets actually are and how they are accessed.
Yes, and that was exactly what Bob was saying.
However, we have been doing more than talking about this. Code has been going in as people touch areas that address this.
Just help continue the code and add more. For example, there is a "Layer manager" now that acts as a facade to the layers so that code no longer grabs things from the object tree directly.
Also, *some* access of icons has been through the similar facade. However there are area where people have added their own code directly that does file loading.
We just need to clean those up as we go.
For example, there was coded added to the ColorDef class that loaded an icon from one of those fixed locations. I moved it up out of the ColorDef cpp.
(Ideally I'd move it to the standard icon call, but since that was changing I had waited)
But, yes, direct use of the pixmap dir constant should be refactored out.