-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index e33998f..612fd45 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -323,9 +323,11 @@ void PlayListWidget::readConfig( Config& cfg ) { entryName.sprintf( "File%i", i + 1 ); QString linkFile = cfg.readEntry( entryName ); + if(QFileInfo( linkFile).exists() ) { DocLnk lnk( linkFile ); - if ( lnk.isValid() ) { + if ( QFileInfo( lnk.file()).exists() || linkFile.find("http",0,TRUE) != -1) { d->selectedFiles->addToSelection( lnk ); } } + } d->selectedFiles->setSelectedItem( currentString); } @@ -652,4 +654,5 @@ void PlayListWidget::addSelected() { for ( ; dit.current(); ++dit ) { if( dit.current()->name() == it.current()->text(0) ) { + if(QFileInfo( dit.current()->file()).exists()) d->selectedFiles->addToSelection( **dit ); } @@ -669,4 +672,5 @@ void PlayListWidget::addSelected() { for ( ; dit.current(); ++dit ) { if( dit.current()->name() == it.current()->text(0) ) { + if(QFileInfo( dit.current()->file()).exists()) d->selectedFiles->addToSelection( **dit ); } @@ -702,4 +706,5 @@ void PlayListWidget::addToSelection( QListViewItem *it) { for ( ; dit.current(); ++dit ) { if( dit.current()->name() == it->text(0)) { + if(QFileInfo( dit.current()->file()).exists()) d->selectedFiles->addToSelection( **dit ); } @@ -711,4 +716,5 @@ void PlayListWidget::addToSelection( QListViewItem *it) { for ( ; dit.current(); ++dit ) { if( dit.current()->name() == it->text(0)) { + if(QFileInfo( dit.current()->file()).exists()) d->selectedFiles->addToSelection( **dit ); } @@ -1112,4 +1118,5 @@ void PlayListWidget::readm3u(const QString &filename) { if(s.left(2) == "E:" || s.left(2) == "P:") { s=s.right(s.length()-2); + if(QFile(s).exists()) { DocLnk lnk( s ); QFileInfo f(s); @@ -1122,4 +1129,5 @@ void PlayListWidget::readm3u(const QString &filename) { qDebug("add "+name); d->selectedFiles->addToSelection( lnk); + } } else { // is url s.replace(QRegExp("%20")," "); |