summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/coreplugin.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-01-23 10:33:18 +0100
committerhjk <hjk@qt.io>2018-01-23 13:08:37 +0000
commita5935cb27a0609764586302bf109796d74060f3d (patch)
treec547a32a33804ae0d5f0c68be87d718cd1d610c3 /src/plugins/coreplugin/coreplugin.cpp
parent33184a1e299e9fa7ed4c6a9af422bd8245e630e7 (diff)
downloadqt-creator-a5935cb27a0609764586302bf109796d74060f3d.tar.gz
DesignMode: Create only when needed
Postpone the Mode object creation until it is really necessary, the private data object may be needed before. In the QmlDesigner this patch moves the connection to the DesignMode instance back to delayedInitialize, essentially reverting part of e8b3b8140bd5d. Change-Id: I07146b0bc93eede09af8e824e916edb6de1817ef Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/coreplugin.cpp')
-rw-r--r--src/plugins/coreplugin/coreplugin.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index 379e198d13..7e7d05cfaa 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -71,7 +71,6 @@ using namespace Utils;
CorePlugin::CorePlugin()
: m_mainWindow(0)
, m_editMode(0)
- , m_designMode(0)
, m_locator(0)
{
qRegisterMetaType<Id>();
@@ -90,11 +89,7 @@ CorePlugin::~CorePlugin()
delete m_editMode;
}
- if (m_designMode) {
- if (DesignMode::designModeIsRequired())
- removeObject(m_designMode);
- delete m_designMode;
- }
+ DesignMode::destroyModeIfRequired();
delete m_mainWindow;
setCreatorTheme(0);
@@ -159,7 +154,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_editMode = new EditMode;
addObject(m_editMode);
ModeManager::activateMode(m_editMode->id());
- m_designMode = new DesignMode;
InfoBar::initialize(ICore::settings(), creatorTheme());
}
@@ -226,8 +220,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
void CorePlugin::extensionsInitialized()
{
- if (DesignMode::designModeIsRequired())
- addObject(m_designMode);
+ DesignMode::createModeIfRequired();
Find::extensionsInitialized();
m_locator->extensionsInitialized();
m_mainWindow->extensionsInitialized();