Example #1
0
void
ArtistWidget::fetchPhoto()
{
    // display a message for the user while the fetch of the picture
    m_image->clear();

    QPixmap image;
    if( QPixmapCache::find( m_artist->urlImage().url(), &image ) )
    {
        m_image->setPixmap( image );
        return;
    }
    m_image->setPixmap( Amarok::semiTransparentLogo( 120 ) );

    if( m_artist->urlImage().isEmpty() )
        return;

    The::networkAccessManager()->getData( m_artist->urlImage(), this,
         SLOT(photoFetched(KUrl,QByteArray,NetworkAccessManagerProxy::Error)) );
}
Example #2
0
    foreach( const PhotosInfoPtr &item, list )
    {
        if( m_currentlist.contains( item ) )
            continue;

        KUrl url = item->urlphoto;
        if( url.isValid() )
        {
            QPixmap pixmap;
            if( QPixmapCache::find( url.url(), &pixmap ) )
            {
                addPhoto( item, pixmap );
            }
            else
            {
                m_infoHash[ url ] = item;
                The::networkAccessManager()->getData( url, this,
                     SLOT(photoFetched(KUrl,QByteArray,NetworkAccessManagerProxy::Error)) );
            }
            toAddList << item;
        }
    }