1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

WebTab: Make sure to not call slotRestore multiple times

It can happen when switching sessions and results in current tab
being empty tab.
This commit is contained in:
David Rosca 2017-12-30 16:04:41 +01:00
parent 3aa629ceac
commit 56b28bfa1f

View File

@ -467,23 +467,26 @@ void WebTab::slotRestore()
{
Q_ASSERT(m_tabBar);
p_restoreTab(m_savedTab);
m_savedTab.clear();
if (isRestored()) {
return;
}
p_restoreTab(m_savedTab);
m_tabBar->restoreTabTextColor(tabIndex());
m_savedTab.clear();
}
void WebTab::tabActivated()
{
if (isRestored()) {
return;
}
if (!isRestored()) {
// When session is being restored, restore the tab immediately
if (mApp->isRestoring()) {
slotRestore();
}
else {
QTimer::singleShot(0, this, SLOT(slotRestore()));
}
// When session is being restored, restore the tab immediately
if (mApp->isRestoring()) {
slotRestore();
} else {
QTimer::singleShot(0, this, SLOT(slotRestore()));
}
}