forked from qt-creator/qt-creator
Core: Replace ICoreListener by std::functions
ICoreListener::coreAboutToClose() remains in the core, ICoreListener::editorAboutToClose() is handled by a new EditorManager::addCloseEditorListener() function. This removes the need for some boiler plate code resulting from the need to implement the interface in custom classes (DesignModeCoreListener, EditorClosingCoreListener, PojectEplorer::CoreListener and VcsBase::CoreListener). EditorManager::addCloseEditorListener Change-Id: Ie554c987b5455b555be6d77b77e4013639201d22 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include "vcsplugin.h"
|
||||
#include "commonvcssettings.h"
|
||||
#include "vcsoutputwindow.h"
|
||||
#include "corelistener.h"
|
||||
#include "vcscommand.h"
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
@@ -567,7 +566,7 @@ void VcsBasePlugin::initializeVcs(IVersionControl *vc, const Context &context)
|
||||
addAutoReleasedObject(vc);
|
||||
|
||||
Internal::VcsPlugin *plugin = Internal::VcsPlugin::instance();
|
||||
connect(plugin->coreListener(), &Internal::CoreListener::submitEditorAboutToClose,
|
||||
connect(plugin, &Internal::VcsPlugin::submitEditorAboutToClose,
|
||||
this, &VcsBasePlugin::slotSubmitEditorAboutToClose);
|
||||
// First time: create new listener
|
||||
if (!VcsBasePluginPrivate::m_listener)
|
||||
|
||||
Reference in New Issue
Block a user