Changeset 11070
- Timestamp:
- Jul 30, 2010, 10:23:47 PM (12 years ago)
- Location:
- trunk/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/favicon.cc
r11059 r11070 83 83 Favicons :: find( const QUrl& url ) 84 84 { 85 return findFromHost( getHost( url ) ); 86 } 87 88 namespace 89 { 90 const QSize rightSize( 16, 16 ); 91 }; 92 93 QPixmap 94 Favicons :: findFromHost( const QString& host ) 95 { 85 96 ensureCacheDirHasBeenScanned( ); 86 97 87 return myPixmaps[ getHost(url) ]; 98 const QPixmap pixmap = myPixmaps[ host ]; 99 return pixmap.size()==rightSize ? pixmap : pixmap.scaled(rightSize); 88 100 } 89 101 … … 98 110 { 99 111 // add a placholder s.t. we only ping the server once per session 100 QPixmap tmp( 16, 16);112 QPixmap tmp( rightSize ); 101 113 tmp.fill( Qt::transparent ); 102 114 myPixmaps.insert( host, tmp ); -
trunk/qt/favicon.h
r11059 r11070 39 39 QPixmap find( const QUrl& url ); 40 40 41 /* returns a cached pixmap, or a NULL pixmap if there's no match in the cache */ 42 QPixmap findFromHost( const QString& host ); 43 41 44 /* this will emit a signal when (if) the icon becomes ready */ 42 45 void add( const QUrl& url );
Note: See TracChangeset
for help on using the changeset viewer.