diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-25 21:13:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-25 21:13:17 +0300 |
commit | 64f2b2ad95684d871034a14c5af9a0650660db2b (patch) | |
tree | 61f9555becbf31d74ca7753c76bc84f9b32327b9 /src/gui/windows/helpwindow.cpp | |
parent | 56cea96ce8e45ac690ce755c856bcb70a202009d (diff) | |
download | manaverse-64f2b2ad95684d871034a14c5af9a0650660db2b.tar.gz manaverse-64f2b2ad95684d871034a14c5af9a0650660db2b.tar.bz2 manaverse-64f2b2ad95684d871034a14c5af9a0650660db2b.tar.xz manaverse-64f2b2ad95684d871034a14c5af9a0650660db2b.zip |
Add support for multiple help index files.
Diffstat (limited to 'src/gui/windows/helpwindow.cpp')
-rw-r--r-- | src/gui/windows/helpwindow.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
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)); + } } } |