<html><head></head><body><div dir="auto">Important typo:<br><br>- We could set option values from the source to the destination, I suppose, but still that would give you what you want.<br>+ We could set option values from the source to the destination, I suppose, but still that WOULDN'T give you what you want.</div><br><br><div class="gmail_quote"><div dir="auto">On October 29, 2023 11:21:12 MST, "Troy A. Griffitts" <scribe@crosswire.org> wrote:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><div dir="auto">Hi David,<br><br>On October 29, 2023 10:52:50 MST, "David "Judah's Shadow" Blue" <yudahsshadow@gmx.com> wrote:<br><br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><div dir="auto">The next class at play is the library class that also has a private member<br>swordLibrary,<br><br>sword::SWMgr swordLibrary;<br></div></blockquote><div dir="auto"><br>This is the issue. Since you are declaring an instance of SWMgr here, it will get constructed in your library class c-tor with its own set of module and filter, etc. objects. Then in setSwordLibrary you assign that fully constructed local instance to a reference to the instance you newed outside.<br><br>SWMgr is a factory object and assigning one factory to another doesn't equate to a clear action. We could set option values from the source to the destination, I suppose, but still that would give you what you want. I would suggest changing this swordLibrary property of your library class to a pointer. Then things should work as you expect.<br><br>Hope this helps.<br><br>Troy<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><div dir="auto"><br>and a setSwordLibrary(), method,<br><br>void Library::setSwordLibrary(sword::SWMgr &library) {<br> this->swordLibrary = library;<br>}<br><br>it also has the method in question getModuleList,<br><br><br>std::list< std::string > Library::getModuleList(std::string moduleType) {<br> std::string module = "";<br> sword::ModMap::iterator libraryIterator;<br> std::list<std::string> moduleList;<br> std::string selectedType;<br> std::string modType;<br><br> std::string bible = sword::SWMgr::MODTYPE_BIBLES;<br> std::string comentary = sword::SWMgr::MODTYPE_COMMENTARIES;<br> std::string devo = sword::SWMgr::MODTYPE_DAILYDEVOS;<br> std::string book = sword::SWMgr::MODTYPE_GENBOOKS;<br> std::string dict = sword::SWMgr::MODTYPE_LEXDICTS;<br><br> if(moduleType == "bible") {<br> selectedType = bible;<br> }<br> else if(moduleType == "commentary") {<br> selectedType = comentary;<br> }<br> else if(moduleType == "devotion") {<br> selectedType = devo;<br> }<br> else if(moduleType == "book") {<br> selectedType = book;<br> }<br> else if(moduleType == "dictionary") {<br> selectedType = dict;<br> }<br> else {<br> //We should never get here but you never know.<br> module = "Invalid type";<br> moduleList.push_back(module);<br> return moduleList;<br> }<br><br> for(libraryIterator = this->swordLibrary.Modules.begin();<br> libraryIterator != this->swordLibrary.Modules.end();<br> libraryIterator++) {<br><br> sword::SWModule *tempMod = libraryIterator->second;<br><br> modType = tempMod->getType();<br><br> if(modType == selectedType) {<br> module = "For ";<br> module += tempMod->getDescription();<br> module += " select ";<br> module += tempMod->getName();<br> moduleList.push_front(module);<br> module = "";<br> }<br> }<br><br> return moduleList;<br><br>}<br></div></blockquote><div dir="auto"><br></div></pre></blockquote></div><div dir="auto"><div class='k9mail-signature'>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></div></body></html>