author | erik <erik> | 2007-01-31 22:23:27 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-31 22:23:27 (UTC) |
commit | 73edac572d9ac9cfd18cc1254fc2019563d55f16 (patch) (side-by-side diff) | |
tree | a420b341ce2bcb4a049c76935544b8bce2a0a853 /noncore/multimedia/opieplayer2 | |
parent | ed5fba8cdb27174427b2e7780508bafa05536ca1 (diff) | |
download | opie-73edac572d9ac9cfd18cc1254fc2019563d55f16.zip opie-73edac572d9ac9cfd18cc1254fc2019563d55f16.tar.gz opie-73edac572d9ac9cfd18cc1254fc2019563d55f16.tar.bz2 |
A few files that dereference pointers w/out checking that the pointer is
valid.
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistselection.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 678ebdf..780d705 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/playlistselection.cpp @@ -50,14 +50,6 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) : QListView( parent, name ) { // odebug << "starting playlistselector" << oendl; -// #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 ); @@ -68,15 +60,10 @@ PlayListSelection::~PlayListSelection() { } -// #ifdef USE_PLAYLIST_BACKGROUND void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { // odebug << "drawBackground" << oendl; 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 ) { @@ -94,7 +81,7 @@ void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { const DocLnk *PlayListSelection::current() { PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem(); if ( item ) - return item->file(); + return item->file(); return NULL; } @@ -120,7 +107,7 @@ void PlayListSelection::removeSelected() { void PlayListSelection::moveSelectedUp() { QListViewItem *item = selectedItem(); if ( item && item->itemAbove() ) - item->itemAbove()->moveItem( item ); + item->itemAbove()->moveItem( item ); ensureItemVisible( selectedItem() ); } @@ -138,7 +125,7 @@ bool PlayListSelection::prev() { if ( item && item->itemAbove() ) setSelected( item->itemAbove(), TRUE ); else - return FALSE; + return FALSE; ensureItemVisible( selectedItem() ); return TRUE; } @@ -148,7 +135,7 @@ bool PlayListSelection::next() { if ( item && item->itemBelow() ) setSelected( item->itemBelow(), TRUE ); else - return FALSE; + return FALSE; ensureItemVisible( selectedItem() ); return TRUE; } @@ -159,7 +146,7 @@ bool PlayListSelection::first() { if ( item ) setSelected( item, TRUE ); else - return FALSE; + return FALSE; ensureItemVisible( selectedItem() ); return TRUE; } @@ -169,27 +156,27 @@ 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; } void PlayListSelection::unSelect() { - //QListViewItem *item = selectedItem(); setSelected( currentItem(), FALSE); } void PlayListSelection::writeCurrent( Config& cfg ) { cfg.setGroup("PlayList"); QListViewItem *item = selectedItem(); - if ( item ) + if ( item ) { cfg.writeEntry("current", item->text(0) ); - odebug << item->text(0) << oendl; + odebug << item->text(0) << oendl; + } } @@ -206,6 +193,4 @@ void PlayListSelection::setSelectedItem(const QString &strk ) { return; } } -// setSelected( item, TRUE ); -// ensureItemVisible( selectedItem() ); } |