diff --git a/src/lib/plugins/speeddial.cpp b/src/lib/plugins/speeddial.cpp index 4a55f1cd2..764e3f8d0 100644 --- a/src/lib/plugins/speeddial.cpp +++ b/src/lib/plugins/speeddial.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2010-2016 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2010-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 @@ -264,10 +264,6 @@ void SpeedDial::changed(const QString &allPages) void SpeedDial::loadThumbnail(const QString &url, bool loadTitle) { - if (url.isEmpty()) { - return; - } - PageThumbnailer* thumbnailer = new PageThumbnailer(this); thumbnailer->setUrl(QUrl::fromEncoded(url.toUtf8())); thumbnailer->setLoadTitle(loadTitle); diff --git a/src/lib/tools/pagethumbnailer.cpp b/src/lib/tools/pagethumbnailer.cpp index 60f383ddb..ba8d0bd13 100644 --- a/src/lib/tools/pagethumbnailer.cpp +++ b/src/lib/tools/pagethumbnailer.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2010-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 @@ -17,6 +17,7 @@ * ============================================================ */ #include "pagethumbnailer.h" #include "scripts.h" +#include "webview.h" #include #include @@ -77,11 +78,10 @@ QString PageThumbnailer::title() void PageThumbnailer::start() { - if (m_view->rootObject()) { + if (m_view->rootObject() && WebView::isUrlValid(m_url)) { m_view->rootObject()->setProperty("url", m_url); - } - else { - QTimer::singleShot(0, this, [this]() { + } else { + QTimer::singleShot(500, this, [this]() { emit thumbnailCreated(QPixmap()); }); }