summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 35208e4..b0d4958 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -412,49 +412,54 @@ void PlayListWidget::writeConfig( Config& cfg ) const {
412 while ( d->selectedFiles->next() ); 412 while ( d->selectedFiles->next() );
413 cfg.writeEntry("NumberOfFiles", noOfFiles ); 413 cfg.writeEntry("NumberOfFiles", noOfFiles );
414} 414}
415 415
416 416
417void PlayListWidget::addToSelection( const DocLnk& lnk ) { 417void PlayListWidget::addToSelection( const DocLnk& lnk ) {
418// qDebug("add"); 418// qDebug("add");
419 d->setDocumentUsed = FALSE; 419 d->setDocumentUsed = FALSE;
420 if ( mediaPlayerState->playlist() ) 420 if ( mediaPlayerState->playlist() ) {
421 d->selectedFiles->addToSelection( lnk ); 421 if(QFileInfo(lnk.file()).exists())
422 d->selectedFiles->addToSelection( lnk );
423 }
422 else 424 else
423 mediaPlayerState->setPlaying( TRUE ); 425 mediaPlayerState->setPlaying( TRUE );
424} 426}
425 427
426 428
427void PlayListWidget::clearList() { 429void PlayListWidget::clearList() {
428 while ( first() ) 430 while ( first() )
429 d->selectedFiles->removeSelected(); 431 d->selectedFiles->removeSelected();
430} 432}
431 433
432 434
433void PlayListWidget::addAllToList() { 435void PlayListWidget::addAllToList() {
434 DocLnkSet filesAll; 436 DocLnkSet filesAll;
435 Global::findDocuments(&filesAll, "video/*;audio/*"); 437 Global::findDocuments(&filesAll, "video/*;audio/*");
436 QListIterator<DocLnk> Adit( filesAll.children() ); 438 QListIterator<DocLnk> Adit( filesAll.children() );
437 for ( ; Adit.current(); ++Adit ) 439 for ( ; Adit.current(); ++Adit )
438 d->selectedFiles->addToSelection( **Adit ); 440 if(QFileInfo(Adit.current()->file()).exists())
441 d->selectedFiles->addToSelection( **Adit );
439} 442}
440 443
441 444
442void PlayListWidget::addAllMusicToList() { 445void PlayListWidget::addAllMusicToList() {
443 QListIterator<DocLnk> dit( files.children() ); 446 QListIterator<DocLnk> dit( files.children() );
444 for ( ; dit.current(); ++dit ) 447 for ( ; dit.current(); ++dit )
448 if(QFileInfo(dit.current()->file()).exists())
445 d->selectedFiles->addToSelection( **dit ); 449 d->selectedFiles->addToSelection( **dit );
446} 450}
447 451
448 452
449void PlayListWidget::addAllVideoToList() { 453void PlayListWidget::addAllVideoToList() {
450 QListIterator<DocLnk> dit( vFiles.children() ); 454 QListIterator<DocLnk> dit( vFiles.children() );
451 for ( ; dit.current(); ++dit ) 455 for ( ; dit.current(); ++dit )
452 d->selectedFiles->addToSelection( **dit ); 456 if(QFileInfo( dit.current()->file()).exists())
457 d->selectedFiles->addToSelection( **dit );
453} 458}
454 459
455 460
456void PlayListWidget::setDocument(const QString& fileref) { 461void PlayListWidget::setDocument(const QString& fileref) {
457 qDebug(fileref); 462 qDebug(fileref);
458 fromSetDocument = TRUE; 463 fromSetDocument = TRUE;
459 if ( fileref.isNull() ) { 464 if ( fileref.isNull() ) {
460 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); 465 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );