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:
parent
20764b3c1e
commit
7568ee3e2d
@ -442,28 +442,26 @@ 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
|
||||
if (!isRestorePage)
|
||||
m_closedTabsManager->saveTab(webTab, index);
|
||||
|
||||
// This would close last tab, so we close the window instead
|
||||
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user