From 3e59ea5cab2a0972e1a618bed9b7f2de8025dbf9 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 16 Dec 2011 22:01:26 +0100 Subject: Do NOT search for (probably) non extant favicons also use KIO::copy instead of KIO::file_copy to delegate file management to KIO This should hopefully fix||workaround HTML code shown bug. Anyway, I cannot understand why KIO merges the two different jobs data together CCBUG: 289029 --- src/iconmanager.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp index ac53fdac..d4564390 100644 --- a/src/iconmanager.cpp +++ b/src/iconmanager.cpp @@ -34,6 +34,7 @@ // KDE Includes #include +#include #include #include @@ -124,7 +125,7 @@ void IconManager::provideIcon(QWebPage *page, const KUrl &url, bool notify) const QString rootUrlString = url.scheme() + QL1S("://") + url.host(); // find favicon url - KUrl faviconUrl(rootUrlString + QL1S("/favicon.ico")); + KUrl faviconUrl; QWebElement root = page->mainFrame()->documentElement(); QWebElement e = root.findFirst(QL1S("link[rel~=\"icon\"]")); @@ -139,14 +140,18 @@ void IconManager::provideIcon(QWebPage *page, const KUrl &url, bool notify) { faviconUrl = relUrlString.startsWith(QL1S("http")) ? KUrl(relUrlString) - : KUrl(rootUrlString + QL1C('/') + relUrlString) ; + : KUrl(rootUrlString + QL1C('/') + relUrlString); } + kDebug() << "Favicon URL: " << faviconUrl; + if (faviconUrl.isEmpty()) + return; + // dest url KUrl destUrl(_faviconsDir + url.host() + QL1S(".png")); // download icon - KIO::FileCopyJob *job = KIO::file_copy(faviconUrl, destUrl, -1, KIO::HideProgressInfo); + KIO::CopyJob *job = KIO::copy(faviconUrl, destUrl, KIO::HideProgressInfo); if (notify) connect(job, SIGNAL(result(KJob*)), this, SLOT(notifyLastStuffs(KJob *))); else @@ -179,7 +184,7 @@ void IconManager::doLastStuffs(KJob *j) return; } - KIO::FileCopyJob *job = static_cast(j); + KIO::CopyJob *job = static_cast(j); KUrl dest = job->destUrl(); QString s = dest.url().remove(QL1S("file://")); -- cgit v1.2.1