diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-12-16 22:01:26 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-12-16 22:01:26 +0100 |
commit | 3e59ea5cab2a0972e1a618bed9b7f2de8025dbf9 (patch) | |
tree | adfab45dcf09c31903586e745002e85c150b7443 | |
parent | Merge branch 'ImproveNewTabPages' (diff) | |
download | rekonq-3e59ea5cab2a0972e1a618bed9b7f2de8025dbf9.tar.xz |
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
-rw-r--r-- | src/iconmanager.cpp | 13 |
1 files 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 <KIO/Job> +#include <kio/copyjob.h> #include <KIcon> #include <KMimeType> @@ -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<KIO::FileCopyJob *>(j); + KIO::CopyJob *job = static_cast<KIO::CopyJob *>(j); KUrl dest = job->destUrl(); QString s = dest.url().remove(QL1S("file://")); |