resolve URL for correct favicon downloading, fixes #240 #238

This commit is contained in:
thez3ro 2017-06-29 19:54:49 +02:00 committed by Janek Bevendorff
parent 98c812a297
commit 35c6df2535
6 changed files with 39 additions and 5 deletions

View file

@ -223,8 +223,15 @@ void EditWidgetIcons::fetchFavicon(const QUrl& url)
}
m_httpClient->setConnectingTimeOut(5000, [this]() {
resetFaviconDownload();
MessageBox::warning(this, tr("Error"), tr("Unable to fetch favicon."));
QUrl tempurl = QUrl(m_url);
if (tempurl.scheme() == "http") {
resetFaviconDownload();
MessageBox::warning(this, tr("Error"), tr("Unable to fetch favicon."));
} else {
tempurl.setScheme("http");
tempurl.setPath("/favicon.ico");
fetchFavicon(tempurl);
}
});
m_ui->faviconButton->setDisabled(true);