[office/tellico/4.2] src/fetch: Only request favIcon for non-empty url host
Robby Stephenson <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 0fb6157c7f9b220d5bd3bcfb211e1e0eaaf5f8d2 by Robby Stephenson.
Committed on 16/08/2026 at 21:50.
Pushed by rstephenson into branch '4.2'.
Only request favIcon for non-empty url host
M +1 -1 src/fetch/fetcher.cpp
M +1 -1 src/fetch/fetchmanager.cpp
M +1 -1 src/fetch/opdsfetcher.cpp
https://invent.kde.org/office/tellico/-/commit/0fb6157c7f9b220d5bd3bcfb211e1e0eaaf5f8d2
diff --git a/src/fetch/fetcher.cpp b/src/fetch/fetcher.cpp
index 5179d21ff..789cc5f15 100644
--- a/src/fetch/fetcher.cpp
+++ b/src/fetch/fetcher.cpp
@@ -192,7 +192,7 @@ QString Fetcher::favIcon(const QUrl& url_, const QUrl& iconUrl_) {
connect(job, &KIO::FavIconRequestJob::result, [job](KJob *) {
if(job->error()) {
- myDebug() << job->hostUrl().host() << "error:" << job->errorString();
+ myDebug() << job->hostUrl().url() << "error:" << job->errorString();
} else if(job->iconFile().isEmpty()) {
// myDebug() << "no favIcon found for" << job->hostUrl();
}
diff --git a/src/fetch/fetchmanager.cpp b/src/fetch/fetchmanager.cpp
index 8eb862881..a9e898c4b 100644
--- a/src/fetch/fetchmanager.cpp
+++ b/src/fetch/fetchmanager.cpp
@@ -533,7 +533,7 @@ QPixmap Manager::fetcherIcon(Tellico::Fetch::Fetcher* fetcher_, int group_, int
QUrl u;
u.setScheme(QStringLiteral("http"));
u.setHost(f->host());
- QString icon = Fetcher::favIcon(u);
+ QString icon = f->host().isEmpty() ? QString() : Fetcher::favIcon(u);
if(!icon.isEmpty()) {
return LOAD_ICON(icon, group_, size_);
}
diff --git a/src/fetch/opdsfetcher.cpp b/src/fetch/opdsfetcher.cpp
index 48549517b..a9bb6efae 100644
--- a/src/fetch/opdsfetcher.cpp
+++ b/src/fetch/opdsfetcher.cpp
@@ -160,7 +160,7 @@ QString OPDSFetcher::attribution() const {
}
QString OPDSFetcher::icon() const {
- return favIcon(QUrl(m_icon));
+ return m_icon.isEmpty() ? QString() : favIcon(QUrl(m_icon));
}
bool OPDSFetcher::canSearch(Fetch::FetchKey k) const {