summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/om3u.cpp
authorar <ar>2004-05-02 17:04:41 (UTC)
committer ar <ar>2004-05-02 17:04:41 (UTC)
commit4d3379027557e251201b531896974a69ae4c665a (patch) (side-by-side diff)
tree6e813be1aa29131f8f8e91f532f38f8a381e38f4 /core/multimedia/opieplayer/om3u.cpp
parentf8add41b2e0b0371754521b44d95f87fa70a6ff2 (diff)
downloadopie-4d3379027557e251201b531896974a69ae4c665a.zip
opie-4d3379027557e251201b531896974a69ae4c665a.tar.gz
opie-4d3379027557e251201b531896974a69ae4c665a.tar.bz2
- convert qDebug to odebug
Diffstat (limited to 'core/multimedia/opieplayer/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/om3u.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp
index ae89518..95ed03c 100644
--- a/core/multimedia/opieplayer/om3u.cpp
+++ b/core/multimedia/opieplayer/om3u.cpp
@@ -22,86 +22,88 @@
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "om3u.h"
+/* OPIE */
+#include <opie2/odebug.h>
static inline QString fullBaseName ( const QFileInfo &fi )
{
QString str = fi. fileName ( );
return str. left ( str. findRev ( '.' ));
}
//extern PlayListWidget *playList;
Om3u::Om3u( const QString &filePath, int mode)
: QStringList (){
-//qDebug("<<<<<<<new m3u "+filePath);
+//odebug << "<<<<<<<new m3u "+filePath << oendl;
f.setName(filePath);
f.open(mode);
}
Om3u::~Om3u(){}
void Om3u::readM3u() {
-// qDebug("<<<<<<reading m3u "+f.name());
+// odebug << "<<<<<<reading m3u "+f.name() << oendl;
QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ t.setEncoding(QTextStream::UnicodeUTF8);
QString s;
while ( !t.atEnd() ) {
s=t.readLine();
- // qDebug(s);
+ // odebug << s << oendl;
if( s.find( "#", 0, TRUE) == -1 ) {
if( s.left(2) == "E:" || s.left(2) == "P:" ) {
s = s.right( s.length() -2 );
QFileInfo f( s );
QString name = fullBaseName ( f );
name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
s=s.replace( QRegExp( "\\" ), "/" );
append(s);
- // qDebug(s);
+ // odebug << s << oendl;
} else { // is url
s.replace( QRegExp( "%20" )," " );
QString name;
// if( name.left( 4 ) == "http" ) {
// name = s.right( s.length() - 7 );
// } else {
name = s;
// }
append(name);
- // qDebug(name);
+ // odebug << name << oendl;
}
}
}
}
void Om3u::readPls() { //it's a pls file
QTextStream t( &f );
- t.setEncoding(QTextStream::UnicodeUTF8);
+ t.setEncoding(QTextStream::UnicodeUTF8);
QString s;
while ( !t.atEnd() ) {
s = t.readLine();
if( s.left(4) == "File" ) {
s = s.right( s.length() - 6 );
s.replace( QRegExp( "%20" )," ");
-// qDebug( "adding " + s + " to playlist" );
+// odebug << "adding " + s + " to playlist" << oendl;
// numberofentries=2
// File1=http
// Title
// Length
// Version
// File2=http
s = s.replace( QRegExp( "\\" ), "/" );
QFileInfo f( s );
QString name = fullBaseName ( f );
if( name.left( 4 ) == "http" ) {
name = s.right( s.length() - 7);
} else {
@@ -113,46 +115,46 @@ void Om3u::readPls() { //it's a pls file
else { //if its a url
if( name.right( 1 ).find( '/' ) == -1) {
s += "/";
}
append(s);
}
}
}
}
void Om3u::write() { //writes list to m3u file
QString list;
- QTextStream t(&f);
+ QTextStream t(&f);
t.setEncoding(QTextStream::UnicodeUTF8);
if(count()>0) {
for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
- // qDebug(*it);
- t << *it << "\n";
+ // odebug << *it << oendl;
+ t << *it << "\n";
}
}
// f.close();
}
void Om3u::add(const QString &filePath) { //adds to m3u file
append(filePath);
}
void Om3u::remove(const QString &filePath) { //removes from m3u list
QString list, currentFile;
if(count()>0) {
for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
currentFile=*it;
- // qDebug(*it);
-
+ // odebug << *it << oendl;
+
if( filePath != currentFile)
list += currentFile+"\n";
}
f.writeBlock( list, list.length() );
}
}
void Om3u::deleteFile(const QString &filePath) {//deletes m3u file
f.close();
f.remove();
}