summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp10
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
@@ -322,11 +322,13 @@ void PlayListWidget::readConfig( Config& cfg ) {
QString entryName;
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);
}
@@ -651,6 +653,7 @@ void PlayListWidget::addSelected() {
QListIterator<DocLnk> dit( files.children() );
for ( ; dit.current(); ++dit ) {
if( dit.current()->name() == it.current()->text(0) ) {
+ if(QFileInfo( dit.current()->file()).exists())
d->selectedFiles->addToSelection( **dit );
}
}
@@ -668,6 +671,7 @@ void PlayListWidget::addSelected() {
QListIterator<DocLnk> dit( vFiles.children() );
for ( ; dit.current(); ++dit ) {
if( dit.current()->name() == it.current()->text(0) ) {
+ if(QFileInfo( dit.current()->file()).exists())
d->selectedFiles->addToSelection( **dit );
}
}
@@ -701,6 +705,7 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
QListIterator<DocLnk> dit( files.children() );
for ( ; dit.current(); ++dit ) {
if( dit.current()->name() == it->text(0)) {
+ if(QFileInfo( dit.current()->file()).exists())
d->selectedFiles->addToSelection( **dit );
}
}
@@ -710,6 +715,7 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
QListIterator<DocLnk> dit( vFiles.children() );
for ( ; dit.current(); ++dit ) {
if( dit.current()->name() == it->text(0)) {
+ if(QFileInfo( dit.current()->file()).exists())
d->selectedFiles->addToSelection( **dit );
}
}
@@ -1111,6 +1117,7 @@ void PlayListWidget::readm3u(const QString &filename) {
if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat
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);
QString name = f.baseName();
@@ -1121,6 +1128,7 @@ void PlayListWidget::readm3u(const QString &filename) {
lnk.writeLink();
qDebug("add "+name);
d->selectedFiles->addToSelection( lnk);
+ }
} else { // is url
s.replace(QRegExp("%20")," ");
DocLnk lnk( s );