forked from qt-creator/qt-creator
FakeVim: Remove QtcProcess use from fakevimhandler.cpp
fakevimhandler.{h,cpp} are meant to be re-usable outside of Qt Creator.
Amends 91605c3.
Change-Id: I569a393d13049ef92ed3ef0c4f69de5232b2fa32
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
@@ -1887,6 +1887,18 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor)
|
||||
tew->invokeAssist(Completion, &runData->wordProvider);
|
||||
});
|
||||
|
||||
handler->processOutput.set([](const QString &command, const QString &input, QString *output) {
|
||||
QtcProcess proc;
|
||||
proc.setCommand(Utils::CommandLine::fromUserInput(command));
|
||||
proc.setWriteData(input.toLocal8Bit());
|
||||
proc.start();
|
||||
|
||||
// FIXME: Process should be interruptable by user.
|
||||
// Solution is to create a QObject for each process and emit finished state.
|
||||
proc.waitForFinished();
|
||||
*output = proc.cleanedStdOut();
|
||||
});
|
||||
|
||||
connect(ICore::instance(), &ICore::saveSettingsRequested,
|
||||
this, &FakeVimPluginPrivate::writeSettings);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user