summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-06-26 12:21:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-26 13:54:07 +0200
commitfb2a25e7564f4651beb955fd3ecb2e644b16d80d (patch)
treed8267673fd8ae046b996f35ce29f265ad429946d /src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
parenta98b60edfcdc5c84da6d34613a44da207e07d15e (diff)
Windows XP: Fix directory chooser dialog.
Set initial directory and title correctly in native file dialog. Task-number: QTBUG-31098 Change-Id: I87c4383bdf0b26beda6a075a186d0a951c86f8a7 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index f7ccb00233..12dd00f104 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -1720,7 +1720,9 @@ int QWindowsXpNativeFileDialog::existingDirCallback(HWND hwnd, UINT uMsg, LPARAM
{
switch (uMsg) {
case BFFM_INITIALIZED: {
- const QString initialFile = m_data.selectedFile();
+ if (!m_title.isEmpty())
+ SetWindowText(hwnd, (wchar_t *)m_title.utf16());
+ const QString initialFile = QDir::toNativeSeparators(m_data.directory());
if (!initialFile.isEmpty())
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, LPARAM(initialFile.utf16()));
}
@@ -1743,8 +1745,7 @@ QStringList QWindowsXpNativeFileDialog::execExistingDir(HWND owner)
initPath[0] = 0;
bi.hwndOwner = owner;
bi.pidlRoot = NULL;
- //### This does not seem to be respected? - the dialog always displays "Browse for folder"
- bi.lpszTitle = (wchar_t*)m_title.utf16();
+ bi.lpszTitle = 0;
bi.pszDisplayName = initPath;
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_NEWDIALOGSTYLE;
bi.lpfn = xpFileDialogGetExistingDirCallbackProc;