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

RestoreSession: Use generic webpage icon when tab icon is empty

This commit is contained in:
David Rosca 2017-01-01 13:05:14 +01:00
parent bccf2943cd
commit c0e4264540

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - QtWebEngine based browser
* Copyright (C) 2015 David Rosca <nowrep@gmail.com>
* QupZilla - Qt web browser
* Copyright (C) 2015-2017 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -22,6 +22,7 @@
#include "tabbedwebview.h"
#include "browserwindow.h"
#include "qztools.h"
#include "iconprovider.h"
#include <QJsonObject>
@ -48,9 +49,10 @@ QJsonArray RecoveryJsObject::restoreData() const
int j = 0;
QJsonArray tabs;
Q_FOREACH (const WebTab::SavedTab &t, w.tabsState) {
const QIcon icon = t.icon.isNull() ? IconProvider::emptyWebIcon() : t.icon;
QJsonObject tab;
tab[QSL("tab")] = j;
tab[QSL("icon")] = QzTools::pixmapToDataUrl(t.icon.pixmap(16)).toString();
tab[QSL("icon")] = QzTools::pixmapToDataUrl(icon.pixmap(16)).toString();
tab[QSL("title")] = t.title;
tab[QSL("url")] = t.url.toString();
tab[QSL("pinned")] = t.isPinned;