Android: Clear the m_selectedFile variable when showing again

Since the helper is being reused then the m_selectedFile variable should
be cleared, otherwise it ends up appending the new result to the old
one.

Change-Id: I72c24409dc91f91bad55a7da2772605f03fb4623
Pick-to: 5.15
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
bb10
Andy Shaw 2020-05-12 14:06:35 +02:00
parent 4c9acd103b
commit 77e978001b
1 changed files with 2 additions and 0 deletions

View File

@ -203,6 +203,8 @@ bool QAndroidPlatformFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::Win
bool isDirDialog = false;
m_selectedFile.clear();
if (options()->acceptMode() == QFileDialogOptions::AcceptSave) {
m_intent = getFileDialogIntent("ACTION_CREATE_DOCUMENT");
} else if (options()->acceptMode() == QFileDialogOptions::AcceptOpen) {