author | llornkcor <llornkcor> | 2002-06-17 23:21:17 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-17 23:21:17 (UTC) |
commit | 8b089ad594fad0eed4303bc83db4910784e17dd5 (patch) (unidiff) | |
tree | 77a84d7b564db72f4c04b6efc2e4fa2d8c9eef11 | |
parent | 554f88d0e8839bd6112fa42139a967712552e519 (diff) | |
download | opie-8b089ad594fad0eed4303bc83db4910784e17dd5.zip opie-8b089ad594fad0eed4303bc83db4910784e17dd5.tar.gz opie-8b089ad594fad0eed4303bc83db4910784e17dd5.tar.bz2 |
check for file existing before adding to playlist
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 17 |
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 | |||
@@ -418,8 +418,10 @@ void 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 | ||
@@ -436,5 +438,6 @@ void PlayListWidget::addAllToList() { | |||
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 | ||
@@ -442,5 +445,6 @@ void PlayListWidget::addAllToList() { | |||
442 | void PlayListWidget::addAllMusicToList() { | 445 | void 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 | } |
@@ -450,5 +454,6 @@ void 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 | ||