Beautifier: Fix Qt4 compile.

Change-Id: Ifbd01628b28abe6879d30d43f8bd1f389988086f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
David Schulz
2014-02-18 08:32:38 +01:00
parent 3d1f07c023
commit def888d13a
7 changed files with 27 additions and 9 deletions

View File

@@ -135,14 +135,15 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
// Format temporary file
QProcess process;
command.replaceInStrings(QLatin1String("%file"), sourceFile.fileName());
process.start(command.takeFirst(), command);
const QString processProgram = command.takeFirst();
process.start(processProgram, command);
if (!process.waitForFinished()) {
showError(tr("Failed to call %1 or an error occurred.").arg(process.program()));
showError(tr("Failed to call %1 or an error occurred.").arg(processProgram));
return QString();
}
const QByteArray output = process.readAllStandardError();
if (!output.isEmpty())
showError(process.program() + QLatin1String(": ") + QString::fromLocal8Bit(output));
showError(processProgram + QLatin1String(": ") + QString::fromLocal8Bit(output));
// Read text back
Utils::FileReader reader;