WebTab: Make sure to not call slotRestore multiple times

It can happen when switching sessions and results in current tab
being empty tab.
remotes/origin/Falkon/3.0
David Rosca 8 years ago
parent 3aa629ceac
commit 56b28bfa1f
  1. 23
      src/lib/webtab/webtab.cpp

@ -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()));
}
}

Loading…
Cancel
Save