diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-04-25 15:32:10 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-04-25 13:45:39 +0000 |
commit | c67dc5e8d483010b5a0cf5d35096fb0f366119c1 (patch) | |
tree | 4dff380efca72c0604fe59f20b7338501fac6d82 /src/plugins/diffeditor/diffeditorplugin.cpp | |
parent | fde32a206ba06f6025a77beb3ce6b7a4ce9c663d (diff) | |
download | qt-creator-c67dc5e8d483010b5a0cf5d35096fb0f366119c1.tar.gz |
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>
Diffstat (limited to 'src/plugins/diffeditor/diffeditorplugin.cpp')
-rw-r--r-- | src/plugins/diffeditor/diffeditorplugin.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 6ae5f816c3..eed5a6d0e4 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -13,12 +13,13 @@ #include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/editormanager/editormanager.h> +#include <extensionsystem/pluginmanager.h> + #include <texteditor/textdocument.h> #include <utils/asynctask.h> #include <utils/differ.h> #include <utils/fileutils.h> -#include <utils/futuresynchronizer.h> #include <utils/qtcassert.h> #include <QAction> @@ -114,8 +115,9 @@ DiffFilesController::DiffFilesController(IDocument *document) QList<std::optional<FileData>> *outputList = storage.activeStorage(); const auto setupDiff = [this](AsyncTask<FileData> &async, const ReloadInput &reloadInput) { - async.setConcurrentCallData(DiffFile(ignoreWhitespace(), contextLineCount()), reloadInput); - async.setFutureSynchronizer(Internal::DiffEditorPlugin::futureSynchronizer()); + async.setConcurrentCallData( + DiffFile(ignoreWhitespace(), contextLineCount()), reloadInput); + async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer()); }; const auto onDiffDone = [outputList](const AsyncTask<FileData> &async, int i) { if (async.isResultAvailable()) @@ -415,12 +417,10 @@ public: DiffEditorFactory m_editorFactory; DiffEditorServiceImpl m_service; - FutureSynchronizer m_futureSynchronizer; }; DiffEditorPluginPrivate::DiffEditorPluginPrivate() { - m_futureSynchronizer.setCancelOnWait(true); //register actions ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS); toolsContainer->insertGroup(Core::Constants::G_TOOLS_DEBUG, Constants::G_TOOLS_DIFF); @@ -535,12 +535,6 @@ void DiffEditorPlugin::initialize() d = new DiffEditorPluginPrivate; } -FutureSynchronizer *DiffEditorPlugin::futureSynchronizer() -{ - QTC_ASSERT(s_instance, return nullptr); - return &s_instance->d->m_futureSynchronizer; -} - } // namespace Internal } // namespace DiffEditor |