diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-06 16:19:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-06 16:19:38 +0300 |
commit | a3fdbe3f382d11fcb83d7f3c342b676837478821 (patch) | |
tree | 395cc2e18f21fa0fcc8bb24d186015497bce60b8 /src/resources/db/deaddb.cpp | |
parent | 9b57c3044aad8edbb46d57963fe0151a0b816afa (diff) | |
download | plus-a3fdbe3f382d11fcb83d7f3c342b676837478821.tar.gz plus-a3fdbe3f382d11fcb83d7f3c342b676837478821.tar.bz2 plus-a3fdbe3f382d11fcb83d7f3c342b676837478821.tar.xz plus-a3fdbe3f382d11fcb83d7f3c342b676837478821.zip |
add support for include in deadmessages.xml.
Diffstat (limited to 'src/resources/db/deaddb.cpp')
-rw-r--r-- | src/resources/db/deaddb.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp index ba4efc8a8..be7c9cade 100644 --- a/src/resources/db/deaddb.cpp +++ b/src/resources/db/deaddb.cpp @@ -35,11 +35,15 @@ namespace void DeadDB::load() { + loadXmlFile(paths.getStringValue("deadMessagesFile")); +} + +void DeadDB::loadXmlFile(const std::string &fileName) +{ if (mLoaded) unload(); - XML::Document *doc = new XML::Document( - paths.getStringValue("deadMessagesFile")); + XML::Document *doc = new XML::Document(fileName); const XmlNodePtr root = doc->rootNode(); if (!root || !xmlNameEqual(root, "messages")) @@ -52,7 +56,14 @@ void DeadDB::load() for_each_xml_child_node(node, root) { - if (xmlNameEqual(node, "message")) + if (xmlNameEqual(node, "include")) + { + const std::string name = XML::getProperty(node, "name", ""); + if (!name.empty()) + loadXmlFile(name); + continue; + } + else if (xmlNameEqual(node, "message")) { const char *const data = reinterpret_cast<const char*>( xmlNodeGetContent(node)); |