From c0e426454040ce26766d90f36343fd5b739745f0 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 1 Jan 2017 13:05:14 +0100 Subject: [PATCH] RestoreSession: Use generic webpage icon when tab icon is empty --- src/lib/session/recoveryjsobject.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/session/recoveryjsobject.cpp b/src/lib/session/recoveryjsobject.cpp index 2db876952..2bcb7693c 100644 --- a/src/lib/session/recoveryjsobject.cpp +++ b/src/lib/session/recoveryjsobject.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - QtWebEngine based browser -* Copyright (C) 2015 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2015-2017 David Rosca * * 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 @@ -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;