From 2d8a4c2d3f86e3ae40b4a388de57021b98b9778d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Fri, 4 Jan 2013 14:40:01 +0200 Subject: Use QDir::homePath() for tilde expansion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VxWorks does not have concept of users and therefore has no function getpwnam. Use QDir::homePath() which returns actually QDir::rootPath() if there is no HOME env variable set. Change-Id: I15fe15862c4491b56cfa13bbdb218ef00dfd1f15 Reviewed-by: Samuel Rødal --- src/widgets/dialogs/qfiledialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 88652271af..40920ad9ad 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -940,7 +940,9 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded } else { QString userName = tokens.first(); userName.remove(0, 1); -#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) +#if defined(Q_OS_VXWORKS) + const QString homePath = QDir::homePath(); +#elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) passwd pw; passwd *tmpPw; char buf[200]; -- cgit v1.2.3