From 0e4180460bcd8b99f42b445bdfe4b73cdd64874c Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Sat, 7 Sep 2013 17:02:38 -0400 Subject: [PATCH] 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. --- src/gmenu2x.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index b3531a8..4ac2167 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -259,11 +259,6 @@ GMenu2X::GMenu2X() #ifdef ENABLE_CPUFREQ setClock(confInt["menuClock"]); #endif - //recover last session - readTmp(); - if (lastSelectorElement>-1 && menu->selLinkApp()!=NULL && (!menu->selLinkApp()->getSelectorDir().empty() || !lastSelectorDir.empty())) - menu->selLinkApp()->selector(lastSelectorElement,lastSelectorDir); - } GMenu2X::~GMenu2X() { @@ -592,6 +587,13 @@ void GMenu2X::main() { appToLaunch = nullptr; + // Recover last session + readTmp(); + if (lastSelectorElement > -1 && menu->selLinkApp() && + (!menu->selLinkApp()->getSelectorDir().empty() + || !lastSelectorDir.empty())) + menu->selLinkApp()->selector(lastSelectorElement, lastSelectorDir); + while (true) { // Remove dismissed layers from the stack. for (auto it = layers.begin(); it != layers.end(); ) {