1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-22 02:02:10 +02: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,10 +789,18 @@ 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;
if (!tabList.isEmpty()) {
QDataStream stream(&data, QIODevice::WriteOnly); QDataStream stream(&data, QIODevice::WriteOnly);
stream << tabList.count(); stream << tabList.count();
@ -800,7 +809,8 @@ QByteArray TabWidget::saveState()
stream << tab; stream << tab;
} }
stream << currentIndex(); stream << currentTabIndex;
}
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);