Closing files should be enough - so no need for size check
This commit is contained in:
committed by
craig.p.drummond
parent
3a20ff2ada
commit
2bdfd72963
@@ -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
|
||||
-----
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user