mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
ClosedTabsManager: Save and restore parent tab
BUG: 393976 FIXED-IN: 3.0.1
This commit is contained in:
parent
9375b474ba
commit
6e3da02d7d
|
@ -776,6 +776,7 @@ void TabWidget::restoreClosedTab(QObject* obj)
|
|||
|
||||
int index = addView(QUrl(), tab.tabState.title, Qz::NT_CleanSelectedTab, false, tab.position);
|
||||
WebTab* webTab = weTab(index);
|
||||
webTab->setParentTab(tab.parentTab);
|
||||
webTab->p_restoreTab(tab.tabState);
|
||||
|
||||
updateClosedTabsButton();
|
||||
|
@ -791,6 +792,7 @@ void TabWidget::restoreAllClosedTabs()
|
|||
for (const ClosedTabsManager::Tab &tab : closedTabs) {
|
||||
int index = addView(QUrl(), tab.tabState.title, Qz::NT_CleanSelectedTab);
|
||||
WebTab* webTab = weTab(index);
|
||||
webTab->setParentTab(tab.parentTab);
|
||||
webTab->p_restoreTab(tab.tabState);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ void ClosedTabsManager::saveTab(WebTab *tab)
|
|||
|
||||
Tab closedTab;
|
||||
closedTab.position = tab->tabIndex();
|
||||
closedTab.parentTab = tab->parentTab();
|
||||
closedTab.tabState = WebTab::SavedTab(tab);
|
||||
m_closedTabs.prepend(closedTab);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#define CLOSEDTABSMANAGER_H
|
||||
|
||||
#include <QVector>
|
||||
#include <QPointer>
|
||||
|
||||
#include "webtab.h"
|
||||
#include "qzcommon.h"
|
||||
|
@ -30,6 +31,7 @@ class FALKON_EXPORT ClosedTabsManager
|
|||
public:
|
||||
struct Tab {
|
||||
int position = -1;
|
||||
QPointer<WebTab> parentTab;
|
||||
WebTab::SavedTab tabState;
|
||||
|
||||
bool isValid() const {
|
||||
|
|
Loading…
Reference in New Issue
Block a user