/*                 This file is part of the Opie Project Copyright (C) 2002 L. Potter =. .=l.            .>+-=  _;:,     .>    :=|. This program is free software; you can .> <`_,   >  .   <= redistribute it and/or modify it under :`=1 )Y*s>-.--   : the terms of the GNU Library General Public .="- .-=="i,     .._ License as published by the Free Software  - .   .-<_>     .<> Foundation; either version 2 of the License,      ._= =}       : or (at your option) any later version.     .%`+i>       _;_.     .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU ..}^=.=       =       ; Library General Public License for more ++=   -.     .`     .: details. :     =  ...= . :.=-  -.   .:....=;==+<; You should have received a copy of the GNU   -_. . .   )=.  = Library 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 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 (){ //odebug << "<<<<<<0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { // 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; // odebug << *it << oendl; if( filePath != currentFile) list += currentFile+"\n"; } f.writeBlock( list, list.length() ); } } void Om3u::deleteFile(const QString &) {//deletes m3u file f.close(); f.remove(); } void Om3u::close() { //closes m3u file f.close(); }