forked from qt-creator/qt-creator
Fixes: coreplugin: less singleton pointer caching
This commit is contained in:
@@ -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()),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user