summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-10-10 01:20:36 (UTC)
committer llornkcor <llornkcor>2002-10-10 01:20:36 (UTC)
commit2cbc91d6aff15c931426f3c835b5126c7da3ba2b (patch) (side-by-side diff)
tree65d6cf3c96306ccbb55c44c5d21af3777835b134
parent41aaa97e19b29f96fced9013a707cc6d16bc2143 (diff)
downloadopie-2cbc91d6aff15c931426f3c835b5126c7da3ba2b.zip
opie-2cbc91d6aff15c931426f3c835b5126c7da3ba2b.tar.gz
opie-2cbc91d6aff15c931426f3c835b5126c7da3ba2b.tar.bz2
other crash fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp11
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp14
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)
: 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);
-
}
@@ -134,2 +128,3 @@ void Om3u::write() { //writes list to m3u file
QString list;
+ if(count()>0) {
for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
@@ -139,2 +134,3 @@ void Om3u::write() { //writes list to m3u file
f.writeBlock( list, list.length() );
+ }
// f.close();
@@ -148,2 +144,3 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list
QString list, currentFile;
+ if(count()>0) {
for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
@@ -156,3 +153,3 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list
f.writeBlock( list, list.length() );
-
+ }
}
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() {
// qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>");
+ if( d->selectedFiles->first() ) {
m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate);
- d->selectedFiles->first();
do {
@@ -200,2 +200,4 @@ void PlayListWidget::writeDefaultPlaylist() {
if(m3uList) delete m3uList;
+
+ }
}
@@ -855,5 +857,7 @@ void PlayListWidget::writeCurrentM3u() {
+ if( d->selectedFiles->first()) {
Om3u *m3uList;
m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
- d->selectedFiles->first();
+
+
qDebug( d->selectedFiles->current()->file());
@@ -870,2 +874,3 @@ void PlayListWidget::writeCurrentM3u() {
}
+}
@@ -892,6 +897,5 @@ void PlayListWidget::writem3u() {
+ if( d->selectedFiles->first()) {
m3uList = new Om3u(filename, IO_ReadWrite);
- d->selectedFiles->first();
-
do {
@@ -925,3 +929,3 @@ void PlayListWidget::writem3u() {
}
-
+ }
}