Skip to content
Browse files

Fix display of mythgame tree on first load Fixes #10918

  • Loading branch information...
1 parent 3f108e7 commit 98f73055e11654bef6cf0d752c1e3ce9fd3b019f @stuartm stuartm committed
Showing with 8 additions and 5 deletions.
  1. +7 −4 mythplugins/mythgame/mythgame/gameui.cpp
  2. +1 −1 mythplugins/mythgame/mythgame/gameui.h
View
11 mythplugins/mythgame/mythgame/gameui.cpp
@@ -94,14 +94,14 @@ bool GameUI::Create()
m_gameShowFileName = gCoreContext->GetSetting("GameShowFileNames").toInt();
- Load();
+ BuildTree();
BuildFocusList();
return true;
}
-void GameUI::Load()
+void GameUI::BuildTree()
{
m_gameTree = new MythGenericTree("game root", 0, false);
@@ -176,6 +176,7 @@ void GameUI::Load()
m_gameTree->addNode(new_node);
m_gameUITree->AssignTree(m_gameTree);
+ nodeChanged(m_gameUITree->GetCurrentNode());
}
bool GameUI::keyPressEvent(QKeyEvent *event)
@@ -879,7 +880,8 @@ void GameUI::updateChangedNode(MythGenericTree *node, RomInfo *romInfo)
{
resetOtherTrees(node);
- if (node->getParent() == m_favouriteNode && romInfo->Favorite() == 0) {
+ if (node->getParent() == m_favouriteNode && romInfo->Favorite() == 0)
+ {
// node is being removed
m_gameUITree->SetCurrentNode(m_favouriteNode);
}
@@ -1107,9 +1109,10 @@ void GameUI::reloadAllData(bool dbChanged)
if (dbChanged)
{
+ m_gameUITree->Reset();
delete m_gameTree;
m_gameTree = NULL;
- Load();
+ BuildTree();
}
}
View
2 mythplugins/mythgame/mythgame/gameui.h
@@ -30,7 +30,7 @@ class GameUI : public MythScreenType
~GameUI();
bool Create();
- void Load();
+ void BuildTree();
bool keyPressEvent(QKeyEvent *event);
public slots:

0 comments on commit 98f7305

Please sign in to comment.
Something went wrong with that request. Please try again.