1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Proper fix for restoring current tab.

Fix for 3b4d2f5534
This commit is contained in:
nowrep 2013-02-11 16:45:10 +01:00
parent 09cf53a292
commit 9a99509faf
3 changed files with 11 additions and 3 deletions

View File

@ -512,6 +512,11 @@ bool MainApplication::isClosing() const
return m_isClosing; return m_isClosing;
} }
bool MainApplication::isRestoring() const
{
return m_isRestoring;
}
bool MainApplication::isPrivateSession() const bool MainApplication::isPrivateSession() const
{ {
return m_isPrivateSession; return m_isPrivateSession;

View File

@ -82,6 +82,7 @@ public:
static MainApplication* getInstance() { return static_cast<MainApplication*>(QCoreApplication::instance()); } static MainApplication* getInstance() { return static_cast<MainApplication*>(QCoreApplication::instance()); }
bool isClosing() const; bool isClosing() const;
bool isRestoring() const;
bool isPrivateSession() const; bool isPrivateSession() const;
bool isStartingAfterCrash() const; bool isStartingAfterCrash() const;
int windowCount() const; int windowCount() const;

View File

@ -24,6 +24,7 @@
#include "locationbar.h" #include "locationbar.h"
#include "qztools.h" #include "qztools.h"
#include "qzsettings.h" #include "qzsettings.h"
#include "mainapplication.h"
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWebHistory> #include <QWebHistory>
@ -111,11 +112,12 @@ TabbedWebView* WebTab::view() const
void WebTab::setCurrentTab() void WebTab::setCurrentTab()
{ {
if (!isRestored()) { if (!isRestored()) {
if (isVisible()) { // When session is being restored, restore the tab immediately
QTimer::singleShot(0, this, SLOT(slotRestore())); if (mApp->isRestoring()) {
slotRestore();
} }
else { else {
slotRestore(); QTimer::singleShot(0, this, SLOT(slotRestore()));
} }
} }
} }