Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.8.0
-
None
-
Visual Studio 2010, 32-bit
Description
QFileDialogPrivate::maxNameLength(const QString &path) (in \src\gui\dialogs\qfiledialog_p.h) does not compile if a single-byte charset is used.
Line ~149:
if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
uses "GetVolumeInformationA" in that case which doesn't work with wchar *.
I'd propose something like:
#if defined(_UNICODE) || defined(_MBCS)
if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
#else
if (::GetVolumeInformation(drive.toLocal8Bit().constData(), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
#endif
as a patch.