From 8bf642a8a9a57466016228e3cd9e2bb4b3790c8e Mon Sep 17 00:00:00 2001 From: Paul Mosier Date: Tue, 27 Dec 2022 17:46:17 -0500 Subject: [PATCH] Use swmgr's module type constants intead of magic strings. --- scabbard.cpp | 14 ++++++++------ scabbard.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scabbard.cpp b/scabbard.cpp index 98943d7..b0aff64 100644 --- a/scabbard.cpp +++ b/scabbard.cpp @@ -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 diff --git a/scabbard.h b/scabbard.h index a2ff93f..b068f40 100644 --- a/scabbard.h +++ b/scabbard.h @@ -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 */