Bootstrap: remove QDirListing/QDirIterator
Bootstrapped tools don't usually need to list directories; they should operate on file lists passed to it by the build system instead. This may deserve a QT_FEATURE. Change-Id: I01ec3c774d9943adb903fffd17b7ecfba2702fc5 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
parent
c636129c13
commit
d637bc0a5a
@ -597,9 +597,15 @@ bool QAbstractFileEngine::isRelativePath() const
|
||||
QStringList QAbstractFileEngine::entryList(QDir::Filters filters, const QStringList &filterNames) const
|
||||
{
|
||||
QStringList ret;
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
Q_UNUSED(filters);
|
||||
Q_UNUSED(filterNames);
|
||||
Q_UNREACHABLE_RETURN(ret);
|
||||
#else
|
||||
for (const auto &dirEntry : QDirListing(fileName(), filterNames, filters))
|
||||
ret.emplace_back(dirEntry.fileName());
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1294,6 +1294,7 @@ QDir::SortFlags QDir::sorting() const
|
||||
after the directories, again in reverse order.
|
||||
*/
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
/*!
|
||||
Sets the sort order used by entryList() and entryInfoList().
|
||||
|
||||
@ -1478,6 +1479,7 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
|
||||
d->sortFileList(sort, l, nullptr, &ret);
|
||||
return ret;
|
||||
}
|
||||
#endif // !QT_BOOTSTRAPPED
|
||||
|
||||
/*!
|
||||
Creates a sub-directory called \a dirName.
|
||||
@ -1614,6 +1616,7 @@ bool QDir::rmpath(const QString &dirPath) const
|
||||
return d->fileEngine->rmdir(fn, true);
|
||||
}
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
/*!
|
||||
\since 5.0
|
||||
Removes the directory, including all its contents.
|
||||
@ -1666,6 +1669,7 @@ bool QDir::removeRecursively()
|
||||
|
||||
return success;
|
||||
}
|
||||
#endif // !QT_BOOTSTRAPPED
|
||||
|
||||
/*!
|
||||
Returns \c true if the directory is readable \e and we can open files
|
||||
@ -1948,6 +1952,7 @@ bool QDir::exists(const QString &name) const
|
||||
return QFileInfo::exists(filePath(name));
|
||||
}
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
/*!
|
||||
Returns whether the directory is empty.
|
||||
|
||||
@ -1967,6 +1972,7 @@ bool QDir::isEmpty(Filters filters) const
|
||||
QDirListing dirList(d->dirEntry.filePath(), d->nameFilters, filters);
|
||||
return dirList.cbegin() == dirList.cend();
|
||||
}
|
||||
#endif // !QT_BOOTSTRAPPED
|
||||
|
||||
/*!
|
||||
Returns a list of the root directories on this system.
|
||||
|
@ -25,7 +25,6 @@ qt_internal_extend_target(Bootstrap
|
||||
../../corelib/io/qbuffer.cpp
|
||||
../../corelib/io/qdebug.cpp
|
||||
../../corelib/io/qdir.cpp
|
||||
../../corelib/io/qdirlisting.cpp
|
||||
../../corelib/io/qfile.cpp
|
||||
../../corelib/io/qfiledevice.cpp
|
||||
../../corelib/io/qfileinfo.cpp
|
||||
|
Loading…
x
Reference in New Issue
Block a user