7#include "qplatformdefs.h"
9#include <QtCore/qt_windows.h>
18 : dirPath(
entry.filePath())
19 , nativePath(
entry.nativeFilePath())
20 , findFileHandle(INVALID_HANDLE_VALUE)
25 if (nativePath.endsWith(u
".lnk"_s) && !QFileSystemEngine::isDirPath(dirPath,
nullptr)) {
30 if (!nativePath.endsWith(u
'\\'))
34 if (!dirPath.endsWith(u
'/'))
42 if (findFileHandle != INVALID_HANDLE_VALUE)
43 FindClose(findFileHandle);
48 bool haveData =
false;
49 WIN32_FIND_DATA findData;
51 if (findFileHandle == INVALID_HANDLE_VALUE && !uncFallback) {
54 DWORD dwAdditionalFlags = 0;
55 dwAdditionalFlags = 2;
60 findFileHandle = FindFirstFileEx((
const wchar_t *)nativePath.utf16(), FINDEX_INFO_LEVELS(infoLevel), &findData,
61 FINDEX_SEARCH_OPS(searchOps), 0, dwAdditionalFlags);
62 if (findFileHandle == INVALID_HANDLE_VALUE) {
63 if (nativePath.startsWith(
"\\\\?\\UNC\\"_L1)) {
65 if (parts.count() == 4 && QFileSystemEngine::uncListSharesOnServer(
66 "\\\\"_L1 + parts.at(2), &uncShares)) {
67 if (uncShares.isEmpty())
74 if (findFileHandle == INVALID_HANDLE_VALUE && !uncFallback)
79 if (++uncShareIndex >= uncShares.count())
82 if (!FindNextFile(findFileHandle, &findData))
89 metaData.fillFromFileAttribute(FILE_ATTRIBUTE_DIRECTORY);
96 metaData.fillFromFindData(findData,
true);
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QFileSystemEntry getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
Q_AUTOTEST_EXPORT NativePath nativeFilePath() const
bool advance(QFileSystemEntry &fileEntry, QFileSystemMetaData &metaData)
QFileSystemIterator(const QFileSystemEntry &entry, QDir::Filters filters)
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
Combined button and popup list for selecting options.
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]