forked from qt-creator/qt-creator
Utils: Wrap various file system iteration flags and filters
... into a single class. This makes passing them around as a whole easier, and opens a path to have "generic" filters in form of a lambda or such. Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -382,8 +382,7 @@ QVector<int> AndroidConfig::availableNdkPlatforms(const QtVersion *qtVersion) co
|
||||
.toInt());
|
||||
return true;
|
||||
},
|
||||
{"android-*"},
|
||||
QDir::Dirs);
|
||||
{{"android-*"}, QDir::Dirs});
|
||||
|
||||
Utils::sort(availableNdkPlatforms, std::greater<>());
|
||||
return availableNdkPlatforms;
|
||||
|
||||
@@ -423,7 +423,7 @@ QString AndroidManager::apkDevicePreferredAbi(const Target *target)
|
||||
QStringList apkAbis;
|
||||
const FilePaths libsPaths = libsPath.dirEntries(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (const FilePath &abiDir : libsPaths) {
|
||||
if (!abiDir.dirEntries(QStringList("*.so"), QDir::Files | QDir::NoDotAndDotDot).isEmpty())
|
||||
if (!abiDir.dirEntries({{"*.so"}, QDir::Files | QDir::NoDotAndDotDot}).isEmpty())
|
||||
apkAbis << abiDir.fileName();
|
||||
}
|
||||
return preferredAbi(apkAbis, target);
|
||||
|
||||
@@ -256,7 +256,7 @@ static QImage scaleWithoutStretching(const QImage& original, const QSize& target
|
||||
|
||||
static bool similarFilesExist(const FilePath &path)
|
||||
{
|
||||
const FilePaths entries = path.parentDir().dirEntries({path.completeBaseName() + ".*"}, {});
|
||||
const FilePaths entries = path.parentDir().dirEntries({{path.completeBaseName() + ".*"}});
|
||||
return !entries.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -73,9 +73,7 @@ static void setSdkFilesExecPermission( const FilePath &sdkExtractPath)
|
||||
}
|
||||
return true;
|
||||
},
|
||||
{"*"},
|
||||
QDir::Files,
|
||||
QDirIterator::Subdirectories);
|
||||
{{"*"}, QDir::Files, QDirIterator::Subdirectories});
|
||||
}
|
||||
|
||||
void AndroidSdkDownloader::downloadAndExtractSdk(const FilePath &jdkPath, const FilePath &sdkExtractPath)
|
||||
|
||||
@@ -322,7 +322,7 @@ void JLSClient::updateProjectFiles()
|
||||
const FilePath androidJar = sdkLocation / QString("platforms/%2/android.jar")
|
||||
.arg(targetSDK);
|
||||
FilePaths libs = {androidJar};
|
||||
libs << packageSourceDir.pathAppended("libs").dirEntries({"*.jar"}, QDir::Files);
|
||||
libs << packageSourceDir.pathAppended("libs").dirEntries({{"*.jar"}, QDir::Files});
|
||||
generateProjectFile(projectDir, qtSrc, project()->displayName());
|
||||
generateClassPathFile(projectDir, sourceDir, libs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user