Commit d09b184c authored by Jean-Baptiste Demonte's avatar Jean-Baptiste Demonte

chore(clean): move and sync code

parent 6357ab75
......@@ -170,21 +170,7 @@ GuiGamelistOptions::~GuiGamelistOptions()
}
else
{
Window *window = mWindow;
if (!root->hasChildren())
{
ViewController::get()->goToStart();
window->renderShutdownScreen();
delete ViewController::get();
SystemData::deleteSystems();
SystemData::loadConfig();
GuiComponent *gui;
while ((gui = window->peekGui()) != nullptr) window->removeGui(gui);
ViewController::init(window);
ViewController::get()->reloadAll();
window->pushGui(ViewController::get());
ViewController::get()->goToStart();
}
ViewController::get()->deleteAndReloadAll();
}
}
......
......@@ -435,24 +435,26 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
}
else
{
Window* window= mWindow;
goToStart();
window->renderShutdownScreen();
delete ViewController::get();
SystemData::deleteSystems();
SystemData::loadConfig();
GuiComponent *gui;
while ((gui = window->peekGui()) != nullptr)
{
window->removeGui(gui);
}
ViewController::init(window);
ViewController::get()->reloadAll();
window->pushGui(ViewController::get());
return;
deleteAndReloadAll();
}
}
void ViewController::deleteAndReloadAll()
{
Window *window = mWindow;
window->renderShutdownScreen();
delete ViewController::get();
SystemData::deleteSystems();
SystemData::loadConfig();
GuiComponent *gui;
while ((gui = window->peekGui()) != nullptr)
window->removeGui(gui);
ViewController::init(window);
ViewController::get()->reloadAll();
window->pushGui(ViewController::get());
ViewController::get()->goToStart();
}
void ViewController::reloadAll()
{
std::map<SystemData*, FileData*> cursorMap;
......
......@@ -21,8 +21,9 @@ public:
// If a basic view detected a metadata change, it can request to recreate
// the current gamelist view (as it may change to be detailed).
void reloadGameListView(IGameListView* gamelist, bool reloadTheme = false);
inline void reloadGameListView(SystemData* system, bool reloadTheme = false) { reloadGameListView(getGameListView(system).get(), reloadTheme); }
void reloadGameListView(IGameListView* gamelist, bool reloadTheme = false);
inline void reloadGameListView(SystemData* system, bool reloadTheme = false) { reloadGameListView(getGameListView(system).get(), reloadTheme); }
void deleteAndReloadAll();
void reloadAll(); // Reload everything with a theme. Used when the "ThemeSet" setting changes.
void setInvalidGamesList(SystemData* system);
void setAllInvalidGamesList(SystemData* systemExclude);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment