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 <joerg.bornemann@digia.com>
This commit is contained in:
Friedemann Kleint 2013-08-30 12:08:47 +02:00 committed by The Qt Project
parent 0ab3e290c4
commit 99362fb7f2

View File

@ -1818,8 +1818,8 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow
QString defaultSuffix = m_options->defaultSuffix(); QString defaultSuffix = m_options->defaultSuffix();
if (defaultSuffix.startsWith(QLatin1Char('.'))) if (defaultSuffix.startsWith(QLatin1Char('.')))
defaultSuffix.remove(0, 1); defaultSuffix.remove(0, 1);
if (!defaultSuffix.isEmpty()) // QTBUG-33156, also create empty strings to trigger the appending mechanism.
ofn->lpstrDefExt = qStringToWCharArray(defaultSuffix); ofn->lpstrDefExt = qStringToWCharArray(defaultSuffix);
} }
// Flags. // Flags.
ofn->Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_PATHMUSTEXIST); ofn->Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_PATHMUSTEXIST);