From 2987895370bfe397c461707f99a3ad2d67946246 Mon Sep 17 00:00:00 2001 From: frostasm Date: Fri, 20 Oct 2017 15:20:44 +0300 Subject: [PATCH] Fix usage of LastAttachmentDir in entry attachments --- src/gui/entry/EditEntryWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 8457c5af3..6ea2088a5 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -727,7 +727,9 @@ void EditEntryWidget::insertAttachment() return; } - m_entryAttachments->set(QFileInfo(filename).fileName(), data); + const QFileInfo fInfo(filename); + config()->set("LastAttachmentDir", fInfo.absolutePath()); + m_entryAttachments->set(fInfo.fileName(), data); } void EditEntryWidget::saveCurrentAttachment() @@ -757,6 +759,7 @@ void EditEntryWidget::saveCurrentAttachment() showMessage(tr("Unable to save the attachment:\n").append(file.errorString()), MessageWidget::Error); return; } + config()->set("LastAttachmentDir", QFileInfo(savePath).absolutePath()); } }