extragear/multimedia/amarok/src

Seb Ruiz me at sebruiz.net
Wed Dec 13 17:08:48 UTC 2006


Should really use a query builder statement here - raw sql statements
outside of the collectiondb is bad! (i know, cat calling the kettle
black :)

cya!

seb, in turkey!

On 12/12/06, Mark Kretschmann <markey at web.de> wrote:
> SVN commit 612787 by markey:
>
> Show album covers in collection browser. Experimental patch by Trever Fischer <wm161 at wm161.net>.
>
> I think this is pretty cool. Maybe we should limit size of the images though?
>
> BUG: 91044
> CCMAIL: amarok at kde.org
>
>
>  M  +19 -0     collectionbrowser.cpp
>  M  +2 -0      collectionbrowser.h
>
>
> --- trunk/extragear/multimedia/amarok/src/collectionbrowser.cpp #612786:612787
> @@ -1490,7 +1490,26 @@
>     }
>  }
>
> +void
> +CollectionItem::setPixmap(int column, const QPixmap & pix)
> +{
> +    if ( m_cat == IdAlbum ) {
> +        QString album = text(0);
> +        QStringList values =
> +            CollectionDB::instance()->query ( QString (
> +                "SELECT DISTINCT artist.name FROM artist, album, tags "
> +                "WHERE artist.id = tags.artist AND tags.album = album.id "
> +                "AND album.name = '%1';" )
> +                .arg( CollectionDB::instance()->escapeString( album ) ) );
> +        if ( !values.isEmpty() )
> +            QListViewItem::setPixmap( column, QPixmap( CollectionDB::instance()->albumImage( values[0], album ) ) );
> +        else
> +            QListViewItem::setPixmap( column, QPixmap( CollectionDB::instance()->notAvailCover() ) );
> +    } else
> +        QListViewItem::setPixmap( column, pix );
> +}
>
> +
>  void
>  CollectionView::fetchCover() //SLOT
>  {
> --- trunk/extragear/multimedia/amarok/src/collectionbrowser.h #612786:612787
> @@ -165,6 +165,8 @@
>         inline bool isUnknown() {return m_isUnknown;}
>         inline bool isSampler() {return m_isSampler;}
>
> +        virtual void setPixmap(int column, const QPixmap & pix);
> +
>         static QPixmap *star();
>         static QPixmap *smallStar();
>
> _______________________________________________
> Amarok mailing list
> Amarok at kde.org
> https://mail.kde.org/mailman/listinfo/amarok
>


-- 
http://www.sebruiz.net/



More information about the Amarok mailing list