summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/playlistselection.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index 85228a9..67187f8 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -42,94 +42,95 @@ public:
~PlayListSelectionItem() {
};
const DocLnk *file() const { return fl; }
private:
const DocLnk *fl;
};
PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
: QListView( parent, name )
{
// qDebug("starting playlistselector");
// #ifdef USE_PLAYLIST_BACKGROUND
// setStaticBackground( TRUE );
// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) );
// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) );
// #endif
// addColumn("Title",236);
// setAllColumnsShowFocus( TRUE );
addColumn( tr( "Playlist Selection" ) );
header()->hide();
- setSorting( -1, FALSE );
+// setSorting( -1, FALSE );
+ // FIXME
}
PlayListSelection::~PlayListSelection() {
}
// #ifdef USE_PLAYLIST_BACKGROUND
void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
// qDebug("drawBackground");
p->fillRect( r, QBrush( white ) );
// QImage logo = Resource::loadImage( "launcher/opielogo" );
// if ( !logo.isNull() )
// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
}
// #endif
void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
if ( event->state() == QMouseEvent::LeftButton ) {
QListViewItem *currentItem = selectedItem();
QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
if ( currentItem && currentItem->itemAbove() == itemUnder )
moveSelectedUp();
else if ( currentItem && currentItem->itemBelow() == itemUnder )
moveSelectedDown();
}
}
const DocLnk *PlayListSelection::current() {
PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem();
if ( item )
return item->file();
return NULL;
}
void PlayListSelection::addToSelection( const DocLnk &lnk ) {
PlayListSelectionItem *item = new PlayListSelectionItem( this, new DocLnk( lnk ) );
- QListViewItem *current = selectedItem();
- if ( current )
- item->moveItem( current );
+ QListViewItem *current = selectedItem();
+ if ( current )
+ item->moveItem( current );
setSelected( item, TRUE );
- ensureItemVisible( selectedItem() );
+ ensureItemVisible( item);
}
void PlayListSelection::removeSelected() {
QListViewItem *item = selectedItem();
if ( item )
delete item;
setSelected( currentItem(), TRUE );
ensureItemVisible( selectedItem() );
}
void PlayListSelection::moveSelectedUp() {
QListViewItem *item = selectedItem();
if ( item && item->itemAbove() )
item->itemAbove()->moveItem( item );
ensureItemVisible( selectedItem() );
}
void PlayListSelection::moveSelectedDown() {
QListViewItem *item = selectedItem();
if ( item && item->itemBelow() )
item->moveItem( item->itemBelow() );