author | llornkcor <llornkcor> | 2002-06-17 23:21:17 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-17 23:21:17 (UTC) |
commit | 8b089ad594fad0eed4303bc83db4910784e17dd5 (patch) (side-by-side diff) | |
tree | 77a84d7b564db72f4c04b6efc2e4fa2d8c9eef11 /core | |
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 @@ -414,16 +414,18 @@ void PlayListWidget::writeConfig( Config& cfg ) const { } void PlayListWidget::addToSelection( const DocLnk& lnk ) { // qDebug("add"); d->setDocumentUsed = FALSE; - if ( mediaPlayerState->playlist() ) - d->selectedFiles->addToSelection( lnk ); + if ( mediaPlayerState->playlist() ) { + if(QFileInfo(lnk.file()).exists()) + d->selectedFiles->addToSelection( lnk ); + } else - mediaPlayerState->setPlaying( TRUE ); + mediaPlayerState->setPlaying( TRUE ); } void PlayListWidget::clearList() { while ( first() ) d->selectedFiles->removeSelected(); @@ -432,27 +434,30 @@ void PlayListWidget::clearList() { void PlayListWidget::addAllToList() { DocLnkSet filesAll; Global::findDocuments(&filesAll, "video/*;audio/*"); QListIterator<DocLnk> Adit( filesAll.children() ); for ( ; Adit.current(); ++Adit ) - d->selectedFiles->addToSelection( **Adit ); + if(QFileInfo(Adit.current()->file()).exists()) + d->selectedFiles->addToSelection( **Adit ); } void PlayListWidget::addAllMusicToList() { QListIterator<DocLnk> dit( files.children() ); - for ( ; dit.current(); ++dit ) + for ( ; dit.current(); ++dit ) + if(QFileInfo(dit.current()->file()).exists()) d->selectedFiles->addToSelection( **dit ); } void PlayListWidget::addAllVideoToList() { QListIterator<DocLnk> dit( vFiles.children() ); for ( ; dit.current(); ++dit ) - d->selectedFiles->addToSelection( **dit ); + if(QFileInfo( dit.current()->file()).exists()) + d->selectedFiles->addToSelection( **dit ); } void PlayListWidget::setDocument(const QString& fileref) { qDebug(fileref); fromSetDocument = TRUE; |