diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/defaults.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/helpwindow.cpp | 24 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp index 82540150b..2ba787af2 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -452,6 +452,7 @@ DefaultsData* getBrandingDefaults() AddDEF("screenshots", "ManaPlus"); AddDEF("defaultUpdateHost", ""); AddDEF("helpPath", ""); + AddDEF("tagsPath", ""); AddDEF("theme", ""); AddDEF("font", "fonts/dejavusans.ttf"); AddDEF("boldFont", "fonts/dejavusans-bold.ttf"); @@ -499,6 +500,7 @@ DefaultsData* getPathsDefaults() AddDEF("guiIcons", "graphics/guiicons/"); AddDEF("shaders", "graphics/shaders/"); AddDEF("help", "help/"); + AddDEF("tags", "help/idx/"); AddDEF("badges", "graphics/badges/"); AddDEF("simpleVertexShader", "simple_vertex.glsl"); diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 48edaaab4..50e5423ac 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -144,17 +144,23 @@ void HelpWindow::loadFile(std::string file) void HelpWindow::loadTags() { - std::string helpPath = branding.getStringValue("helpPath"); + std::string helpPath = branding.getStringValue("tagsPath"); if (helpPath.empty()) - helpPath = paths.getStringValue("help"); - StringVect lines; - Files::loadTextFile(helpPath.append("tags.idx"), lines); - FOR_EACH (StringVectCIter, it, lines) + helpPath = paths.getStringValue("tags"); + + StringVect filesVect; + Files::getFilesInDir(helpPath, filesVect, ".idx"); + FOR_EACH (StringVectCIter, itVect, filesVect) { - const std::string &str = *it; - const size_t idx = str.find('|'); - if (idx != std::string::npos) - mTagFileMap[str.substr(idx + 1)].insert(str.substr(0, idx)); + StringVect lines; + Files::loadTextFile(*itVect, lines); + FOR_EACH (StringVectCIter, it, lines) + { + const std::string &str = *it; + const size_t idx = str.find('|'); + if (idx != std::string::npos) + mTagFileMap[str.substr(idx + 1)].insert(str.substr(0, idx)); + } } } |