summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-11-10 15:09:20 (UTC)
committer llornkcor <llornkcor>2002-11-10 15:09:20 (UTC)
commit521b993fb4175e699e9ac832c50558af0354ca25 (patch) (unidiff)
tree6fb96873b159861b062c075d3aa0dbe4eedaeeef
parent91932ca42cee5568477b1e49532a0b9e4d9bcf96 (diff)
downloadopie-521b993fb4175e699e9ac832c50558af0354ca25.zip
opie-521b993fb4175e699e9ac832c50558af0354ca25.tar.gz
opie-521b993fb4175e699e9ac832c50558af0354ca25.tar.bz2
no extras for urls
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp
index 039f3b1..12fb16e 100644
--- a/noncore/multimedia/opieplayer2/om3u.cpp
+++ b/noncore/multimedia/opieplayer2/om3u.cpp
@@ -41,25 +41,25 @@
41 41
42#include <qdir.h> 42#include <qdir.h>
43#include <qregexp.h> 43#include <qregexp.h>
44#include <qstring.h> 44#include <qstring.h>
45#include <qtextstream.h> 45#include <qtextstream.h>
46#include <qstringlist.h> 46#include <qstringlist.h>
47#include <qcstring.h> 47#include <qcstring.h>
48 48
49//extern PlayListWidget *playList; 49//extern PlayListWidget *playList;
50 50
51Om3u::Om3u( const QString &filePath, int mode) 51Om3u::Om3u( const QString &filePath, int mode)
52 : QStringList (){ 52 : QStringList (){
53//qDebug("<<<<<<<new m3u "+filePath); 53qDebug("<<<<<<<new m3u "+filePath);
54 f.setName(filePath); 54 f.setName(filePath);
55 f.open(mode); 55 f.open(mode);
56} 56}
57 57
58Om3u::~Om3u(){} 58Om3u::~Om3u(){}
59 59
60void Om3u::readM3u() { 60void Om3u::readM3u() {
61// qDebug("<<<<<<reading m3u "+f.name()); 61// qDebug("<<<<<<reading m3u "+f.name());
62 QTextStream t(&f); 62 QTextStream t(&f);
63 QString s; 63 QString s;
64 while ( !t.atEnd() ) { 64 while ( !t.atEnd() ) {
65 s=t.readLine(); 65 s=t.readLine();
@@ -106,27 +106,27 @@ void Om3u::readPls() { //it's a pls file
106 s = s.replace( QRegExp( "\\" ), "/" ); 106 s = s.replace( QRegExp( "\\" ), "/" );
107 QFileInfo f( s ); 107 QFileInfo f( s );
108 QString name = f.baseName(); 108 QString name = f.baseName();
109 if( name.left( 4 ) == "http" ) { 109 if( name.left( 4 ) == "http" ) {
110 name = s.right( s.length() - 7); 110 name = s.right( s.length() - 7);
111 } else { 111 } else {
112 name = s; 112 name = s;
113 } 113 }
114 name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); 114 name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 );
115 if( s.at( s.length() - 4) == '.') // if this is probably a file 115 if( s.at( s.length() - 4) == '.') // if this is probably a file
116 append(s); 116 append(s);
117 else { //if its a url 117 else { //if its a url
118 if( name.right( 1 ).find( '/' ) == -1) { 118// if( name.right( 1 ).find( '/' ) == -1) {
119 s += "/"; 119// s += "/";
120 } 120// }
121 append(s); 121 append(s);
122 } 122 }
123 } 123 }
124 } 124 }
125} 125}
126 126
127void Om3u::write() { //writes list to m3u file 127void Om3u::write() { //writes list to m3u file
128 QString list; 128 QString list;
129 if(count()>0) { 129 if(count()>0) {
130 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { 130 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
131 qDebug(*it); 131 qDebug(*it);
132 list += *it+"\n"; 132 list += *it+"\n";