Moved layout detection to separate method.

This commit is contained in:
emb 2015-01-01 16:33:01 -06:00
parent 457f2c180c
commit df3fe6f314
2 changed files with 15 additions and 9 deletions

View File

@ -458,14 +458,7 @@ Page *RetroFE::LoadPage(std::string collectionName)
}
else
{
std::string layoutKeyName = "collections." + collectionName + ".layout";
std::string layoutName = "Default 16x9";
if(!Config.GetProperty(layoutKeyName, layoutName))
{
Config.GetProperty("layout", layoutName);
}
std::string layoutName = GetLayout(collectionName);
if(PageChain.size() > 0)
{
@ -490,3 +483,16 @@ Page *RetroFE::LoadPage(std::string collectionName)
return page;
}
std::string RetroFE::GetLayout(std::string collectionName)
{
std::string layoutKeyName = "collections." + collectionName + ".layout";
std::string layoutName = "Default 16x9";
if(!Config.GetProperty(layoutKeyName, layoutName))
{
Config.GetProperty("layout", layoutName);
}
return layoutName;
}

View File

@ -47,7 +47,7 @@ private:
Page *LoadPage(std::string collectionName);
RETROFE_STATE ProcessUserInput();
void Update(float dt, bool scrollActive);
std::string GetLayout(std::string collectionName);
Configuration &Config;
CollectionDatabase &CollectionDB;