Skip to content

Commit

Permalink
ModuleStore::createSWMgr / Refactor creation of markupFilterMgr
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-klein committed Jan 21, 2024
1 parent 8b9ebcf commit 5193482
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/sword_backend/module_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ SWMgr* ModuleStore::createSWMgr()
isAndroid = true;
#endif

MarkupFilterMgr* markupFilterMgr = new MarkupFilterMgr(sword::FMT_OSIS, sword::ENC_UTF8);

if (customHomeDir != "" || isAndroid) {
swMgr = new SWMgr(this->_fileSystemHelper.getUserSwordDir().c_str(),
true, // autoload
new MarkupFilterMgr(sword::FMT_OSIS, sword::ENC_UTF8),
markupFilterMgr,
false, // multiMod
false); // augmentHome

Expand All @@ -82,21 +84,21 @@ SWMgr* ModuleStore::createSWMgr()
#ifdef _WIN32
swMgr = new SWMgr(this->_fileSystemHelper.getUserSwordDir().c_str(),
true, // autoload
new MarkupFilterMgr(sword::FMT_OSIS, sword::ENC_UTF8),
markupFilterMgr,
false, // multimod
true); // augmentHome

// This has been disabled because it lead to a crash.
// We're keeping it here for now in case this becomes relevant again.
// this->_mgr->augmentModules(this->_fileSystemHelper.getSystemSwordDir().c_str());
#elif defined(__APPLE__)
swMgr = new SWMgr(new MarkupFilterMgr(sword::FMT_OSIS, sword::ENC_UTF8));
swMgr = new SWMgr(markupFilterMgr);

stringstream appSupport;
appSupport << string(getenv("HOME")) << "/Library/Application Support/Sword";
swMgr->augmentModules(appSupport.str().c_str());
#else // LINUX!
swMgr = new SWMgr(new MarkupFilterMgr(sword::FMT_OSIS, sword::ENC_UTF8));
swMgr = new SWMgr(markupFilterMgr);
#endif
}

Expand Down

0 comments on commit 5193482

Please sign in to comment.