Debugger: Remove use of IPlugin::{add,remove}Object

The functions are about to be removed.

After cf7f898 the mode does not have to be in the global
pool at all, the plugin needs to stay there as it is used
for soft dependencies, but use direct insert/removal now.

Change-Id: I6497c3ea9fb68fdfa488e8c8700e31d91e36858f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-01-26 12:26:43 +01:00
parent 5250959bd9
commit 2052d6fc03

View File

@@ -84,6 +84,8 @@
#include <coreplugin/outputpane.h> #include <coreplugin/outputpane.h>
#include <coreplugin/rightpane.h> #include <coreplugin/rightpane.h>
#include <extensionsystem/pluginmanager.h>
#include <cppeditor/cppeditorconstants.h> #include <cppeditor/cppeditorconstants.h>
#include <qmljseditor/qmljseditorconstants.h> #include <qmljseditor/qmljseditorconstants.h>
#include <cpptools/cppmodelmanager.h> #include <cpptools/cppmodelmanager.h>
@@ -1725,9 +1727,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
m_plugin->addAutoReleasedObject(new DebugModeContext(m_modeWindow)); m_plugin->addAutoReleasedObject(new DebugModeContext(m_modeWindow));
m_plugin->addObject(m_mode);
connect(SessionManager::instance(), &SessionManager::startupProjectChanged, connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
this, &DebuggerPluginPrivate::updateUiForProject); this, &DebuggerPluginPrivate::updateUiForProject);
@@ -3100,13 +3099,6 @@ void DebuggerPluginPrivate::doShutdown()
delete m_mainWindow; delete m_mainWindow;
m_mainWindow = 0; m_mainWindow = 0;
// removeObject leads to aboutToRemoveObject, which leads to
// ModeManager::aboutToRemove, which leads to the mode manager
// removing the mode's widget from the stackwidget
// (currently by index, but possibly the stackwidget resets the
// parent and stuff on the widget)
m_plugin->removeObject(m_mode);
delete m_modeWindow; delete m_modeWindow;
m_modeWindow = 0; m_modeWindow = 0;
@@ -3254,7 +3246,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
{ {
dd = new DebuggerPluginPrivate(this); dd = new DebuggerPluginPrivate(this);
addObject(this); // Needed for call from AppOutputPane::attachToRunControl() and GammarayIntegration.
ExtensionSystem::PluginManager::addObject(this);
// Menu groups // Menu groups
ActionContainer *mstart = ActionManager::actionContainer(PE::M_DEBUG_STARTDEBUGGING); ActionContainer *mstart = ActionManager::actionContainer(PE::M_DEBUG_STARTDEBUGGING);
mstart->appendGroup(Constants::G_GENERAL); mstart->appendGroup(Constants::G_GENERAL);
@@ -3278,7 +3272,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown() IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown()
{ {
removeObject(this); ExtensionSystem::PluginManager::removeObject(this);
dd->aboutToShutdown(); dd->aboutToShutdown();
return AsynchronousShutdown; return AsynchronousShutdown;
} }