1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +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); Q_ASSERT(m_tabBar);
p_restoreTab(m_savedTab); if (isRestored()) {
m_savedTab.clear(); return;
}
p_restoreTab(m_savedTab);
m_tabBar->restoreTabTextColor(tabIndex()); m_tabBar->restoreTabTextColor(tabIndex());
m_savedTab.clear();
} }
void WebTab::tabActivated() void WebTab::tabActivated()
{ {
if (isRestored()) {
return;
}
if (!isRestored()) { // When session is being restored, restore the tab immediately
// When session is being restored, restore the tab immediately if (mApp->isRestoring()) {
if (mApp->isRestoring()) { slotRestore();
slotRestore(); } else {
} QTimer::singleShot(0, this, SLOT(slotRestore()));
else {
QTimer::singleShot(0, this, SLOT(slotRestore()));
}
} }
} }