diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 77092e343eb577dabc6fc09226e3c45129980b92..e4bedc5bd058905cebcfe5d42cec7fe24beb7eed 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -361,7 +361,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : this, SLOT(updateActions())); connect(this, SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(updateEditorHistory())); - m_d->m_splitter = new EditorSplitter(m_d->m_core); + m_d->m_splitter = new EditorSplitter; connect(m_d->m_splitter, SIGNAL(closeRequested(Core::IEditor *)), this, SLOT(closeEditor(Core::IEditor *))); connect(m_d->m_splitter, SIGNAL(editorGroupsChanged()), diff --git a/src/plugins/coreplugin/editormanager/editorsplitter.cpp b/src/plugins/coreplugin/editormanager/editorsplitter.cpp index 5ff9832ec02fe80203821de4e974008a4bb82434..0b02e14d73174e532e82eeb08d12d25a05a496a0 100644 --- a/src/plugins/coreplugin/editormanager/editorsplitter.cpp +++ b/src/plugins/coreplugin/editormanager/editorsplitter.cpp @@ -51,10 +51,9 @@ using namespace Core; using namespace Core::Internal; -EditorSplitter::EditorSplitter(ICore *core, QWidget *parent) +EditorSplitter::EditorSplitter(QWidget *parent) : QWidget(parent), - m_curGroup(0), - m_core(core) + m_curGroup(0) { registerActions(); createRootGroup(); @@ -69,9 +68,9 @@ void EditorSplitter::registerActions() { QList<int> gc = QList<int>() << Constants::C_GLOBAL_ID; const QList<int> editorManagerContext = - QList<int>() << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER); + QList<int>() << ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER); - ActionManager *am = m_core->actionManager(); + ActionManager *am = ICore::instance()->actionManager(); ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); Command *cmd; @@ -538,13 +537,13 @@ QWidget *EditorSplitter::recreateGroupTree(QWidget *node) void EditorSplitter::saveCurrentLayout() { - QSettings *settings = m_core->settings(); + QSettings *settings = ICore::instance()->settings(); settings->setValue("EditorManager/Splitting", saveState()); } void EditorSplitter::restoreDefaultLayout() { - QSettings *settings = m_core->settings(); + QSettings *settings = ICore::instance()->settings(); if (settings->contains("EditorManager/Splitting")) restoreState(settings->value("EditorManager/Splitting").toByteArray()); } @@ -656,12 +655,12 @@ EditorGroup *EditorSplitter::createGroup() this, SLOT(updateActions())); connect(group, SIGNAL(editorAdded(Core::IEditor *)), this, SLOT(updateActions())); - m_core->addContextObject(group->contextObject()); + ICore::instance()->addContextObject(group->contextObject()); return group; } void EditorSplitter::deleteGroup(EditorGroup *group) { - m_core->removeContextObject(group->contextObject()); + ICore::instance()->removeContextObject(group->contextObject()); delete group; } diff --git a/src/plugins/coreplugin/editormanager/editorsplitter.h b/src/plugins/coreplugin/editormanager/editorsplitter.h index 94aac2df2316d20e4f7d3e1a61255f3309a87b3c..aeff22a2ed3ed1d95ea72451e204f929d37f1b8e 100644 --- a/src/plugins/coreplugin/editormanager/editorsplitter.h +++ b/src/plugins/coreplugin/editormanager/editorsplitter.h @@ -45,7 +45,6 @@ namespace Core { class EditorGroup; -class ICore; class IEditor; namespace Internal { @@ -55,7 +54,7 @@ class EditorSplitter : public QWidget Q_OBJECT public: - EditorSplitter(ICore *core, QWidget *parent = 0); + explicit EditorSplitter(QWidget *parent = 0); ~EditorSplitter(); void setCurrentGroup(Core::EditorGroup *group); @@ -114,7 +113,6 @@ private: QWidget *m_root; EditorGroup *m_curGroup; - ICore *m_core; QAction *m_horizontalSplitAction; QAction *m_verticalSplitAction;