]> granicus.if.org Git - transmission/commitdiff
(trunk qt) if the server doesn't have a favicon, don't keep retrying for one
authorCharles Kerr <charles@transmissionbt.com>
Sun, 25 Jul 2010 20:38:44 +0000 (20:38 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sun, 25 Jul 2010 20:38:44 +0000 (20:38 +0000)
qt/favicon.cc
qt/favicon.h

index 092fa985ee932c4330c7d42bc1c7cf17b4373cb7..2e36bc88600e1c82cd63b09b89943da18c0c65ef 100644 (file)
@@ -93,10 +93,13 @@ Favicons :: add( const QUrl& url )
     ensureCacheDirHasBeenScanned( );
 
     const QString host = getHost( url );
-    if( !myPixmaps.contains( host ) && !myPending.contains( host ) )
+
+    if( !myPixmaps.contains( host ) )
     {
-        myPending.append( host ); 
+        // add a placholder s.t. we only ping the server once per session
+        myPixmaps.insert( host, QPixmap( ) );
 
+        // try to download the favicon
         const QString path = "http://" + host + "/favicon.";
         QStringList suffixes;
         suffixes << "ico" << "png" << "gif" << "jpg";
@@ -109,7 +112,6 @@ void
 Favicons :: onRequestFinished( QNetworkReply * reply )
 {
     const QString host = reply->url().host();
-    myPending.removeAll( host );
 
     QPixmap pixmap;
 
index dc6ee09324b65358781093531f7e36f59e8a661a..dcd3f12a336f81d4e476770a29e5a033c2f0a823 100644 (file)
@@ -19,7 +19,6 @@ class QUrl;
 
 #include <QMap>
 #include <QString>
-#include <QStringList>
 #include <QObject>
 #include <QPixmap>
 
@@ -44,7 +43,6 @@ class Favicons: public QObject
 
     private:
 
-        QStringList myPending;
         QNetworkAccessManager * myNAM;
         QMap<QString,QPixmap> myPixmaps;