summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -408,57 +408,62 @@ void PlayListWidget::writeConfig( Config& cfg ) const {
}
noOfFiles++;
}
}
while ( d->selectedFiles->next() );
cfg.writeEntry("NumberOfFiles", noOfFiles );
}
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();
}
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;
if ( fileref.isNull() ) {
QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );
return;
}
// qDebug("setDocument "+fileref);
if(fileref.find("m3u",0,TRUE) != -1) { //is m3u