forked from qt-creator/qt-creator
Utils: Rename FilePath::searchOnDevice to searchInDirectories
Makes it a bit clearer that there's no magic path use or similar beyond this point. Change-Id: I86c06850d16bf777db05ad23b540d8096926c059 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1139,11 +1139,11 @@ FilePath FilePath::withNewPath(const QString &newPath) const
|
||||
Example usage:
|
||||
\code
|
||||
binary = FilePath::fromUrl("docker://123/./make);
|
||||
fullPath = binary.searchOnDevice();
|
||||
fullPath = binary.searchInDirectories(binary.deviceEnvironment().path());
|
||||
assert(fullPath == FilePath::fromUrl("docker://123/usr/bin/make"))
|
||||
\endcode
|
||||
*/
|
||||
FilePath FilePath::searchOnDevice(const FilePaths &dirs) const
|
||||
FilePath FilePath::searchInDirectories(const FilePaths &dirs) const
|
||||
{
|
||||
if (needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.searchInPath, return {});
|
||||
|
@@ -168,7 +168,7 @@ public:
|
||||
static FilePath fromUrl(const QUrl &url);
|
||||
QUrl toUrl() const;
|
||||
|
||||
FilePath searchOnDevice(const QList<FilePath> &dirs) const;
|
||||
FilePath searchInDirectories(const QList<FilePath> &dirs) const;
|
||||
Environment deviceEnvironment() const;
|
||||
|
||||
static QString formatFilePaths(const QList<FilePath> &files, const QString &separator);
|
||||
|
@@ -226,7 +226,7 @@ FilePath PathChooserPrivate::expandedPath(const QString &input) const
|
||||
case PathChooser::ExistingCommand: {
|
||||
FilePaths searchPaths = env.path();
|
||||
searchPaths.append(m_baseDirectory);
|
||||
const FilePath expanded = path.searchOnDevice(searchPaths);
|
||||
const FilePath expanded = path.searchInDirectories(searchPaths);
|
||||
return expanded.isEmpty() ? path : expanded;
|
||||
}
|
||||
case PathChooser::Any:
|
||||
|
@@ -188,7 +188,7 @@ void CMakeToolManager::autoDetectCMakeForDevice(const FilePath &deviceRoot,
|
||||
const FilePaths candidates = {deviceRoot.withNewPath("cmake")};
|
||||
const Environment env = deviceRoot.deviceEnvironment();
|
||||
for (const FilePath &candidate : candidates) {
|
||||
const FilePath cmake = candidate.searchOnDevice(env.path());
|
||||
const FilePath cmake = candidate.searchInDirectories(env.path());
|
||||
if (!cmake.isEmpty()) {
|
||||
registerCMakeByPath(cmake, detectionSource);
|
||||
messages.append(tr("Found \"%1\"").arg(cmake.toUserOutput()));
|
||||
|
@@ -107,7 +107,7 @@ QVersionNumber WebAssemblyEmSdk::version(const FilePath &sdkRoot)
|
||||
Environment env;
|
||||
WebAssemblyEmSdk::addToEnvironment(sdkRoot, env);
|
||||
QLatin1String scriptFile{sdkRoot.osType() == OsType::OsTypeWindows ? "emcc.bat" : "emcc"};
|
||||
FilePath script = sdkRoot.withNewPath(scriptFile).searchOnDevice(env.path());
|
||||
FilePath script = sdkRoot.withNewPath(scriptFile).searchInDirectories(env.path());
|
||||
const CommandLine command(script, {"-dumpversion"});
|
||||
QtcProcess emcc;
|
||||
emcc.setCommand(command);
|
||||
|
@@ -186,7 +186,7 @@ QList<ToolChain *> WebAssemblyToolChainFactory::autoDetect(
|
||||
const bool cLanguage = languageId == ProjectExplorer::Constants::C_LANGUAGE_ID;
|
||||
const QString script = QLatin1String(cLanguage ? "emcc" : "em++")
|
||||
+ QLatin1String(sdk.osType() == OsTypeWindows ? ".bat" : "");
|
||||
const FilePath scriptFile = sdk.withNewPath(script).searchOnDevice(env.path());
|
||||
const FilePath scriptFile = sdk.withNewPath(script).searchInDirectories(env.path());
|
||||
toolChain->setCompilerCommand(scriptFile);
|
||||
|
||||
const QString displayName = WebAssemblyToolChain::tr("Emscripten Compiler %1 for %2")
|
||||
|
Reference in New Issue
Block a user