Utils: Also list dot files when using the ls fallback

Change-Id: I6763280134e8cb040b6bc627b4f67d595dc2fb5e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-04-05 10:46:13 +02:00
parent a73c1b47f6
commit 663bbbfb0e

View File

@@ -1192,7 +1192,7 @@ void UnixDeviceFileAccess::findUsingLs(const QString &current,
const FileFilter &filter, const FileFilter &filter,
QStringList *found) const QStringList *found) const
{ {
const RunResult result = runInShell({"ls", {"-1", "-p", "--", current}, OsType::OsTypeLinux}); const RunResult result = runInShell({"ls", {"-1", "-a", "-p", "--", current}, OsType::OsTypeLinux});
const QStringList entries = QString::fromUtf8(result.stdOut).split('\n', Qt::SkipEmptyParts); const QStringList entries = QString::fromUtf8(result.stdOut).split('\n', Qt::SkipEmptyParts);
for (QString entry : entries) { for (QString entry : entries) {
const QChar last = entry.back(); const QChar last = entry.back();
@@ -1254,8 +1254,8 @@ void UnixDeviceFileAccess::iterateDirectory(const FilePath &filePath,
if (m_tryUseFind) { if (m_tryUseFind) {
if (iterateWithFind(filePath, filter, callBack)) if (iterateWithFind(filePath, filter, callBack))
return; return;
m_tryUseFind // Remember the failure for the next time and use the 'ls' fallback below.
= false; // remember the failure for the next time and use the 'ls' fallback below. m_tryUseFind = false;
} }
// if we do not have find - use ls as fallback // if we do not have find - use ls as fallback