Closing files should be enough - so no need for size check

This commit is contained in:
craig.p.drummond
2014-02-13 19:10:57 +00:00
committed by craig.p.drummond
parent 3a20ff2ada
commit 2bdfd72963
4 changed files with 3 additions and 12 deletions

View File

@@ -132,8 +132,8 @@
79. When downloading, and parsing, ListLive streams, if a station has more than
1 stream then list all streams - adding format and bitrate
80. Move search fields back to the top of views.
81. Check sizes of temporary files after write, to ensure data is written. This
fixes an issue where sometimes 0 byte files were written from CoverDialog.
81. Close temporary files after write, to ensure data is written. This fixes an
issue where sometimes 0 byte files were written from CoverDialog.
1.2.2
-----

View File

@@ -270,7 +270,7 @@ QTemporaryFile * Device::copySongToTemp(Song &song)
if (QFile::exists(temp->fileName())) {
QFile::remove(temp->fileName()); // Copy will *not* overwrite file!
}
if (!QFile::copy(song.file, temp->fileName()) || temp->size()<=0) {
if (!QFile::copy(song.file, temp->fileName())) {
temp->remove();
delete temp;
temp=0;

View File

@@ -858,11 +858,6 @@ static QTemporaryFile * saveImageToTemp(const QImage &img, const QString &name)
}
img.save(temp);
temp->close();
if (temp->size()<=0) {
temp->remove();
delete temp;
temp=0;
}
return temp;
}

View File

@@ -568,10 +568,6 @@ void CoverDialog::downloadJobFinished()
delete last;
}
temp->close();
if (temp->size()<=0) {
delete temp;
temp=0;
}
temp->setProperty(constLargeProperty, reply->property(constLargeProperty));
tempFiles.prepend(temp);
} else {