[sword-devel] finding conf file for module

Matthew Talbert ransom1982 at gmail.com
Wed May 26 17:23:36 MST 2010

> We add "AbsoluteDataPath" as a config entry when we load the
> configuration of modules to help with things similar to this, so you can do:
> module->getConfigEntry("AbsoluteDataPath");
> to tell you where the module data lives. Though this will not officially
> help you find the config, it should be at
> {AbsoluteDataPath}/../../../../mods.d/
> We should make this easier for you and provide an 'official' way to do
> this which works with our expanded definition of where modules can be
> installed to.
> An alternative to modifying the distributed .conf file is to have your
> own 'stand off' per module config modifiers.  We do this in BibleCS with
> a file like:
> userprefs.conf:
> [KJV]
> font=somefont
> [WLC]
> font=somehebrewfront
> fontsize=24
> Then in code we provide a virtual SWMgr::Load method like:
> signed char BibleCSMGR::Load () {
>        signed char retval = SWMgr::Load();
>        userPrefs = new SWConfig("./userprefs.conf");
>        if ((config) && (userPrefs))
>                config->augment(*userPrefs);
>        return retval;
> };
> SWMgr::config is the globbed configuration of all modules.  The augment
> method on SWConfig (or the += operator) will add to or update config
> entries accordingly.

I've been meaning to write a reply for a while, but don't have the
time. In the meantime, thanks for the advice, especially this part. I
think it will be helpful.


More information about the sword-devel mailing list