author | llornkcor <llornkcor> | 2003-04-26 02:02:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-04-26 02:02:26 (UTC) |
commit | 908a099ba19192dcb341959125efce6cf0df20f1 (patch) (unidiff) | |
tree | ad59a689d097b1a4ffccb3ca849e936c48a9cad0 /core/multimedia/opieplayer | |
parent | 4a5b422ef2410d89aa1c3624da2ead151d815ecd (diff) | |
download | opie-908a099ba19192dcb341959125efce6cf0df20f1.zip opie-908a099ba19192dcb341959125efce6cf0df20f1.tar.gz opie-908a099ba19192dcb341959125efce6cf0df20f1.tar.bz2 |
change playlist file access mode when writing
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 795feaf..c6de5e6 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1247,49 +1247,49 @@ void PlayListWidget::writeCurrentM3u() { | |||
1247 | 1247 | ||
1248 | /* | 1248 | /* |
1249 | writes current playlist to m3u file */ | 1249 | writes current playlist to m3u file */ |
1250 | void PlayListWidget::writem3u() { | 1250 | void PlayListWidget::writem3u() { |
1251 | InputDialog *fileDlg; | 1251 | InputDialog *fileDlg; |
1252 | fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); | 1252 | fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); |
1253 | fileDlg->exec(); | 1253 | fileDlg->exec(); |
1254 | QString name, filename, list; | 1254 | QString name, filename, list; |
1255 | Om3u *m3uList; | 1255 | Om3u *m3uList; |
1256 | 1256 | ||
1257 | if( fileDlg->result() == 1 ) { | 1257 | if( fileDlg->result() == 1 ) { |
1258 | name = fileDlg->text(); | 1258 | name = fileDlg->text(); |
1259 | // qDebug( filename ); | 1259 | // qDebug( filename ); |
1260 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 1260 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
1261 | filename = name; | 1261 | filename = name; |
1262 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 1262 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
1263 | } | 1263 | } |
1264 | else //otherwise dump it somewhere noticable | 1264 | else //otherwise dump it somewhere noticable |
1265 | filename = QPEApplication::documentDir() + "/" + name; | 1265 | filename = QPEApplication::documentDir() + "/" + name; |
1266 | 1266 | ||
1267 | if( filename.right( 3 ) != "m3u" ) //needs filename extension | 1267 | if( filename.right( 3 ) != "m3u" ) //needs filename extension |
1268 | filename += ".m3u"; | 1268 | filename += ".m3u"; |
1269 | 1269 | ||
1270 | if( d->selectedFiles->first()) { | 1270 | if( d->selectedFiles->first()) { |
1271 | m3uList = new Om3u(filename, IO_ReadWrite); | 1271 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
1272 | 1272 | ||
1273 | do { | 1273 | do { |
1274 | m3uList->add( d->selectedFiles->current()->file()); | 1274 | m3uList->add( d->selectedFiles->current()->file()); |
1275 | } | 1275 | } |
1276 | while ( d->selectedFiles->next() ); | 1276 | while ( d->selectedFiles->next() ); |
1277 | // qDebug( list ); | 1277 | // qDebug( list ); |
1278 | m3uList->write(); | 1278 | m3uList->write(); |
1279 | m3uList->close(); | 1279 | m3uList->close(); |
1280 | if(m3uList) delete m3uList; | 1280 | if(m3uList) delete m3uList; |
1281 | 1281 | ||
1282 | if(fileDlg) delete fileDlg; | 1282 | if(fileDlg) delete fileDlg; |
1283 | 1283 | ||
1284 | DocLnk lnk; | 1284 | DocLnk lnk; |
1285 | lnk.setFile( filename); | 1285 | lnk.setFile( filename); |
1286 | lnk.setIcon("opieplayer2/playlist2"); | 1286 | lnk.setIcon("opieplayer2/playlist2"); |
1287 | lnk.setName( name); //sets file name | 1287 | lnk.setName( name); //sets file name |
1288 | 1288 | ||
1289 | // qDebug(filename); | 1289 | // qDebug(filename); |
1290 | Config config( "OpiePlayer" ); | 1290 | Config config( "OpiePlayer" ); |
1291 | config.setGroup( "PlayList" ); | 1291 | config.setGroup( "PlayList" ); |
1292 | 1292 | ||
1293 | config.writeEntry("CurrentPlaylist",filename); | 1293 | config.writeEntry("CurrentPlaylist",filename); |
1294 | currentPlayList=filename; | 1294 | currentPlayList=filename; |
1295 | 1295 | ||