1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 23:10:37 +02:00

Recover last session from main() instead of constructor

This fixes a bug where the apps using the file selector wouldn't be
launched at all when selecting a new file after a session recover.
This commit is contained in:
Paul Cercueil 2013-09-07 17:02:38 -04:00
parent e86a96c73f
commit 0e4180460b

View File

@ -259,11 +259,6 @@ GMenu2X::GMenu2X()
#ifdef ENABLE_CPUFREQ #ifdef ENABLE_CPUFREQ
setClock(confInt["menuClock"]); setClock(confInt["menuClock"]);
#endif #endif
//recover last session
readTmp();
if (lastSelectorElement>-1 && menu->selLinkApp()!=NULL && (!menu->selLinkApp()->getSelectorDir().empty() || !lastSelectorDir.empty()))
menu->selLinkApp()->selector(lastSelectorElement,lastSelectorDir);
} }
GMenu2X::~GMenu2X() { GMenu2X::~GMenu2X() {
@ -592,6 +587,13 @@ void GMenu2X::main() {
appToLaunch = nullptr; appToLaunch = nullptr;
// Recover last session
readTmp();
if (lastSelectorElement > -1 && menu->selLinkApp() &&
(!menu->selLinkApp()->getSelectorDir().empty()
|| !lastSelectorDir.empty()))
menu->selLinkApp()->selector(lastSelectorElement, lastSelectorDir);
while (true) { while (true) {
// Remove dismissed layers from the stack. // Remove dismissed layers from the stack.
for (auto it = layers.begin(); it != layers.end(); ) { for (auto it = layers.begin(); it != layers.end(); ) {