summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/badgesdb.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/resources/db/badgesdb.cpp b/src/resources/db/badgesdb.cpp
index d7476c7f0..9efd57d82 100644
--- a/src/resources/db/badgesdb.cpp
+++ b/src/resources/db/badgesdb.cpp
@@ -20,6 +20,10 @@
#include "resources/db/badgesdb.h"
+#include "configuration.h"
+
+#include "resources/beingcommon.h"
+
#include "utils/xmlutils.h"
#include "debug.h"
@@ -32,9 +36,11 @@ namespace
bool mLoaded = false;
}
-static void loadDB(const std::string &name, BadgesInfos &arr)
+static void loadXmlFile(const std::string &file,
+ const std::string &name,
+ BadgesInfos &arr)
{
- readXmlStringMap("badges.xml",
+ readXmlStringMap(file,
"badges",
name,
"badge",
@@ -43,6 +49,20 @@ static void loadDB(const std::string &name, BadgesInfos &arr)
arr);
}
+static void loadDB(const std::string &name, BadgesInfos &arr)
+{
+ loadXmlFile(paths.getStringValue("badgesFile"),
+ name, arr);
+ loadXmlFile(paths.getStringValue("badgesPatchFile"),
+ name, arr);
+
+ StringVect listVect;
+ BeingCommon::getIncludeFiles(paths.getStringValue(
+ "badgesPatchDir"), listVect, ".xml");
+ FOR_EACH (StringVectCIter, itVect, listVect)
+ loadXmlFile(*itVect, name, arr);
+}
+
void BadgesDB::load()
{
if (mLoaded)