diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-11-23 13:54:18 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-28 06:27:22 (GMT) |
commit | 27055ae6b5102a5a81aafdb98c6f769a1cbb9084 (patch) | |
tree | 6cb591115be3d365d3d41d5c22c13643dd1e01c0 /src/corelib | |
parent | bc97ab6262ec7ba7ab0420cec1d7c713fc9855c1 (diff) | |
download | Qt-27055ae6b5102a5a81aafdb98c6f769a1cbb9084.zip Qt-27055ae6b5102a5a81aafdb98c6f769a1cbb9084.tar.gz Qt-27055ae6b5102a5a81aafdb98c6f769a1cbb9084.tar.bz2 |
Do not detect directories ending in ".lnk" as link files.
Task-number: QTBUG-21863
Change-Id: I70b661fa5fcaba1293a80c971c506798826f5b23
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/1022c3ce9d445fd482a62309b9a6c52495c04a92)
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 6ea705c..f7455e8 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -830,6 +830,8 @@ 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) @@ -839,7 +841,10 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM QFileSystemEntry fname; data.knownFlagsMask |= QFileSystemMetaData::WinLnkType; - if(entry.filePath().endsWith(QLatin1String(".lnk"))) { + // Check for ".lnk": Directories named ".lnk" should be skipped, corrupted + // link files should still be detected as links. + const QString origFilePath = entry.filePath(); + if (origFilePath.endsWith(QLatin1String(".lnk")) && !isDirPath(origFilePath, 0)) { data.entryFlags |= QFileSystemMetaData::WinLnkType; fname = QFileSystemEntry(readLink(entry)); } else { |