diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index beeda2ab8..cd4d51ce4 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -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())); }