Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 790fa09..f2a01d3 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp @@ -37,12 +37,15 @@ using namespace Opie::Core; //extern PlayListWidget *playList; Om3u::Om3u( const QString &filePath, int mode) - : QStringList (){ + : QStringList () +{ odebug << "<<<<<<<new m3u "+filePath << oendl; f.setName(filePath); - f.open(mode); + if (!f.open(mode)) { + owarn << "Unable to open file " << f.name() << oendl; + } } Om3u::~Om3u(){} @@ -82,14 +85,8 @@ void Om3u::readPls() { //it's a pls file s = s.right( s.length() - s.find("=",0,true)-1 ); s = s.stripWhiteSpace(); s.replace( QRegExp( "%20" )," "); // odebug << "adding " + s + " to playlist" << oendl; - // numberofentries=2 - // File1=http - // Title - // Length - // Version - // File2=http s = s.replace( QRegExp( "\\" ), "/" ); QFileInfo f( s ); QString name = f.baseName(); if( name.left( 4 ) == "http" ) { @@ -100,11 +97,8 @@ void Om3u::readPls() { //it's a pls file name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); if( s.at( s.length() - 4) == '.') // if this is probably a file append(s); else { //if its a url -// if( name.right( 1 ).find( '/' ) == -1) { -// s += "/"; -// } append(s); } } } @@ -119,9 +113,8 @@ void Om3u::write() { //writes list to m3u file // odebug << *it << oendl; t << *it << "\n"; } } -// f.close(); } void Om3u::add(const QString &filePath) { //adds to m3u file append(filePath); |