mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-03-22 03:42:49 +01:00
Make config and DB pass by reference for database classes.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
CollectionInfoBuilder::CollectionInfoBuilder(Configuration *c)
|
||||
CollectionInfoBuilder::CollectionInfoBuilder(Configuration &c)
|
||||
: Conf(c)
|
||||
{
|
||||
}
|
||||
@@ -26,7 +26,7 @@ bool CollectionInfoBuilder::LoadAllCollections()
|
||||
{
|
||||
std::vector<std::string> collections;
|
||||
|
||||
Conf->GetChildKeyCrumbs("collections", collections);
|
||||
Conf.GetChildKeyCrumbs("collections", collections);
|
||||
|
||||
if(collections.size() == 0)
|
||||
{
|
||||
@@ -92,22 +92,22 @@ bool CollectionInfoBuilder::ImportCollection(std::string name)
|
||||
std::string metadataType;
|
||||
std::string metadataPath;
|
||||
|
||||
if(!Conf->GetPropertyAbsolutePath(listItemsPathKey, listItemsPath))
|
||||
if(!Conf.GetPropertyAbsolutePath(listItemsPathKey, listItemsPath))
|
||||
{
|
||||
Logger::Write(Logger::ZONE_INFO, "Collections", "Property \"" + listItemsPathKey + "\" does not exist. Assuming \"" + name + "\" is a menu");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!Conf->GetProperty(extensionsKey, extensions))
|
||||
if(!Conf.GetProperty(extensionsKey, extensions))
|
||||
{
|
||||
Logger::Write(Logger::ZONE_INFO, "Collections", "Property \"" + extensionsKey + "\" does not exist. Assuming \"" + name + "\" is a menu");
|
||||
return false;
|
||||
}
|
||||
|
||||
(void)Conf->GetProperty(metadataTypeKey, metadataType);
|
||||
(void)Conf->GetProperty(metadataPathKey, metadataPath);
|
||||
(void)Conf.GetProperty(metadataTypeKey, metadataType);
|
||||
(void)Conf.GetProperty(metadataPathKey, metadataPath);
|
||||
|
||||
if(!Conf->GetProperty(launcherKey, launcherName))
|
||||
if(!Conf.GetProperty(launcherKey, launcherName))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Warning: launcher property \""
|
||||
|
||||
@@ -13,7 +13,7 @@ class CollectionInfo;
|
||||
class CollectionInfoBuilder
|
||||
{
|
||||
public:
|
||||
CollectionInfoBuilder(Configuration *c);
|
||||
CollectionInfoBuilder(Configuration &c);
|
||||
virtual ~CollectionInfoBuilder();
|
||||
bool LoadAllCollections();
|
||||
void GetCollections(std::vector<CollectionInfo *> &keys);
|
||||
@@ -21,5 +21,5 @@ public:
|
||||
private:
|
||||
bool ImportCollection(std::string name);
|
||||
std::map<std::string, CollectionInfo *> InfoMap;
|
||||
Configuration *Conf;
|
||||
Configuration &Conf;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user