summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index f9192e8..7ada5ee 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -465,3 +465,3 @@ void PlayListWidget::addSelected() {
}
- tabWidget->setCurrentPage(0);
+// tabWidget->setCurrentPage(0);
writeCurrentM3u();
@@ -485,3 +485,3 @@ void PlayListWidget::addSelected() {
}
- tabWidget->setCurrentPage(0);
+// tabWidget->setCurrentPage(0);
writeCurrentM3u();
@@ -770,20 +770,26 @@ void PlayListWidget::readm3u( const QString &filename ) {
s = *it;
-// s.replace( QRegExp( "%20" )," " );
// qDebug("reading "+ s);
if(s.left(4)=="http") {
- lnk.setName( s ); //sets file name
+ lnk.setName( s ); //sets file name
+ lnk.setIcon("opieplayer2/musicfile");
+ if(s.right(4) != '.' || s.right(5) != '.')
+ lnk.setFile( s+"/"); //if url with no extension
+ else
lnk.setFile( s ); //sets file name
- lnk.setIcon("opieplayer2/musicfile");
+
+ } else {
+ // if( QFileInfo( s ).exists() ) {
+ lnk.setName( QFileInfo(s).baseName());
+ // if(s.right(4) == '.') {//if regular file
+ if(s.left(1) != "/") {
+ // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s);
+ lnk.setFile( QFileInfo(filename).dirPath()+"/"+s);
+ lnk.setIcon("SoundPlayer");
+ } else {
+ // qDebug("set link2 "+s);
+ lnk.setFile( s);
+ lnk.setIcon("SoundPlayer");
+ }
}
- else {
- if( QFileInfo( s ).exists() ) {
- lnk.setName( QFileInfo(s).baseName());
-// qDebug("set link "+s);
- if(s.at(s.length()-4) == '.') //if regular file
- lnk.setFile( s);
- else
- lnk.setFile( s+"/"); //if url with no extension
- }
- }
- d->selectedFiles->addToSelection( lnk );
+ d->selectedFiles->addToSelection( lnk );
}
@@ -861,6 +867,4 @@ void PlayListWidget::writeCurrentM3u() {
-
- qDebug( d->selectedFiles->current()->file());
do {
- qDebug( d->selectedFiles->current()->file());
+ qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file());
m3uList->add( d->selectedFiles->current()->file() );