forked from qt-creator/qt-creator
PythonEditor: Remove uses of global object pool
Change-Id: Iba9903ca994a0e9aef268685269789daf2b83183 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -571,16 +571,19 @@ void PythonRunConfigurationWidget::setInterpreter(const QString &interpreter)
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static PythonEditorPlugin *m_instance = 0;
|
class PythonEditorPluginPrivate
|
||||||
|
|
||||||
PythonEditorPlugin::PythonEditorPlugin()
|
|
||||||
{
|
{
|
||||||
m_instance = this;
|
public:
|
||||||
}
|
PythonEditorFactory editorFactory;
|
||||||
|
PythonRunConfigurationFactory runConfigFactory;
|
||||||
|
};
|
||||||
|
|
||||||
|
static PythonEditorPluginPrivate *dd = nullptr;
|
||||||
|
|
||||||
PythonEditorPlugin::~PythonEditorPlugin()
|
PythonEditorPlugin::~PythonEditorPlugin()
|
||||||
{
|
{
|
||||||
m_instance = 0;
|
delete dd;
|
||||||
|
dd = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
@@ -588,10 +591,9 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
|
|||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
|
|
||||||
ProjectManager::registerProjectType<PythonProject>(PythonMimeType);
|
dd = new PythonEditorPluginPrivate;
|
||||||
|
|
||||||
addAutoReleasedObject(new PythonEditorFactory);
|
ProjectManager::registerProjectType<PythonProject>(PythonMimeType);
|
||||||
addAutoReleasedObject(new PythonRunConfigurationFactory);
|
|
||||||
|
|
||||||
auto constraint = [](RunConfiguration *runConfiguration) {
|
auto constraint = [](RunConfiguration *runConfiguration) {
|
||||||
auto rc = dynamic_cast<PythonRunConfiguration *>(runConfiguration);
|
auto rc = dynamic_cast<PythonRunConfiguration *>(runConfiguration);
|
||||||
|
@@ -36,7 +36,7 @@ class PythonEditorPlugin : public ExtensionSystem::IPlugin
|
|||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "PythonEditor.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "PythonEditor.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PythonEditorPlugin();
|
PythonEditorPlugin() = default;
|
||||||
~PythonEditorPlugin() override;
|
~PythonEditorPlugin() override;
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage) override;
|
bool initialize(const QStringList &arguments, QString *errorMessage) override;
|
||||||
|
Reference in New Issue
Block a user