[office/tellico] 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 7a412647ef8629a2b0ca1119e3b899ce0188ee41 by Robby Stephenson.
Committed on 16/08/2026 at 21:50.
Pushed by rstephenson into branch 'master'.

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/7a412647ef8629a2b0ca1119e3b899ce0188ee41

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 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.