summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-05 19:13:57 (UTC)
committer simon <simon>2002-12-05 19:13:57 (UTC)
commit15d4d1f2fc8b37d30694acc5765a822718af6c13 (patch) (side-by-side diff)
tree53769a23884812cf009f48271fbb02bc55531754
parent4b77aaa27305f0ec120aa6ec4d860f62b7fa7a3f (diff)
downloadopie-15d4d1f2fc8b37d30694acc5765a822718af6c13.zip
opie-15d4d1f2fc8b37d30694acc5765a822718af6c13.tar.gz
opie-15d4d1f2fc8b37d30694acc5765a822718af6c13.tar.bz2
- fixed a minor memory leak
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index ac52b07..2df7f27 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -774,59 +774,58 @@ void PlayListWidget::readPls( const QString &filename ) {
lnk.setFile( s );
}
lnk.setType( "audio/x-mpegurl" );
lnk.writeLink();
d->selectedFiles->addToSelection( lnk );
}
m3uList->close();
delete m3uList;
}
/*
writes current playlist to current m3u file */
void PlayListWidget::writeCurrentM3u() {
qDebug("writing to current m3u");
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default");
Om3u *m3uList;
m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
if( d->selectedFiles->first()) {
- do {
- // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file());
- m3uList->add( d->selectedFiles->current()->file() );
+ do {
+ // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file());
+ m3uList->add( d->selectedFiles->current()->file() );
+ }
+ while ( d->selectedFiles->next() );
+ // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" );
+ m3uList->write();
+ m3uList->close();
}
- while ( d->selectedFiles->next() );
- // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" );
- m3uList->write();
- m3uList->close();
-
delete m3uList;
- }
}
/*
writes current playlist to m3u file */
void PlayListWidget::writem3u() {
InputDialog *fileDlg;
fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0);
fileDlg->exec();
QString name, filename, list;
Om3u *m3uList;
if( fileDlg->result() == 1 ) {
name = fileDlg->text();
// qDebug( filename );
if( name.left( 1) != "/" ) {
filename = QPEApplication::documentDir() + "/" + name;
}
if( name.right( 3 ) != "m3u" ) {
filename = QPEApplication::documentDir() + "/" +name+".m3u";
}