@Thomas: how about this:
We check C::B's location on startup (windows only) and if it's on a removable drive and we have read/write access, we use the same folder as the config folder. In all other cases we use the user's home folder. I think this should cover all parties...
Hmm... sounds like a lot of mischief... how to figure out if a drive is removable? And it should still work regardless of whether or not we have write access.
As it is now, it will read the config file from the user's profile folder (where it is normally, and where it belongs). This is "normal" operation which 95% of all users will want 95% of the time.
If reading that config that fails, the program will attempt read the config from the program's location (possibly on CDROM or an USB stick), and write it back onto that medium if allowed to do so (failure, as on CDROMs or write-protected media, will be silently ignored). This is is exactly what you would want, too... you would not want to install or possibly overwrite any files on someone else's computer just because you happen to plug in a USB stick with Code::Blocks on it!
However, it is still possible to copy a config file to the user's profile folder, and Code::Blocks will use that one, even when launched from CDROM. Thus, different users can still customise their program with persistent settings the way they want it, even if they don't have the program on the hard disk at all and they all share one copy on a CDROM. All it takes is copying the config file from the CDROM to the profile folder once.
It looks like keybinder and dragscroll will have to de-couple from the sdk even more and start searching the directories themselves. Oh well....
Why does dragscroll have to write config files at all? I understand that wxKeyBinder is a nasty bit of software, so ok... granted on that one. But what is in the dragscroll plugin that cannot be stored in the normal configuration file? I just don't get it, sorry
The config manager was written to allow you to save and restore your settings with one line of code (such as
ConfigManager::Get(_T("dragscroll"))->Write(_T("enable"), m_enable); ) without needing to bother about such annoying things as files and paths, serialising/unserialising data, removable media, and installations.
You are
expected to write your configurations to the config file, not to brew your own.
However, if you do your own thing, that's fine, but then you have to do all the nasty work for portability, too...
Anyway, if it absolutely has to be, we can add something like
GetActiveConfigfilesFolder(). I don't think it is any good, because it solves one problem while opening another at the same time, but if that's what everybody wants, then so be it.