[kde-doc-english] [trojita] src/Gui: GUI: remember last dir when adding attachments

Jan Kundrát jkt at kde.org
Thu Jan 21 13:32:49 UTC 2016


Git commit 379fe2a8eb01eae06d77836de2689bc061fa729a by Jan Kundrát.
Committed on 21/01/2016 at 12:03.
Pushed by gerrit into branch 'master'.

GUI: remember last dir when adding attachments

BUG: 358208
Change-Id: Id54a718a77105ae4deffa31f87b3c0a98fa325f1

M  +3    -1    src/Gui/ComposeWidget.cpp

http://commits.kde.org/trojita/379fe2a8eb01eae06d77836de2689bc061fa729a

diff --git a/src/Gui/ComposeWidget.cpp b/src/Gui/ComposeWidget.cpp
index ec6c539..1a68bdf 100644
--- a/src/Gui/ComposeWidget.cpp
+++ b/src/Gui/ComposeWidget.cpp
@@ -1444,9 +1444,11 @@ bool ComposeWidget::eventFilter(QObject *o, QEvent *e)
 
 void ComposeWidget::slotAskForFileAttachment()
 {
-    QString fileName = QFileDialog::getOpenFileName(this, tr("Attach File..."), QString(), QString(), 0,
+    static QDir directory = QDir::home();
+    QString fileName = QFileDialog::getOpenFileName(this, tr("Attach File..."), directory.absolutePath(), QString(), 0,
                                                     QFileDialog::DontResolveSymlinks);
     if (!fileName.isEmpty()) {
+        directory = QFileInfo(fileName).absoluteDir();
         m_submission->composer()->addFileAttachment(fileName);
     }
 }


More information about the kde-doc-english mailing list