Commit a76bd6a2 authored by Andy Shaw's avatar Andy Shaw Committed by Mitch Curtis
Browse files

Only remember the folder for the next time if the dialog is accepted


If the dialog is not accepted then it should not remember the last
folder that was used. This should only happen if the user clicks on OK.

[ChangeLog][FileDialogs] Remember the folder only when the file dialog
is accepted.

Change-Id: I69957e56e887affcab9933562274013fee686063
Reviewed-by: default avatarMitch Curtis <mitch.curtis@qt.io>
Showing with 7 additions and 1 deletion
......@@ -213,7 +213,6 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
if (!m_dlgHelper)
return m_dlgHelper;
m_dlgHelper->setOptions(m_options);
connect(m_dlgHelper, SIGNAL(directoryEntered(QUrl)), this, SLOT(updateFolder(QUrl)));
connect(m_dlgHelper, SIGNAL(filterSelected(QString)), this, SIGNAL(filterSelected()));
connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
......@@ -222,6 +221,12 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
return m_dlgHelper;
}
void QQuickPlatformFileDialog::accept()
{
updateFolder(folder());
QQuickFileDialog::accept();
}
/*!
\qmlproperty bool FileDialog::visible
......
......@@ -67,6 +67,7 @@ public:
protected:
QPlatformFileDialogHelper *helper() Q_DECL_OVERRIDE;
virtual void accept() override;
Q_DISABLE_COPY(QQuickPlatformFileDialog)
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment