Use swmgr's module type constants intead of magic strings.

This commit is contained in:
Paul Mosier 2022-12-27 17:46:17 -05:00
parent 90bb1d499c
commit 8bf642a8a9
2 changed files with 9 additions and 7 deletions

View File

@ -41,15 +41,17 @@ scabbard::scabbard() {
}
void scabbard::constructModlist() {
int tmpnum = 4;
modtype tmpmods[4];
strcpy(tmpmods[0].label, "Generic Books");
int tmpnum = 5;
modtype tmpmods[5];
strcpy(tmpmods[0].label, sword::SWMgr::MODTYPE_GENBOOKS);
tmpmods[0].keytype = 1;
strcpy(tmpmods[1].label, "Biblical Texts");
strcpy(tmpmods[1].label, sword::SWMgr::MODTYPE_BIBLES);
tmpmods[1].keytype = 0;
strcpy(tmpmods[2].label, "Lexicons / Dictionaries");
strcpy(tmpmods[2].label, sword::SWMgr::MODTYPE_LEXDICTS);
tmpmods[2].keytype = 2;
strcpy(tmpmods[3].label, "Commentaries");
strcpy(tmpmods[3].label, sword::SWMgr::MODTYPE_COMMENTARIES);
tmpmods[3].keytype = 0;
strcpy(tmpmods[4].label, sword::SWMgr::MODTYPE_DAILYDEVOS);
tmpmods[3].keytype = 0;
// need some throwaway ints

View File

@ -93,7 +93,7 @@ class scabbard {
/*! Struct to hold listing of different modules - each modtype corresponds
* to a different type of module - see comments for modtype */
modtype modules[4];
modtype modules[5];
/*! Get all module types loaded in and accessible by Sword.
* \returns the module types loaded into an array */