summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp25
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h20
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp6
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h2
4 files changed, 27 insertions, 26 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index da734c80f0..e5a24075d9 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -45,6 +45,7 @@
#ifndef QT_NO_FILEDIALOG
#include "qfiledialog_p.h"
+#include "qplatformdialoghelper_qpa.h"
#include <private/qguiapplication_p.h>
#include <qfontmetrics.h>
#include <qaction.h>
@@ -67,11 +68,12 @@
#if defined(Q_OS_WINCE)
extern bool qt_priv_ptr_valid;
#endif
+#endif
#if defined(Q_OS_UNIX)
#include <pwd.h>
+#elif defined(Q_OS_WIN)
+# include <QtCore/qt_windows.h>
#endif
-#endif
-#include "qplatformdialoghelper_qpa.h"
QT_BEGIN_NAMESPACE
@@ -1386,6 +1388,25 @@ QLineEdit *QFileDialogPrivate::lineEdit() const {
return (QLineEdit*)qFileDialogUi->fileNameEdit;
}
+int QFileDialogPrivate::maxNameLength(const QString &path)
+{
+#if defined(Q_OS_UNIX)
+ return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
+#elif defined(Q_OS_WINCE)
+ Q_UNUSED(path);
+ return MAX_PATH;
+#elif defined(Q_OS_WIN)
+ DWORD maxLength;
+ const QString drive = path.left(3);
+ if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
+ return -1;
+ return maxLength;
+#else
+ Q_UNUSED(path);
+#endif
+ return -1;
+}
+
/*
Sets the view root index to be the file system model index
*/
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index 12b2b9a755..a66ee757f6 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -143,25 +143,7 @@ public:
QLineEdit *lineEdit() const;
- int maxNameLength(const QString &path) {
-#if defined(Q_OS_UNIX)
- return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
-#elif defined(Q_OS_WIN)
-#ifndef Q_OS_WINCE
- DWORD maxLength;
- QString drive = path.left(3);
- if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
- return -1;
- return maxLength;
-#else
- Q_UNUSED(path);
- return MAX_PATH;
-#endif //Q_OS_WINCE
-#else
- Q_UNUSED(path);
-#endif
- return -1;
- }
+ static int maxNameLength(const QString &path);
QString basename(const QString &path) const
{
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 3d26594a00..7ea4302a56 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -49,10 +49,8 @@
#include <qapplication.h>
#ifdef Q_OS_WIN
-#include <qt_windows.h>
-#endif
-#ifdef Q_OS_WIN32
-#include <QtCore/QVarLengthArray>
+# include <QtCore/QVarLengthArray>
+# include <qt_windows.h>
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index 2d567feab4..80b5fd8241 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/dialogs/qwizard_win_p.h
@@ -56,12 +56,12 @@
#ifndef QT_NO_WIZARD
#ifndef QT_NO_STYLE_WINDOWSVISTA
-#include <qt_windows.h>
#include <qobject.h>
#include <qwidget.h>
#include <qabstractbutton.h>
#include <QtWidgets/private/qwidget_p.h>
#include <QtWidgets/private/qstylehelper_p.h>
+#include <qt_windows.h>
QT_BEGIN_NAMESPACE