forked from qt-creator/qt-creator
All Plugins: Use global future synchronizer
Instead of using plugin's own synchronizers. The global synchronizer does the synchronization just before all the plugins' destructors run (in sync), so this should be the right equivalent. Change-Id: I8d09c9ea4a11b7a703684ad5319191ce310d992e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -313,12 +313,6 @@ QObject *CorePlugin::remoteCommand(const QStringList & /* options */,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *CorePlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(m_instance, return nullptr);
|
|
||||||
return &m_instance->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
Environment CorePlugin::startupSystemEnvironment()
|
Environment CorePlugin::startupSystemEnvironment()
|
||||||
{
|
{
|
||||||
return m_instance->m_startupSystemEnvironment;
|
return m_instance->m_startupSystemEnvironment;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QMenu;
|
class QMenu;
|
||||||
@@ -47,7 +46,6 @@ public:
|
|||||||
const QString &workingDirectory,
|
const QString &workingDirectory,
|
||||||
const QStringList &args) override;
|
const QStringList &args) override;
|
||||||
|
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
static Utils::Environment startupSystemEnvironment();
|
static Utils::Environment startupSystemEnvironment();
|
||||||
static Utils::EnvironmentItems environmentChanges();
|
static Utils::EnvironmentItems environmentChanges();
|
||||||
static void setEnvironmentChanges(const Utils::EnvironmentItems &changes);
|
static void setEnvironmentChanges(const Utils::EnvironmentItems &changes);
|
||||||
@@ -79,7 +77,6 @@ private:
|
|||||||
FolderNavigationWidgetFactory *m_folderNavigationWidgetFactory = nullptr;
|
FolderNavigationWidgetFactory *m_folderNavigationWidgetFactory = nullptr;
|
||||||
Utils::Environment m_startupSystemEnvironment;
|
Utils::Environment m_startupSystemEnvironment;
|
||||||
Utils::EnvironmentItems m_environmentChanges;
|
Utils::EnvironmentItems m_environmentChanges;
|
||||||
Utils::FutureSynchronizer m_futureSynchronizer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
|
|
||||||
#include "filesystemfilter.h"
|
#include "filesystemfilter.h"
|
||||||
|
|
||||||
#include "../coreplugin.h"
|
|
||||||
#include "../coreplugintr.h"
|
#include "../coreplugintr.h"
|
||||||
#include "../documentmanager.h"
|
#include "../documentmanager.h"
|
||||||
#include "../editormanager/editormanager.h"
|
#include "../editormanager/editormanager.h"
|
||||||
#include "../icore.h"
|
#include "../icore.h"
|
||||||
#include "../vcsmanager.h"
|
#include "../vcsmanager.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
@@ -273,7 +274,7 @@ LocatorMatcherTasks FileSystemFilter::matchers()
|
|||||||
TreeStorage<LocatorStorage> storage;
|
TreeStorage<LocatorStorage> storage;
|
||||||
|
|
||||||
const auto onSetup = [this, storage](AsyncTask<void> &async) {
|
const auto onSetup = [this, storage](AsyncTask<void> &async) {
|
||||||
async.setFutureSynchronizer(CorePlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(matches,
|
async.setConcurrentCallData(matches,
|
||||||
*storage,
|
*storage,
|
||||||
shortcutString(),
|
shortcutString(),
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#include "ilocatorfilter.h"
|
#include "ilocatorfilter.h"
|
||||||
|
|
||||||
#include "../coreplugin.h"
|
|
||||||
#include "../coreplugintr.h"
|
#include "../coreplugintr.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/fuzzymatcher.h>
|
#include <utils/fuzzymatcher.h>
|
||||||
#include <utils/tasktree.h>
|
#include <utils/tasktree.h>
|
||||||
@@ -273,7 +274,7 @@ ResultsCollector::~ResultsCollector()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_deduplicator->cancel();
|
m_deduplicator->cancel();
|
||||||
Internal::CorePlugin::futureSynchronizer()->addFuture(m_watcher->future());
|
ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(m_watcher->future());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResultsCollector::setFilterCount(int count)
|
void ResultsCollector::setFilterCount(int count)
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#include "opendocumentsfilter.h"
|
#include "opendocumentsfilter.h"
|
||||||
|
|
||||||
#include "../coreplugin.h"
|
|
||||||
#include "../coreplugintr.h"
|
#include "../coreplugintr.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
@@ -81,7 +82,7 @@ LocatorMatcherTasks OpenDocumentsFilter::matchers()
|
|||||||
const auto onSetup = [storage](AsyncTask<void> &async) {
|
const auto onSetup = [storage](AsyncTask<void> &async) {
|
||||||
const QList<Entry> editorsData = Utils::transform(DocumentModel::entries(),
|
const QList<Entry> editorsData = Utils::transform(DocumentModel::entries(),
|
||||||
[](const DocumentModel::Entry *e) { return Entry{e->filePath(), e->displayName()}; });
|
[](const DocumentModel::Entry *e) { return Entry{e->filePath(), e->displayName()}; });
|
||||||
async.setFutureSynchronizer(CorePlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(matchEditors, *storage, editorsData);
|
async.setConcurrentCallData(matchEditors, *storage, editorsData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,6 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/fsengine/fileiconprovider.h>
|
#include <utils/fsengine/fileiconprovider.h>
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
#include <utils/mimeutils.h>
|
#include <utils/mimeutils.h>
|
||||||
@@ -199,7 +198,6 @@ public:
|
|||||||
ClangdSettingsPage *m_clangdSettingsPage = nullptr;
|
ClangdSettingsPage *m_clangdSettingsPage = nullptr;
|
||||||
CppCodeStyleSettingsPage m_cppCodeStyleSettingsPage;
|
CppCodeStyleSettingsPage m_cppCodeStyleSettingsPage;
|
||||||
CppProjectUpdaterFactory m_cppProjectUpdaterFactory;
|
CppProjectUpdaterFactory m_cppProjectUpdaterFactory;
|
||||||
FutureSynchronizer m_futureSynchronizer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static CppEditorPlugin *m_instance = nullptr;
|
static CppEditorPlugin *m_instance = nullptr;
|
||||||
@@ -633,12 +631,6 @@ bool CppEditorPlugin::usePragmaOnce()
|
|||||||
return m_instance->d->m_fileSettings.headerPragmaOnce;
|
return m_instance->d->m_fileSettings.headerPragmaOnce;
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *CppEditorPlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(m_instance, return nullptr);
|
|
||||||
return &m_instance->d->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QStringList &CppEditorPlugin::headerSearchPaths()
|
const QStringList &CppEditorPlugin::headerSearchPaths()
|
||||||
{
|
{
|
||||||
return m_instance->d->m_fileSettings.headerSearchPaths;
|
return m_instance->d->m_fileSettings.headerSearchPaths;
|
||||||
|
|||||||
@@ -5,10 +5,7 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils { class FilePath; }
|
||||||
class FilePath;
|
|
||||||
class FutureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
class CppCodeModelSettings;
|
class CppCodeModelSettings;
|
||||||
@@ -40,7 +37,6 @@ public:
|
|||||||
static Utils::FilePath licenseTemplatePath();
|
static Utils::FilePath licenseTemplatePath();
|
||||||
static QString licenseTemplate();
|
static QString licenseTemplate();
|
||||||
static bool usePragmaOnce();
|
static bool usePragmaOnce();
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
|
|
||||||
void openDeclarationDefinitionInNextSplit();
|
void openDeclarationDefinitionInNextSplit();
|
||||||
void openTypeHierarchy();
|
void openTypeHierarchy();
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/fuzzymatcher.h>
|
#include <utils/fuzzymatcher.h>
|
||||||
@@ -107,7 +109,7 @@ LocatorMatcherTask locatorMatcher(IndexItem::ItemType type, const EntryFromIndex
|
|||||||
TreeStorage<LocatorStorage> storage;
|
TreeStorage<LocatorStorage> storage;
|
||||||
|
|
||||||
const auto onSetup = [=](AsyncTask<void> &async) {
|
const auto onSetup = [=](AsyncTask<void> &async) {
|
||||||
async.setFutureSynchronizer(Internal::CppEditorPlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(matchesFor, *storage, type, converter);
|
async.setConcurrentCallData(matchesFor, *storage, type, converter);
|
||||||
};
|
};
|
||||||
return {Async<void>(onSetup), storage};
|
return {Async<void>(onSetup), storage};
|
||||||
@@ -303,7 +305,7 @@ LocatorMatcherTask currentDocumentMatcher()
|
|||||||
TreeStorage<LocatorStorage> storage;
|
TreeStorage<LocatorStorage> storage;
|
||||||
|
|
||||||
const auto onSetup = [=](AsyncTask<void> &async) {
|
const auto onSetup = [=](AsyncTask<void> &async) {
|
||||||
async.setFutureSynchronizer(Internal::CppEditorPlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(matchesForCurrentDocument, *storage, currentFileName());
|
async.setConcurrentCallData(matchesForCurrentDocument, *storage, currentFileName());
|
||||||
};
|
};
|
||||||
return {Async<void>(onSetup), storage};
|
return {Async<void>(onSetup), storage};
|
||||||
|
|||||||
@@ -13,12 +13,13 @@
|
|||||||
#include <coreplugin/editormanager/documentmodel.h>
|
#include <coreplugin/editormanager/documentmodel.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/differ.h>
|
#include <utils/differ.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@@ -114,8 +115,9 @@ DiffFilesController::DiffFilesController(IDocument *document)
|
|||||||
QList<std::optional<FileData>> *outputList = storage.activeStorage();
|
QList<std::optional<FileData>> *outputList = storage.activeStorage();
|
||||||
|
|
||||||
const auto setupDiff = [this](AsyncTask<FileData> &async, const ReloadInput &reloadInput) {
|
const auto setupDiff = [this](AsyncTask<FileData> &async, const ReloadInput &reloadInput) {
|
||||||
async.setConcurrentCallData(DiffFile(ignoreWhitespace(), contextLineCount()), reloadInput);
|
async.setConcurrentCallData(
|
||||||
async.setFutureSynchronizer(Internal::DiffEditorPlugin::futureSynchronizer());
|
DiffFile(ignoreWhitespace(), contextLineCount()), reloadInput);
|
||||||
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
};
|
};
|
||||||
const auto onDiffDone = [outputList](const AsyncTask<FileData> &async, int i) {
|
const auto onDiffDone = [outputList](const AsyncTask<FileData> &async, int i) {
|
||||||
if (async.isResultAvailable())
|
if (async.isResultAvailable())
|
||||||
@@ -415,12 +417,10 @@ public:
|
|||||||
|
|
||||||
DiffEditorFactory m_editorFactory;
|
DiffEditorFactory m_editorFactory;
|
||||||
DiffEditorServiceImpl m_service;
|
DiffEditorServiceImpl m_service;
|
||||||
FutureSynchronizer m_futureSynchronizer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DiffEditorPluginPrivate::DiffEditorPluginPrivate()
|
DiffEditorPluginPrivate::DiffEditorPluginPrivate()
|
||||||
{
|
{
|
||||||
m_futureSynchronizer.setCancelOnWait(true);
|
|
||||||
//register actions
|
//register actions
|
||||||
ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||||
toolsContainer->insertGroup(Core::Constants::G_TOOLS_DEBUG, Constants::G_TOOLS_DIFF);
|
toolsContainer->insertGroup(Core::Constants::G_TOOLS_DEBUG, Constants::G_TOOLS_DIFF);
|
||||||
@@ -535,12 +535,6 @@ void DiffEditorPlugin::initialize()
|
|||||||
d = new DiffEditorPluginPrivate;
|
d = new DiffEditorPluginPrivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *DiffEditorPlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(s_instance, return nullptr);
|
|
||||||
return &s_instance->d->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace DiffEditor
|
} // namespace DiffEditor
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
#include <coreplugin/diffservice.h>
|
#include <coreplugin/diffservice.h>
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace Utils { class FutureSynchronizer; }
|
|
||||||
|
|
||||||
namespace DiffEditor {
|
namespace DiffEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -34,8 +32,6 @@ public:
|
|||||||
|
|
||||||
void initialize() final;
|
void initialize() final;
|
||||||
|
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class DiffEditorPluginPrivate *d = nullptr;
|
class DiffEditorPluginPrivate *d = nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "diffeditorconstants.h"
|
#include "diffeditorconstants.h"
|
||||||
#include "diffeditordocument.h"
|
#include "diffeditordocument.h"
|
||||||
#include "diffeditorplugin.h"
|
|
||||||
#include "diffeditortr.h"
|
#include "diffeditortr.h"
|
||||||
|
|
||||||
#include <coreplugin/find/highlightscrollbarcontroller.h>
|
#include <coreplugin/find/highlightscrollbarcontroller.h>
|
||||||
@@ -13,6 +12,8 @@
|
|||||||
#include <coreplugin/minisplitter.h>
|
#include <coreplugin/minisplitter.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <texteditor/displaysettings.h>
|
#include <texteditor/displaysettings.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
@@ -869,7 +870,7 @@ void SideBySideDiffEditorWidget::restoreState()
|
|||||||
void SideBySideDiffEditorWidget::showDiff()
|
void SideBySideDiffEditorWidget::showDiff()
|
||||||
{
|
{
|
||||||
m_asyncTask.reset(new AsyncTask<SideBySideShowResults>());
|
m_asyncTask.reset(new AsyncTask<SideBySideShowResults>());
|
||||||
m_asyncTask->setFutureSynchronizer(DiffEditorPlugin::futureSynchronizer());
|
m_asyncTask->setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
m_controller.setBusyShowing(true);
|
m_controller.setBusyShowing(true);
|
||||||
|
|
||||||
connect(m_asyncTask.get(), &AsyncTaskBase::done, this, [this] {
|
connect(m_asyncTask.get(), &AsyncTaskBase::done, this, [this] {
|
||||||
|
|||||||
@@ -5,12 +5,13 @@
|
|||||||
|
|
||||||
#include "diffeditorconstants.h"
|
#include "diffeditorconstants.h"
|
||||||
#include "diffeditordocument.h"
|
#include "diffeditordocument.h"
|
||||||
#include "diffeditorplugin.h"
|
|
||||||
#include "diffeditortr.h"
|
#include "diffeditortr.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
@@ -452,7 +453,7 @@ void UnifiedDiffEditorWidget::showDiff()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_asyncTask.reset(new AsyncTask<UnifiedShowResult>());
|
m_asyncTask.reset(new AsyncTask<UnifiedShowResult>());
|
||||||
m_asyncTask->setFutureSynchronizer(DiffEditorPlugin::futureSynchronizer());
|
m_asyncTask->setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
m_controller.setBusyShowing(true);
|
m_controller.setBusyShowing(true);
|
||||||
connect(m_asyncTask.get(), &AsyncTaskBase::done, this, [this] {
|
connect(m_asyncTask.get(), &AsyncTaskBase::done, this, [this] {
|
||||||
if (m_asyncTask->isCanceled() || !m_asyncTask->isResultAvailable()) {
|
if (m_asyncTask->isCanceled() || !m_asyncTask->isResultAvailable()) {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ LocatorMatcherTasks HelpIndexFilter::matchers()
|
|||||||
}
|
}
|
||||||
const QStringList cache = m_lastEntry.isEmpty() || !storage->input().contains(m_lastEntry)
|
const QStringList cache = m_lastEntry.isEmpty() || !storage->input().contains(m_lastEntry)
|
||||||
? m_allIndicesCache : m_lastIndicesCache;
|
? m_allIndicesCache : m_lastIndicesCache;
|
||||||
async.setFutureSynchronizer(HelpPlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(matches, *storage, cache, m_icon);
|
async.setConcurrentCallData(matches, *storage, cache, m_icon);
|
||||||
};
|
};
|
||||||
const auto onDone = [this, storage](const AsyncTask<QStringList> &async) {
|
const auto onDone = [this, storage](const AsyncTask<QStringList> &async) {
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
@@ -143,7 +142,6 @@ public:
|
|||||||
LocalHelpManager m_localHelpManager;
|
LocalHelpManager m_localHelpManager;
|
||||||
|
|
||||||
HelpIndexFilter helpIndexFilter;
|
HelpIndexFilter helpIndexFilter;
|
||||||
FutureSynchronizer m_futureSynchronizer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static HelpPluginPrivate *dd = nullptr;
|
static HelpPluginPrivate *dd = nullptr;
|
||||||
@@ -397,12 +395,6 @@ HelpWidget *HelpPlugin::modeHelpWidget()
|
|||||||
return dd->m_centralWidget;
|
return dd->m_centralWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *HelpPlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(dd, return nullptr);
|
|
||||||
return &dd->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HelpPluginPrivate::showLinksInCurrentViewer(const QMultiMap<QString, QUrl> &links, const QString &key)
|
void HelpPluginPrivate::showLinksInCurrentViewer(const QMultiMap<QString, QUrl> &links, const QString &key)
|
||||||
{
|
{
|
||||||
if (links.size() < 1)
|
if (links.size() < 1)
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QUrl;
|
class QUrl;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils { class FutureSynchronizer; }
|
|
||||||
|
|
||||||
namespace Help {
|
namespace Help {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -32,7 +30,6 @@ public:
|
|||||||
const QString &key);
|
const QString &key);
|
||||||
static HelpViewer *createHelpViewer();
|
static HelpViewer *createHelpViewer();
|
||||||
static HelpWidget *modeHelpWidget();
|
static HelpWidget *modeHelpWidget();
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialize() final;
|
void initialize() final;
|
||||||
|
|||||||
@@ -33,12 +33,6 @@ LanguageClientPlugin *LanguageClientPlugin::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FutureSynchronizer *LanguageClientPlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(m_instance, return nullptr);
|
|
||||||
return &m_instance->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LanguageClientPlugin::initialize()
|
void LanguageClientPlugin::initialize()
|
||||||
{
|
{
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
|
|
||||||
namespace LanguageClient {
|
namespace LanguageClient {
|
||||||
|
|
||||||
class LanguageClientPlugin : public ExtensionSystem::IPlugin
|
class LanguageClientPlugin : public ExtensionSystem::IPlugin
|
||||||
@@ -21,7 +19,6 @@ public:
|
|||||||
~LanguageClientPlugin() override;
|
~LanguageClientPlugin() override;
|
||||||
|
|
||||||
static LanguageClientPlugin *instance();
|
static LanguageClientPlugin *instance();
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
|
|
||||||
// IPlugin interface
|
// IPlugin interface
|
||||||
private:
|
private:
|
||||||
@@ -32,7 +29,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
LanguageClientOutlineWidgetFactory m_outlineFactory;
|
LanguageClientOutlineWidgetFactory m_outlineFactory;
|
||||||
CallHierarchyFactory m_callHierarchyFactory;
|
CallHierarchyFactory m_callHierarchyFactory;
|
||||||
Utils::FutureSynchronizer m_futureSynchronizer;
|
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
#include "documentsymbolcache.h"
|
#include "documentsymbolcache.h"
|
||||||
#include "languageclient_global.h"
|
#include "languageclient_global.h"
|
||||||
#include "languageclientmanager.h"
|
#include "languageclientmanager.h"
|
||||||
#include "languageclientplugin.h"
|
|
||||||
#include "languageclienttr.h"
|
#include "languageclienttr.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <languageserverprotocol/lsptypes.h>
|
#include <languageserverprotocol/lsptypes.h>
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
@@ -78,7 +79,7 @@ LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount,
|
|||||||
const QList<SymbolInformation> results = *resultStorage;
|
const QList<SymbolInformation> results = *resultStorage;
|
||||||
if (results.isEmpty())
|
if (results.isEmpty())
|
||||||
return TaskAction::StopWithDone;
|
return TaskAction::StopWithDone;
|
||||||
async.setFutureSynchronizer(LanguageClientPlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(filterResults, *storage, client, results, filter);
|
async.setConcurrentCallData(filterResults, *storage, client, results, filter);
|
||||||
return TaskAction::Continue;
|
return TaskAction::Continue;
|
||||||
};
|
};
|
||||||
@@ -138,7 +139,7 @@ LocatorMatcherTask currentDocumentMatcher()
|
|||||||
};
|
};
|
||||||
|
|
||||||
const auto onFilterSetup = [=](AsyncTask<void> &async) {
|
const auto onFilterSetup = [=](AsyncTask<void> &async) {
|
||||||
async.setFutureSynchronizer(LanguageClientPlugin::futureSynchronizer());
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(filterCurrentResults, *storage, *resultStorage);
|
async.setConcurrentCallData(filterCurrentResults, *storage, *resultStorage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/expected.h>
|
#include <utils/expected.h>
|
||||||
#include <utils/guard.h>
|
#include <utils/guard.h>
|
||||||
@@ -45,7 +47,6 @@ public:
|
|||||||
|
|
||||||
QTimer timer;
|
QTimer timer;
|
||||||
|
|
||||||
FutureSynchronizer m_futureSynchronizer;
|
|
||||||
std::unique_ptr<TaskTree> m_taskTree;
|
std::unique_ptr<TaskTree> m_taskTree;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -291,11 +292,6 @@ Environment ExtraCompiler::buildEnvironment() const
|
|||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *ExtraCompiler::futureSynchronizer() const
|
|
||||||
{
|
|
||||||
return &d->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExtraCompiler::setContent(const FilePath &file, const QByteArray &contents)
|
void ExtraCompiler::setContent(const FilePath &file, const QByteArray &contents)
|
||||||
{
|
{
|
||||||
qCDebug(log).noquote() << Q_FUNC_INFO << contents;
|
qCDebug(log).noquote() << Q_FUNC_INFO << contents;
|
||||||
@@ -333,9 +329,9 @@ Tasking::TaskItem ProcessExtraCompiler::taskItemImpl(const ContentProvider &prov
|
|||||||
{
|
{
|
||||||
const auto setupTask = [=](AsyncTask<FileNameToContentsHash> &async) {
|
const auto setupTask = [=](AsyncTask<FileNameToContentsHash> &async) {
|
||||||
async.setThreadPool(extraCompilerThreadPool());
|
async.setThreadPool(extraCompilerThreadPool());
|
||||||
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(&ProcessExtraCompiler::runInThread, this, command(),
|
async.setConcurrentCallData(&ProcessExtraCompiler::runInThread, this, command(),
|
||||||
workingDirectory(), arguments(), provider, buildEnvironment());
|
workingDirectory(), arguments(), provider, buildEnvironment());
|
||||||
async.setFutureSynchronizer(futureSynchronizer());
|
|
||||||
};
|
};
|
||||||
const auto taskDone = [=](const AsyncTask<FileNameToContentsHash> &async) {
|
const auto taskDone = [=](const AsyncTask<FileNameToContentsHash> &async) {
|
||||||
if (!async.isResultAvailable())
|
if (!async.isResultAvailable())
|
||||||
|
|||||||
@@ -25,10 +25,7 @@ class QPromise;
|
|||||||
class QThreadPool;
|
class QThreadPool;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils { class QtcProcess; }
|
||||||
class FutureSynchronizer;
|
|
||||||
class QtcProcess;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
@@ -64,7 +61,6 @@ signals:
|
|||||||
protected:
|
protected:
|
||||||
static QThreadPool *extraCompilerThreadPool();
|
static QThreadPool *extraCompilerThreadPool();
|
||||||
|
|
||||||
Utils::FutureSynchronizer *futureSynchronizer() const;
|
|
||||||
void setContent(const Utils::FilePath &file, const QByteArray &content);
|
void setContent(const Utils::FilePath &file, const QByteArray &content);
|
||||||
void updateCompileTime();
|
void updateCompileTime();
|
||||||
Utils::Environment buildEnvironment() const;
|
Utils::Environment buildEnvironment() const;
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
|
|
||||||
#include <utils/fsengine/fileiconprovider.h>
|
#include <utils/fsengine/fileiconprovider.h>
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -38,7 +37,6 @@ public:
|
|||||||
PySideBuildConfigurationFactory buildConfigFactory;
|
PySideBuildConfigurationFactory buildConfigFactory;
|
||||||
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
||||||
PythonSettings settings;
|
PythonSettings settings;
|
||||||
FutureSynchronizer m_futureSynchronizer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PythonPlugin::PythonPlugin()
|
PythonPlugin::PythonPlugin()
|
||||||
@@ -57,12 +55,6 @@ PythonPlugin *PythonPlugin::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *PythonPlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(m_instance, return nullptr);
|
|
||||||
return &m_instance->d->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PythonPlugin::initialize()
|
void PythonPlugin::initialize()
|
||||||
{
|
{
|
||||||
d = new PythonPluginPrivate;
|
d = new PythonPluginPrivate;
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace Utils { class FutureSynchronizer; }
|
|
||||||
|
|
||||||
namespace Python::Internal {
|
namespace Python::Internal {
|
||||||
|
|
||||||
class PythonPlugin final : public ExtensionSystem::IPlugin
|
class PythonPlugin final : public ExtensionSystem::IPlugin
|
||||||
@@ -19,7 +17,6 @@ public:
|
|||||||
~PythonPlugin() final;
|
~PythonPlugin() final;
|
||||||
|
|
||||||
static PythonPlugin *instance();
|
static PythonPlugin *instance();
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialize() final;
|
void initialize() final;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "pysideuicextracompiler.h"
|
#include "pysideuicextracompiler.h"
|
||||||
#include "pythonconstants.h"
|
#include "pythonconstants.h"
|
||||||
#include "pythonlanguageclient.h"
|
#include "pythonlanguageclient.h"
|
||||||
#include "pythonplugin.h"
|
|
||||||
#include "pythonproject.h"
|
#include "pythonproject.h"
|
||||||
#include "pythonsettings.h"
|
#include "pythonsettings.h"
|
||||||
#include "pythontr.h"
|
#include "pythontr.h"
|
||||||
@@ -17,6 +16,8 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <languageclient/languageclientmanager.h>
|
#include <languageclient/languageclientmanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
@@ -248,7 +249,7 @@ void PythonRunConfigurationPrivate::checkForPySide(const FilePath &python,
|
|||||||
});
|
});
|
||||||
const auto future = Pip::instance(python)->info(package);
|
const auto future = Pip::instance(python)->info(package);
|
||||||
m_watcher.setFuture(future);
|
m_watcher.setFuture(future);
|
||||||
PythonPlugin::futureSynchronizer()->addFuture(future);
|
ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(future);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PythonRunConfigurationPrivate::handlePySidePackageInfo(const PipPackageInfo &pySideInfo,
|
void PythonRunConfigurationPrivate::handlePySidePackageInfo(const PipPackageInfo &pySideInfo,
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "vcsbasediffeditorcontroller.h"
|
#include "vcsbasediffeditorcontroller.h"
|
||||||
#include "vcsplugin.h"
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/asynctask.h>
|
#include <utils/asynctask.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -52,8 +53,8 @@ Tasking::TaskItem VcsBaseDiffEditorController::postProcessTask()
|
|||||||
QTC_ASSERT(storage, qWarning("Using postProcessTask() requires putting inputStorage() "
|
QTC_ASSERT(storage, qWarning("Using postProcessTask() requires putting inputStorage() "
|
||||||
"into task tree's root group."));
|
"into task tree's root group."));
|
||||||
const QString inputData = storage ? *storage : QString();
|
const QString inputData = storage ? *storage : QString();
|
||||||
|
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
|
||||||
async.setConcurrentCallData(&DiffUtils::readPatchWithPromise, inputData);
|
async.setConcurrentCallData(&DiffUtils::readPatchWithPromise, inputData);
|
||||||
async.setFutureSynchronizer(Internal::VcsPlugin::futureSynchronizer());
|
|
||||||
};
|
};
|
||||||
const auto onDiffProcessorDone = [this](const AsyncTask<QList<FileData>> &async) {
|
const auto onDiffProcessorDone = [this](const AsyncTask<QList<FileData>> &async) {
|
||||||
setDiffFiles(async.isResultAvailable() ? async.result() : QList<FileData>());
|
setDiffFiles(async.isResultAvailable() ? async.result() : QList<FileData>());
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projecttree.h>
|
#include <projectexplorer/projecttree.h>
|
||||||
|
|
||||||
#include <utils/futuresynchronizer.h>
|
|
||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -41,7 +40,6 @@ class VcsPluginPrivate
|
|||||||
public:
|
public:
|
||||||
CommonOptionsPage m_settingsPage;
|
CommonOptionsPage m_settingsPage;
|
||||||
QStandardItemModel *m_nickNameModel = nullptr;
|
QStandardItemModel *m_nickNameModel = nullptr;
|
||||||
FutureSynchronizer m_futureSynchronizer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static VcsPlugin *m_instance = nullptr;
|
static VcsPlugin *m_instance = nullptr;
|
||||||
@@ -123,12 +121,6 @@ CommonVcsSettings &VcsPlugin::settings() const
|
|||||||
return d->m_settingsPage.settings();
|
return d->m_settingsPage.settings();
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureSynchronizer *VcsPlugin::futureSynchronizer()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(m_instance, return nullptr);
|
|
||||||
return &m_instance->d->m_futureSynchronizer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Delayed creation/update of the nick name model. */
|
/* Delayed creation/update of the nick name model. */
|
||||||
QStandardItemModel *VcsPlugin::nickNameModel()
|
QStandardItemModel *VcsPlugin::nickNameModel()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils { class FutureSynchronizer; }
|
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
|
|
||||||
class VcsBaseSubmitEditor;
|
class VcsBaseSubmitEditor;
|
||||||
@@ -36,8 +34,6 @@ public:
|
|||||||
|
|
||||||
CommonVcsSettings &settings() const;
|
CommonVcsSettings &settings() const;
|
||||||
|
|
||||||
static Utils::FutureSynchronizer *futureSynchronizer();
|
|
||||||
|
|
||||||
// Model of user nick names used for the submit
|
// Model of user nick names used for the submit
|
||||||
// editor. Stored centrally here to achieve delayed
|
// editor. Stored centrally here to achieve delayed
|
||||||
// initialization and updating on settings change.
|
// initialization and updating on settings change.
|
||||||
|
|||||||
Reference in New Issue
Block a user