diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2021-09-28 13:56:16 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2021-09-30 21:20:25 +0200 |
commit | 55ab987c9a518f217c02ca1382656ac97c53b307 (patch) | |
tree | 0d22dfee4c43ff5d9b3c38ebb7796e325bbaa729 /src/corelib/io/qfilesystemengine_win.cpp | |
parent | 6ad88e789866e799ffffc3b963f3a30fd4e8c9c7 (diff) |
Fix QDir::entryList to work for directories that end with '.lnk'
In addition to checking the .lnk extension, check that the
the specified path is not a path to a directory.
Pick-to: 6.2
Fixes: QTBUG-85058
Change-Id: I83cef3d94c6ffa82a88f374c5b41779e88fe40b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_win.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 0d3dd2e0b2..33a123d6fd 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1022,8 +1022,6 @@ bool QFileSystemEngine::fillMetaData(HANDLE fHandle, QFileSystemMetaData &data, return data.hasFlags(what); } -static bool isDirPath(const QString &dirPath, bool *existed); - //static bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what) @@ -1103,7 +1101,8 @@ static inline bool rmDir(const QString &path) return ::RemoveDirectory((wchar_t*)QFSFileEnginePrivate::longFileName(path).utf16()); } -static bool isDirPath(const QString &dirPath, bool *existed) +//static +bool QFileSystemEngine::isDirPath(const QString &dirPath, bool *existed) { QString path = dirPath; if (path.length() == 2 && path.at(1) == QLatin1Char(':')) @@ -1141,7 +1140,7 @@ static bool createDirectoryWithParents(const QString &nativeName, bool shouldMkd }; const auto isDir = [](const QString &nativeName) { bool exists = false; - return isDirPath(nativeName, &exists) && exists; + return QFileSystemEngine::isDirPath(nativeName, &exists) && exists; }; // Do not try to mkdir a UNC root path or a drive letter. if (isUNCRoot(nativeName) || isDriveName(nativeName)) |