forked from qt-creator/qt-creator
Use QtcProcess inside fake vim handler
Change-Id: I14af193bbf9e7fda9e5b0ba0a1647e19069c40e2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -59,12 +59,12 @@
|
||||
#include "fakevimtr.h"
|
||||
|
||||
#include <utils/optional.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QProcess>
|
||||
#include <QRegularExpression>
|
||||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
@@ -866,17 +866,10 @@ static QString fromLocalEncoding(const QByteArray &data)
|
||||
|
||||
static QString getProcessOutput(const QString &command, const QString &input)
|
||||
{
|
||||
QProcess proc;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
|
||||
QStringList arguments = QProcess::splitCommand(command);
|
||||
QString executable = arguments.takeFirst();
|
||||
proc.start(executable, arguments);
|
||||
#else
|
||||
proc.start(command);
|
||||
#endif
|
||||
proc.waitForStarted();
|
||||
proc.write(toLocalEncoding(input));
|
||||
proc.closeWriteChannel();
|
||||
Utils::QtcProcess proc;
|
||||
proc.setCommand(Utils::CommandLine::fromUserInput(command));
|
||||
proc.setWriteData(toLocalEncoding(input));
|
||||
proc.start();
|
||||
|
||||
// FIXME: Process should be interruptable by user.
|
||||
// Solution is to create a QObject for each process and emit finished state.
|
||||
|
Reference in New Issue
Block a user