From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- juk/covericonview.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 juk/covericonview.cpp (limited to 'juk/covericonview.cpp') diff --git a/juk/covericonview.cpp b/juk/covericonview.cpp new file mode 100644 index 00000000..88defcab --- /dev/null +++ b/juk/covericonview.cpp @@ -0,0 +1,48 @@ +/*************************************************************************** + begin : Sat Jul 9 2005 + copyright : (C) 2005 by Michael Pyne + email : michael.pyne@kdemail.net +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "covericonview.h" +#include "covermanager.h" + +using CoverUtility::CoverIconViewItem; + +CoverIconViewItem::CoverIconViewItem(coverKey id, QIconView *parent) : + KIconViewItem(parent), m_id(id) +{ + CoverDataPtr data = CoverManager::coverInfo(id); + setText(QString("%1 - %2").arg(data->artist, data->album)); + setPixmap(data->thumbnail()); +} + +CoverIconView::CoverIconView(QWidget *parent, const char *name) : KIconView(parent, name) +{ + setResizeMode(Adjust); +} + +CoverIconViewItem *CoverIconView::currentItem() const +{ + return static_cast(KIconView::currentItem()); +} + +QDragObject *CoverIconView::dragObject() +{ + CoverIconViewItem *item = currentItem(); + if(item) + return new CoverDrag(item->id(), this); + + return 0; +} + +// vim: set et ts=4 sw=4: -- cgit v1.2.1