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

Don't save qupzilla:restore tabs in sessions

This commit is contained in:
David Rosca 2017-04-07 12:36:42 +02:00
parent 755ec16598
commit cb4012c5c9
2 changed files with 20 additions and 6 deletions

View File

@ -780,6 +780,7 @@ QList<WebTab*> TabWidget::allTabs(bool withPinned)
QByteArray TabWidget::saveState() QByteArray TabWidget::saveState()
{ {
int currentTabIndex = 0;
QVector<WebTab::SavedTab> tabList; QVector<WebTab::SavedTab> tabList;
for (int i = 0; i < count(); ++i) { for (int i = 0; i < count(); ++i) {
@ -788,20 +789,29 @@ QByteArray TabWidget::saveState()
continue; continue;
WebTab::SavedTab tab(webTab); WebTab::SavedTab tab(webTab);
if (!tab.isValid())
continue;
tabList.append(tab); tabList.append(tab);
if (webTab->isCurrentTab())
currentTabIndex = tabList.size() - 1;
} }
QByteArray data; QByteArray data;
QDataStream stream(&data, QIODevice::WriteOnly);
stream << tabList.count(); if (!tabList.isEmpty()) {
QDataStream stream(&data, QIODevice::WriteOnly);
foreach (const WebTab::SavedTab &tab, tabList) { stream << tabList.count();
stream << tab;
foreach (const WebTab::SavedTab &tab, tabList) {
stream << tab;
}
stream << currentTabIndex;
} }
stream << currentIndex();
return data; return data;
} }

View File

@ -47,6 +47,10 @@ WebTab::SavedTab::SavedTab()
WebTab::SavedTab::SavedTab(WebTab* webTab) WebTab::SavedTab::SavedTab(WebTab* webTab)
{ {
if (webTab->url().toString() == QL1S("qupzilla:restore")) {
return;
}
title = webTab->title(); title = webTab->title();
url = webTab->url(); url = webTab->url();
icon = webTab->icon(true); icon = webTab->icon(true);