summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp14
2 files changed, 6 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp
index 975dec3..2019b3a 100644
--- a/noncore/multimedia/opieplayer2/playlistselection.cpp
+++ b/noncore/multimedia/opieplayer2/playlistselection.cpp
@@ -111,13 +111,12 @@ void PlayListSelection::addToSelection( const DocLnk &lnk ) {
ensureItemVisible( selectedItem() );
}
void PlayListSelection::removeSelected() {
QListViewItem *item = selectedItem();
- if ( item )
delete item;
setSelected( currentItem(), TRUE );
ensureItemVisible( selectedItem() );
}
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 86b3424..ac52b07 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -188,13 +188,13 @@ void PlayListWidget::writeDefaultPlaylist() {
m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
m3uList->write();
m3uList->close();
- if(m3uList) delete m3uList;
+ delete m3uList;
}
}
}
void PlayListWidget::addToSelection( const DocLnk& lnk ) {
@@ -681,16 +681,14 @@ void PlayListWidget::openFile() {
d->selectedFiles->addToSelection( lnk);
writeCurrentM3u();
d->selectedFiles->setSelectedItem( lnk.name());
}
}
- if( fileDlg ) {
delete fileDlg;
}
-}
/*
reads m3u and shows files/urls to playlist widget */
void PlayListWidget::readm3u( const QString &filename ) {
qDebug( "read m3u filename " + filename );
@@ -731,13 +729,13 @@ void PlayListWidget::readm3u( const QString &filename ) {
config.writeEntry("CurrentPlaylist",filename);
config.write();
currentPlayList=filename;
// m3uList->write();
m3uList->close();
- if(m3uList) delete m3uList;
+ delete m3uList;
d->selectedFiles->setSelectedItem( s);
setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName());
}
@@ -779,13 +777,13 @@ void PlayListWidget::readPls( const QString &filename ) {
lnk.writeLink();
d->selectedFiles->addToSelection( lnk );
}
m3uList->close();
- if(m3uList) delete m3uList;
+ delete m3uList;
}
/*
writes current playlist to current m3u file */
void PlayListWidget::writeCurrentM3u() {
qDebug("writing to current m3u");
@@ -803,13 +801,13 @@ void PlayListWidget::writeCurrentM3u() {
}
while ( d->selectedFiles->next() );
// qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" );
m3uList->write();
m3uList->close();
- if(m3uList) delete m3uList;
+ delete m3uList;
}
}
/*
writes current playlist to m3u file */
@@ -839,15 +837,15 @@ void PlayListWidget::writem3u() {
m3uList->add( d->selectedFiles->current()->file());
}
while ( d->selectedFiles->next() );
// qDebug( list );
m3uList->write();
m3uList->close();
- if(m3uList) delete m3uList;
+ delete m3uList;
- if(fileDlg) delete fileDlg;
+ delete fileDlg;
DocLnk lnk;
lnk.setFile( filename);
lnk.setIcon("opieplayer2/playlist2");
lnk.setName( name); //sets file name