summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebenginefaviconprovider.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-04-12 17:35:19 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2016-05-04 12:27:20 +0000
commit240efee49a8e4402f2048a05c596605b2feadbd3 (patch)
tree8df93a1a1732bafe78192f70cfdb54bde8b1b3b5 /src/webengine/api/qquickwebenginefaviconprovider.cpp
parent0bf8a13a4d0391339bae686e199fb922b64a1dcc (diff)
Combine candidate icons for a page into a single icon
For the Widget API the QIcon returned by QWebEnginePage::icon() function contains all the candidate icons for the current page. For the Quick API the QQuickWebEngineFaviconProvider provides the best quality icon for the requested size from the candidates. Task-number: QTBUG-51179 Change-Id: I42b8427f957e2f2fc745dd0111bedcc71b577216 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/webengine/api/qquickwebenginefaviconprovider.cpp')
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp
index c41ec5a07..fe8436d6c 100644
--- a/src/webengine/api/qquickwebenginefaviconprovider.cpp
+++ b/src/webengine/api/qquickwebenginefaviconprovider.cpp
@@ -121,12 +121,13 @@ QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize *
return QPixmap();
FaviconManager *faviconManager = view->d_ptr->adapter->faviconManager();
- Q_ASSERT(faviconManager);
- const QIcon &icon = faviconManager->getIcon(iconUrl);
+ Q_ASSERT(faviconManager);
+ const FaviconInfo &faviconInfo = faviconManager->getFaviconInfo(iconUrl);
+ const QIcon &icon = faviconManager->getIcon(faviconInfo.candidate ? QUrl() : iconUrl);
Q_ASSERT(!icon.isNull());
- const QSize &bestSize = faviconManager->getFaviconInfo(iconUrl).size;
+ const QSize &bestSize = faviconInfo.size;
// If source size is not specified, use the best quality
if (!requestedSize.isValid()) {