forked from qt-creator/qt-creator
QtSupport: Simplify startEditorProcess()
Skip pid arg, as it's not used. Inline error message construction. Change-Id: I429d2094c2c8117fb79e9c9309036d9573b29f3f Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -118,12 +118,6 @@ static QString locateBinary(const QString &path, const QString &binary)
|
||||
return {};
|
||||
}
|
||||
|
||||
static QString msgStartFailed(const QString &binary, QStringList arguments)
|
||||
{
|
||||
arguments.push_front(binary);
|
||||
return Tr::tr("Unable to start \"%1\"").arg(arguments.join(QLatin1Char(' ')));
|
||||
}
|
||||
|
||||
static QString designerBinary(const QtSupport::QtVersion *qtVersion)
|
||||
{
|
||||
if (qtVersion)
|
||||
@@ -227,12 +221,11 @@ static bool startEditorProcess(const LaunchData &data, QString *errorMessage)
|
||||
{
|
||||
if (debug)
|
||||
qDebug() << Q_FUNC_INFO << '\n' << data.binary << data.arguments << data.workingDirectory;
|
||||
qint64 pid = 0;
|
||||
if (!Process::startDetached({FilePath::fromString(data.binary), data.arguments}, data.workingDirectory, &pid)) {
|
||||
*errorMessage = msgStartFailed(data.binary, data.arguments);
|
||||
return false;
|
||||
}
|
||||
const CommandLine cmd{FilePath::fromString(data.binary), data.arguments};
|
||||
if (Process::startDetached(cmd, data.workingDirectory))
|
||||
return true;
|
||||
*errorMessage = Tr::tr("Unable to start \"%1\".").arg(cmd.toUserOutput());
|
||||
return false;
|
||||
}
|
||||
|
||||
// ExternalDesignerEditorFactory with Designer Tcp remote control.
|
||||
|
Reference in New Issue
Block a user