summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/playlistselection.cpp
authorllornkcor <llornkcor>2002-02-25 01:35:47 (UTC)
committer llornkcor <llornkcor>2002-02-25 01:35:47 (UTC)
commitf180c1a5e8fc889ff1fb390d5cc94cdbc5085046 (patch) (side-by-side diff)
tree5e9ea6f1313f4c33d57fb266523c1cfbe0826756 /core/multimedia/opieplayer/playlistselection.cpp
parentc0446b55fc32b7fdea9f58db06e40da703f5e8ff (diff)
downloadopie-f180c1a5e8fc889ff1fb390d5cc94cdbc5085046.zip
opie-f180c1a5e8fc889ff1fb390d5cc94cdbc5085046.tar.gz
opie-f180c1a5e8fc889ff1fb390d5cc94cdbc5085046.tar.bz2
fucked up- no workie.. back out
Diffstat (limited to 'core/multimedia/opieplayer/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index f17ab6f..a82b594 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
@@ -30,12 +30,11 @@
#include <stdlib.h>
-
class PlayListSelectionItem : public QListViewItem {
public:
PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) {
- setText( 0, f->name() );
- setPixmap( 0, f->pixmap() );
+ setText( 0, f->name() );
+ setPixmap( 0, f->pixmap() );
}
~PlayListSelectionItem() {
@@ -71,19 +70,19 @@ void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
p->fillRect( r, QBrush( white ) );
QImage logo = Resource::loadImage( "mpegplayer/background" );
if ( !logo.isNull() )
- p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
+ 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();
+ 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();
}
}
@@ -91,13 +90,13 @@ void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
const DocLnk *PlayListSelection::current() {
PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem();
if ( item )
- return item->file();
+ return item->file();
return NULL;
}
void PlayListSelection::addToSelection( const DocLnk &lnk ) {
- PlayListSelectionItem *item = new PlayListSelectionItem( this, new DocLnk( lnk ) );
+ PlayListSelectionItem *item = new PlayListSelectionItem( this, new DocLnk( lnk ) );
QListViewItem *current = selectedItem();
if ( current )
item->moveItem( current );
@@ -109,7 +108,7 @@ void PlayListSelection::addToSelection( const DocLnk &lnk ) {
void PlayListSelection::removeSelected() {
QListViewItem *item = selectedItem();
if ( item )
- delete item;
+ delete item;
setSelected( currentItem(), TRUE );
ensureItemVisible( selectedItem() );
}
@@ -118,7 +117,7 @@ void PlayListSelection::removeSelected() {
void PlayListSelection::moveSelectedUp() {
QListViewItem *item = selectedItem();
if ( item && item->itemAbove() )
- item->itemAbove()->moveItem( item );
+ item->itemAbove()->moveItem( item );
ensureItemVisible( selectedItem() );
}
@@ -136,7 +135,7 @@ bool PlayListSelection::prev() {
if ( item && item->itemAbove() )
setSelected( item->itemAbove(), TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
@@ -147,7 +146,7 @@ bool PlayListSelection::next() {
if ( item && item->itemBelow() )
setSelected( item->itemBelow(), TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
@@ -158,7 +157,7 @@ bool PlayListSelection::first() {
if ( item )
setSelected( item, TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
@@ -168,11 +167,11 @@ bool PlayListSelection::last() {
QListViewItem *prevItem = NULL;
QListViewItem *item = firstChild();
while ( ( item = item->nextSibling() ) )
- prevItem = item;
+ prevItem = item;
if ( prevItem )
setSelected( prevItem, TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}