-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 11 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 14 |
2 files changed, 13 insertions, 12 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 | |||
@@ -52,11 +52,5 @@ Om3u::Om3u( const QString &filePath, int mode) | |||
52 | : QStringList (){ | 52 | : QStringList (){ |
53 | //filePath is path name to m3u | ||
54 | //qDebug("<<<<<<<new m3u "+filePath); | 53 | //qDebug("<<<<<<<new m3u "+filePath); |
55 | f.setName(filePath); | 54 | f.setName(filePath); |
56 | // if(f.exists()) | ||
57 | // f.open( IO_ReadWrite); | ||
58 | // else | ||
59 | // f.open( IO_ReadWrite | IO_Truncate); | ||
60 | f.open(mode); | 55 | f.open(mode); |
61 | |||
62 | } | 56 | } |
@@ -134,2 +128,3 @@ void Om3u::write() { //writes list to m3u file | |||
134 | QString list; | 128 | QString list; |
129 | if(count()>0) { | ||
135 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 130 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
@@ -139,2 +134,3 @@ void Om3u::write() { //writes list to m3u file | |||
139 | f.writeBlock( list, list.length() ); | 134 | f.writeBlock( list, list.length() ); |
135 | } | ||
140 | // f.close(); | 136 | // f.close(); |
@@ -148,2 +144,3 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list | |||
148 | QString list, currentFile; | 144 | QString list, currentFile; |
145 | if(count()>0) { | ||
149 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 146 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
@@ -156,3 +153,3 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list | |||
156 | f.writeBlock( list, list.length() ); | 153 | f.writeBlock( list, list.length() ); |
157 | 154 | } | |
158 | } | 155 | } |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index e28efd0..f9192e8 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -189,4 +189,4 @@ void PlayListWidget::writeDefaultPlaylist() { | |||
189 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); | 189 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); |
190 | if( d->selectedFiles->first() ) { | ||
190 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 191 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
191 | d->selectedFiles->first(); | ||
192 | do { | 192 | do { |
@@ -200,2 +200,4 @@ void PlayListWidget::writeDefaultPlaylist() { | |||
200 | if(m3uList) delete m3uList; | 200 | if(m3uList) delete m3uList; |
201 | |||
202 | } | ||
201 | } | 203 | } |
@@ -855,5 +857,7 @@ void PlayListWidget::writeCurrentM3u() { | |||
855 | 857 | ||
858 | if( d->selectedFiles->first()) { | ||
856 | Om3u *m3uList; | 859 | Om3u *m3uList; |
857 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 860 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
858 | d->selectedFiles->first(); | 861 | |
862 | |||
859 | qDebug( d->selectedFiles->current()->file()); | 863 | qDebug( d->selectedFiles->current()->file()); |
@@ -870,2 +874,3 @@ void PlayListWidget::writeCurrentM3u() { | |||
870 | } | 874 | } |
875 | } | ||
871 | 876 | ||
@@ -892,6 +897,5 @@ void PlayListWidget::writem3u() { | |||
892 | 897 | ||
898 | if( d->selectedFiles->first()) { | ||
893 | m3uList = new Om3u(filename, IO_ReadWrite); | 899 | m3uList = new Om3u(filename, IO_ReadWrite); |
894 | 900 | ||
895 | d->selectedFiles->first(); | ||
896 | |||
897 | do { | 901 | do { |
@@ -925,3 +929,3 @@ void PlayListWidget::writem3u() { | |||
925 | } | 929 | } |
926 | 930 | } | |
927 | } | 931 | } |