forked from qt-creator/qt-creator
Utils: Remove one spurious static function from QtcProcess
The next one could probably be merged into FilePath::searchInPath Change-Id: If32fe77fb19b628a44d212bb8420443bd4f04899 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -1617,12 +1617,6 @@ void QtcProcess::stop()
|
||||
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
|
||||
}
|
||||
|
||||
QString QtcProcess::locateBinary(const QString &binary)
|
||||
{
|
||||
const QByteArray path = qgetenv("PATH");
|
||||
return locateBinary(QString::fromLocal8Bit(path), binary);
|
||||
}
|
||||
|
||||
/*!
|
||||
\class Utils::SynchronousProcess
|
||||
|
||||
|
@@ -144,10 +144,10 @@ public:
|
||||
// These (or some of them) may be potentially moved outside of the class.
|
||||
// For some we may aggregate in another public utils class (or subclass of QtcProcess)?
|
||||
|
||||
// TODO: How below 3 methods relate to QtcProcess? Action: move them somewhere else.
|
||||
// TODO: How below 2 methods relate to QtcProcess?
|
||||
// Action: move/merge them somewhere else, FilePath::searchInPath() ?
|
||||
// Helpers to find binaries. Do not use it for other path variables
|
||||
// and file types.
|
||||
static QString locateBinary(const QString &binary);
|
||||
static QString locateBinary(const QString &path, const QString &binary);
|
||||
static QString normalizeNewlines(const QString &text);
|
||||
|
||||
|
@@ -170,8 +170,11 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
|
||||
qtVersionsToCheck = Utils::filteredUnique(qtVersionsToCheck); // can still contain nullptr
|
||||
data->binary = findFirstCommand(qtVersionsToCheck, m_commandForQtVersion);
|
||||
// fallback
|
||||
if (data->binary.isEmpty())
|
||||
data->binary = Utils::QtcProcess::locateBinary(m_commandForQtVersion(nullptr));
|
||||
if (data->binary.isEmpty()) {
|
||||
const QString path = qEnvironmentVariable("PATH");
|
||||
data->binary = Utils::QtcProcess::locateBinary(path, m_commandForQtVersion(nullptr));
|
||||
}
|
||||
|
||||
if (data->binary.isEmpty()) {
|
||||
*errorMessage = msgAppNotFound(id().toString());
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user