From b3ad7da111d1a21f14de39d84be97104a9666017 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 Jan 2014 13:12:18 +0300 Subject: add mods tab in settings. --- src/resources/db/moddb.cpp | 7 +++++-- src/resources/db/moddb.h | 4 ++++ src/resources/modinfo.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/resources') diff --git a/src/resources/db/moddb.cpp b/src/resources/db/moddb.cpp index f66a6dc48..aa785afdb 100644 --- a/src/resources/db/moddb.cpp +++ b/src/resources/db/moddb.cpp @@ -26,7 +26,6 @@ #include "logger.h" #include "resources/beingcommon.h" -#include "resources/modinfo.h" #include "utils/dtor.h" #include "utils/gettext.h" @@ -58,7 +57,6 @@ void ModDB::loadXmlFile(const std::string &fileName) { logger->log("Mods Database: Error while loading %s!", fileName.c_str()); - mLoaded = true; return; } @@ -109,3 +107,8 @@ ModInfo *ModDB::get(const std::string &name) else return i->second; } + +const ModInfos &ModDB::getAll() +{ + return mModInfos; +} diff --git a/src/resources/db/moddb.h b/src/resources/db/moddb.h index b0944e574..b09c47747 100644 --- a/src/resources/db/moddb.h +++ b/src/resources/db/moddb.h @@ -23,6 +23,8 @@ #ifndef RESOURCES_DB_MODDB_H #define RESOURCES_DB_MODDB_H +#include "resources/modinfo.h" + #include #include "localconsts.h" @@ -38,6 +40,8 @@ namespace ModDB ModInfo *get(const std::string &name) A_WARN_UNUSED; void loadXmlFile(const std::string &fileName); + + const ModInfos &getAll(); } #endif // RESOURCES_DB_MODDB_H diff --git a/src/resources/modinfo.h b/src/resources/modinfo.h index b8e52f027..e2acf31cd 100644 --- a/src/resources/modinfo.h +++ b/src/resources/modinfo.h @@ -59,5 +59,6 @@ class ModInfo final typedef std::map ModInfos; typedef ModInfos::iterator ModInfoIterator; +typedef ModInfos::const_iterator ModInfoCIterator; #endif // RESOURCES_MODINFO_H -- cgit v1.2.3-70-g09d2