1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52: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()
{
int currentTabIndex = 0;
QVector<WebTab::SavedTab> tabList;
for (int i = 0; i < count(); ++i) {
@ -788,10 +789,18 @@ QByteArray TabWidget::saveState()
continue;
WebTab::SavedTab tab(webTab);
if (!tab.isValid())
continue;
tabList.append(tab);
if (webTab->isCurrentTab())
currentTabIndex = tabList.size() - 1;
}
QByteArray data;
if (!tabList.isEmpty()) {
QDataStream stream(&data, QIODevice::WriteOnly);
stream << tabList.count();
@ -800,7 +809,8 @@ QByteArray TabWidget::saveState()
stream << tab;
}
stream << currentIndex();
stream << currentTabIndex;
}
return data;
}

View File

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