summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/db/groupdb.cpp14
-rw-r--r--src/resources/db/groupdb.h1
-rw-r--r--src/resources/groupinfo.h4
3 files changed, 18 insertions, 1 deletions
diff --git a/src/resources/db/groupdb.cpp b/src/resources/db/groupdb.cpp
index 4b25e94bd..c65406841 100644
--- a/src/resources/db/groupdb.cpp
+++ b/src/resources/db/groupdb.cpp
@@ -96,6 +96,9 @@ void GroupDb::loadXmlFile(const std::string &fileName,
mGroups[id].longName = XML::langProperty(node,
"longName",
"");
+ mGroups[id].showBadge = XML::getBoolProperty(node,
+ "showBadge",
+ false);
}
}
}
@@ -128,6 +131,17 @@ const std::string &GroupDb::getLongName(const int id)
return (*it).second.longName;
}
+bool GroupDb::getShowBadge(const int id)
+{
+ GroupInfos::const_iterator it = mGroups.find(id);
+ if (it == mGroups.end())
+ {
+ reportAlways("Unknown group id requested: %d", id);
+ return mEmptyGroup.showBadge;
+ }
+ return (*it).second.showBadge;
+}
+
#ifdef UNITTESTS
GroupDb::GroupInfos &GroupDb::getGroups()
{
diff --git a/src/resources/db/groupdb.h b/src/resources/db/groupdb.h
index f2c027120..4e687dea9 100644
--- a/src/resources/db/groupdb.h
+++ b/src/resources/db/groupdb.h
@@ -40,6 +40,7 @@ namespace GroupDb
const SkipError skipError);
const std::string &getName(const int id);
const std::string &getLongName(const int id);
+ bool getShowBadge(const int id);
typedef std::map<int, GroupInfo> GroupInfos;
diff --git a/src/resources/groupinfo.h b/src/resources/groupinfo.h
index 1ca0ed30e..59a79a9bd 100644
--- a/src/resources/groupinfo.h
+++ b/src/resources/groupinfo.h
@@ -29,13 +29,15 @@ struct GroupInfo final
{
GroupInfo() :
name(),
- longName()
+ longName(),
+ showBadge(false)
{ }
A_DEFAULT_COPY(GroupInfo)
std::string name;
std::string longName;
+ bool showBadge;
};
#endif // RESOURCES_GROUPINFO_H