mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
RestoreSession: Use generic webpage icon when tab icon is empty
This commit is contained in:
parent
bccf2943cd
commit
c0e4264540
|
@ -1,6 +1,6 @@
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
* QupZilla - QtWebEngine based browser
|
* QupZilla - Qt web browser
|
||||||
* Copyright (C) 2015 David Rosca <nowrep@gmail.com>
|
* Copyright (C) 2015-2017 David Rosca <nowrep@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#include "tabbedwebview.h"
|
#include "tabbedwebview.h"
|
||||||
#include "browserwindow.h"
|
#include "browserwindow.h"
|
||||||
#include "qztools.h"
|
#include "qztools.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
@ -48,9 +49,10 @@ QJsonArray RecoveryJsObject::restoreData() const
|
||||||
int j = 0;
|
int j = 0;
|
||||||
QJsonArray tabs;
|
QJsonArray tabs;
|
||||||
Q_FOREACH (const WebTab::SavedTab &t, w.tabsState) {
|
Q_FOREACH (const WebTab::SavedTab &t, w.tabsState) {
|
||||||
|
const QIcon icon = t.icon.isNull() ? IconProvider::emptyWebIcon() : t.icon;
|
||||||
QJsonObject tab;
|
QJsonObject tab;
|
||||||
tab[QSL("tab")] = j;
|
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("title")] = t.title;
|
||||||
tab[QSL("url")] = t.url.toString();
|
tab[QSL("url")] = t.url.toString();
|
||||||
tab[QSL("pinned")] = t.isPinned;
|
tab[QSL("pinned")] = t.isPinned;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user