1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +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;
}
bool MainApplication::isRestoring() const
{
return m_isRestoring;
}
bool MainApplication::isPrivateSession() const
{
return m_isPrivateSession;

View File

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

View File

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