forked from qt-creator/qt-creator
TextEditor: Use QtConcurrent invocation for async run
Change-Id: I4b40e2e3591a9a74570e318e216c4ad74c01ca6b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
#include "assistinterface.h"
|
#include "assistinterface.h"
|
||||||
#include "iassistproposal.h"
|
#include "iassistproposal.h"
|
||||||
|
|
||||||
#include <utils/runextensions.h>
|
#include <utils/asynctask.h>
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ IAssistProposal *AsyncProcessor::perform()
|
|||||||
{
|
{
|
||||||
IAssistProposal *result = immediateProposal();
|
IAssistProposal *result = immediateProposal();
|
||||||
interface()->prepareForAsyncUse();
|
interface()->prepareForAsyncUse();
|
||||||
m_watcher.setFuture(Utils::runAsync([this] {
|
m_watcher.setFuture(Utils::asyncRun([this] {
|
||||||
interface()->recreateTextDocument();
|
interface()->recreateTextDocument();
|
||||||
return performAsync();
|
return performAsync();
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
|
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
|
|
||||||
|
#include <utils/asynctask.h>
|
||||||
#include <utils/differ.h>
|
#include <utils/differ.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/runextensions.h>
|
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
#include <utils/textutils.h>
|
#include <utils/textutils.h>
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ void formatEditorAsync(TextEditorWidget *editor, const Command &command, int sta
|
|||||||
checkAndApplyTask(watcher->result());
|
checkAndApplyTask(watcher->result());
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
});
|
});
|
||||||
watcher->setFuture(Utils::runAsync(&format, FormatTask(editor, doc->filePath(), sd,
|
watcher->setFuture(Utils::asyncRun(&format, FormatTask(editor, doc->filePath(), sd,
|
||||||
command, startPos, endPos)));
|
command, startPos, endPos)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user