author | llornkcor <llornkcor> | 2002-10-10 01:20:36 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-10 01:20:36 (UTC) |
commit | 2cbc91d6aff15c931426f3c835b5126c7da3ba2b (patch) (side-by-side diff) | |
tree | 65d6cf3c96306ccbb55c44c5d21af3777835b134 /noncore/multimedia/opieplayer2/om3u.cpp | |
parent | 41aaa97e19b29f96fced9013a707cc6d16bc2143 (diff) | |
download | opie-2cbc91d6aff15c931426f3c835b5126c7da3ba2b.zip opie-2cbc91d6aff15c931426f3c835b5126c7da3ba2b.tar.gz opie-2cbc91d6aff15c931426f3c835b5126c7da3ba2b.tar.bz2 |
other crash fixes
Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 0be727b..039f3b1 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp @@ -50,15 +50,9 @@ Om3u::Om3u( const QString &filePath, int mode) : QStringList (){ -//filePath is path name to m3u //qDebug("<<<<<<<new m3u "+filePath); f.setName(filePath); -// if(f.exists()) -// f.open( IO_ReadWrite); -// else -// f.open( IO_ReadWrite | IO_Truncate); f.open(mode); - } Om3u::~Om3u(){} @@ -132,11 +126,13 @@ void Om3u::readPls() { //it's a pls file void Om3u::write() { //writes list to m3u file QString list; + if(count()>0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { qDebug(*it); list += *it+"\n"; } f.writeBlock( list, list.length() ); + } // f.close(); } @@ -146,6 +142,7 @@ void Om3u::add(const QString &filePath) { //adds to m3u file 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); @@ -154,7 +151,7 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list list += currentFile+"\n"; } f.writeBlock( list, list.length() ); - + } } void Om3u::deleteFile(const QString &filePath) {//deletes m3u file |