From 99362fb7f25a88829c2d824ebfe6da61d4d7b35f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 30 Aug 2013 12:08:47 +0200 Subject: [PATCH] Windows XP file dialog: Fix appending the selected filter suffix. The mechanism is triggered by always setting lpstrDefExt, Task-number: QTBUG-33156 Change-Id: Ib3a49410a1ad78fb433a4e0803a0751ec8c2a51e Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 27a7044868..9a7d03c0c2 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1818,8 +1818,8 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow QString defaultSuffix = m_options->defaultSuffix(); if (defaultSuffix.startsWith(QLatin1Char('.'))) defaultSuffix.remove(0, 1); - if (!defaultSuffix.isEmpty()) - ofn->lpstrDefExt = qStringToWCharArray(defaultSuffix); + // QTBUG-33156, also create empty strings to trigger the appending mechanism. + ofn->lpstrDefExt = qStringToWCharArray(defaultSuffix); } // Flags. ofn->Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_PATHMUSTEXIST);