1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

ClosedTabsManager: Save and restore parent tab

BUG: 393976
FIXED-IN: 3.0.1
This commit is contained in:
David Rosca 2018-05-08 11:26:25 +02:00
parent 9375b474ba
commit 6e3da02d7d
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
3 changed files with 5 additions and 0 deletions

View File

@ -776,6 +776,7 @@ void TabWidget::restoreClosedTab(QObject* obj)
int index = addView(QUrl(), tab.tabState.title, Qz::NT_CleanSelectedTab, false, tab.position); int index = addView(QUrl(), tab.tabState.title, Qz::NT_CleanSelectedTab, false, tab.position);
WebTab* webTab = weTab(index); WebTab* webTab = weTab(index);
webTab->setParentTab(tab.parentTab);
webTab->p_restoreTab(tab.tabState); webTab->p_restoreTab(tab.tabState);
updateClosedTabsButton(); updateClosedTabsButton();
@ -791,6 +792,7 @@ void TabWidget::restoreAllClosedTabs()
for (const ClosedTabsManager::Tab &tab : closedTabs) { for (const ClosedTabsManager::Tab &tab : closedTabs) {
int index = addView(QUrl(), tab.tabState.title, Qz::NT_CleanSelectedTab); int index = addView(QUrl(), tab.tabState.title, Qz::NT_CleanSelectedTab);
WebTab* webTab = weTab(index); WebTab* webTab = weTab(index);
webTab->setParentTab(tab.parentTab);
webTab->p_restoreTab(tab.tabState); webTab->p_restoreTab(tab.tabState);
} }

View File

@ -38,6 +38,7 @@ void ClosedTabsManager::saveTab(WebTab *tab)
Tab closedTab; Tab closedTab;
closedTab.position = tab->tabIndex(); closedTab.position = tab->tabIndex();
closedTab.parentTab = tab->parentTab();
closedTab.tabState = WebTab::SavedTab(tab); closedTab.tabState = WebTab::SavedTab(tab);
m_closedTabs.prepend(closedTab); m_closedTabs.prepend(closedTab);
} }

View File

@ -19,6 +19,7 @@
#define CLOSEDTABSMANAGER_H #define CLOSEDTABSMANAGER_H
#include <QVector> #include <QVector>
#include <QPointer>
#include "webtab.h" #include "webtab.h"
#include "qzcommon.h" #include "qzcommon.h"
@ -30,6 +31,7 @@ class FALKON_EXPORT ClosedTabsManager
public: public:
struct Tab { struct Tab {
int position = -1; int position = -1;
QPointer<WebTab> parentTab;
WebTab::SavedTab tabState; WebTab::SavedTab tabState;
bool isValid() const { bool isValid() const {