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

[TabWidget] Don't save qupzilla:restore page in closed tabs

This commit is contained in:
David Rosca 2014-04-19 18:24:09 +02:00
parent 20764b3c1e
commit 7568ee3e2d

View File

@ -442,29 +442,27 @@ void TabWidget::addTabFromClipboard()
void TabWidget::closeTab(int index, bool force)
{
if (index == -1) {
if (index == -1)
index = currentIndex();
}
WebTab* webTab = weTab(index);
if (!webTab || !validIndex(index)) {
if (!webTab || !validIndex(index))
return;
}
TabbedWebView* webView = webTab->webView();
bool isRestorePage = webView->url().toString() == QL1S("qupzilla:restore");
// Don't close restore page!
if (!force && webView->url().toString() == QL1S("qupzilla:restore") && mApp->restoreManager()) {
if (!force && isRestorePage && mApp->restoreManager())
return;
}
// window.onbeforeunload handling
if (!webView->onBeforeUnload()) {
if (!webView->onBeforeUnload())
return;
}
// Save tab url and history
m_closedTabsManager->saveTab(webTab, index);
if (!isRestorePage)
m_closedTabsManager->saveTab(webTab, index);
// This would close last tab, so we close the window instead
if (!force && count() == 1) {
@ -487,9 +485,8 @@ void TabWidget::closeTab(int index, bool force)
disconnect(webView, SIGNAL(changed()), this, SIGNAL(changed()));
disconnect(webView, SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
if (m_isClosingToLastTabIndex && m_lastTabIndex < count() && index == currentIndex()) {
if (m_isClosingToLastTabIndex && m_lastTabIndex < count() && index == currentIndex())
setCurrentIndex(m_lastTabIndex);
}
m_lastBackgroundTabIndex = -1;