The OLD config system in pcb-rnd

If the config system is too static

This document describes the old situation, focusing on drawbacks for a purpose: to give a hint on why some of the design decisions are made the way they are, in the new conf system.

Settings, preferences, colors, and...

The core implemented a so called Settings. It was a flat list of items, each bound to a C variable. There was a bunch of metadata attached to the items: name, type, description. Generic code could query or change the value of any setting, the C code could read and write them directly too. The content was saved to ~/.pcb/settings.

On the downside, the actual items this system knew about was pretty much static, hardwired in core. A plugin could not register its own settings. Multiple parallel methods were present in the code to overcome this limitation:

Meta-drawbacks

This also introduced a more subtle drawback: the configuration was now scattered into different files, randomly (looking from the user's point of view). In other words, the actual structure did not reflect some logical grouping, but mostly historical or source code organizational reasons.

In turn, this also limited (again somewhat randomly) what settings can be stored system-wise, user-wise, or on project or design level.

Finally, handling of file search paths was not very sophisticated. There was the system and user configuration that reflected where the stock library or the user's generic library were installed. And then there was the per-project local footprint libs that had to be somehow added too.

There was a hardwired way of handling the situation where multiple set of paths were specified. In practice it was usually possible to get this to work for the simpler cases, but it was not powerful enough to express things like "use all system and user libraries first, then the project's local library" vs. "the project's local library has priority over system libraries".