forked from qt-creator/qt-creator
FakeVim: Simplify calling external processes
Change-Id: I5157e2e73654df8bef65d72b7209c487e8b0c881 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -864,15 +864,6 @@ static QByteArray toLocalEncoding(const QString &text)
|
||||
#endif
|
||||
}
|
||||
|
||||
static QString fromLocalEncoding(const QByteArray &data)
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
return QString::fromLocal8Bit(data).replace("\n", "\r\n");
|
||||
#else
|
||||
return QString::fromLocal8Bit(data);
|
||||
#endif
|
||||
}
|
||||
|
||||
static QString getProcessOutput(const QString &command, const QString &input)
|
||||
{
|
||||
Utils::QtcProcess proc;
|
||||
@@ -884,7 +875,7 @@ static QString getProcessOutput(const QString &command, const QString &input)
|
||||
// Solution is to create a QObject for each process and emit finished state.
|
||||
proc.waitForFinished();
|
||||
|
||||
return fromLocalEncoding(proc.readAllStandardOutput());
|
||||
return proc.cleanedStdOut();
|
||||
}
|
||||
|
||||
static const QMap<QString, int> &vimKeyNames()
|
||||
|
||||
Reference in New Issue
Block a user