Flush temporary file before opening attachment.

Closes #390
This commit is contained in:
Florian Geyer 2015-12-16 21:29:09 +01:00
parent 24275d8dc4
commit c51098e2cf

View File

@ -671,6 +671,14 @@ void EditEntryWidget::openAttachment(const QModelIndex& index)
return;
}
if (!file->flush()) {
MessageBox::warning(this, tr("Error"),
tr("Unable to save the attachment:\n").append(file->errorString()));
return;
}
file->close();
QDesktopServices::openUrl(QUrl::fromLocalFile(file->fileName()));
}