summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index ab6b593..26c2896 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -188,97 +188,97 @@ void PlayListWidget::readConfig( Config& cfg ) {
cfg.setGroup( "PlayList" );
QString currentString = cfg.readEntry( "current", "" );
int noOfFiles = cfg.readNumEntry( "NumberOfFiles", 0 );
for ( int i = 0; i < noOfFiles; i++ ) {
QString entryName;
entryName.sprintf( "File%i", i + 1 );
QString linkFile = cfg.readEntry( entryName );
qDebug("reading "+linkFile);
if( QFileInfo( linkFile ).exists() ) {
DocLnk lnk( linkFile );
if ( QFileInfo( lnk.file() ).exists() ||
linkFile.find( "http" , 0, TRUE) != -1) {
d->selectedFiles->addToSelection( lnk );
}
}
}
d->selectedFiles->setSelectedItem( currentString );
}
void PlayListWidget::writeConfig( Config& cfg ) const {
-// Config config( "OpiePlayer" );
-// config.setGroup( "PlayList" );
+ Config config( "OpiePlayer" );
+ config.setGroup( "PlayList" );
// if(config.readBoolEntry("newPlaylist")) {
// new for testing
QString name, filename, list;
Om3u *m3uList;
name = "default";
filename=QPEApplication::documentDir() + "/" + name+".m3u";
m3uList = new Om3u(filename);
d->selectedFiles->first();
do {
m3uList->add( d->selectedFiles->current()->file());
}
while ( d->selectedFiles->next() );
qDebug( list );
m3uList->write();
m3uList->close();
if(m3uList) delete m3uList;
DocLnk lnk;
lnk.setFile( filename);
lnk.setIcon("opieplayer2/playlist2");
lnk.setName( name); //sets file name
qDebug("writing default playlist "+filename);
- config.writeEntry("CurrentPlaylist", filename);
+ config.writeEntry("CurrentPlaylist", filename);
// currentPlayList=filename;
if(!lnk.writeLink()) {
qDebug("Writing doclink did not work");
}
// } else {
// d->selectedFiles->writeCurrent( cfg );
// int noOfFiles = 0;
// d->selectedFiles->first();
// do {
// const DocLnk *lnk = d->selectedFiles->current();
// if ( lnk ) {
// QString entryName;
// entryName.sprintf( "File%i", noOfFiles + 1 );
// cfg.writeEntry( entryName, lnk->linkFile() );
// // if this link does exist, add it so we have the file
// // next time...
// if ( !QFile::exists( lnk->linkFile() ) ) {
// lnk->writeLink();
// }
// }
// noOfFiles++;
// }
// while ( d->selectedFiles->next() );
// cfg.writeEntry("NumberOfFiles", noOfFiles );