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()));
|
this, SLOT(updateActions()));
|
||||||
connect(this, SIGNAL(currentEditorChanged(Core::IEditor*)),
|
connect(this, SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||||
this, SLOT(updateEditorHistory()));
|
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 *)),
|
connect(m_d->m_splitter, SIGNAL(closeRequested(Core::IEditor *)),
|
||||||
this, SLOT(closeEditor(Core::IEditor *)));
|
this, SLOT(closeEditor(Core::IEditor *)));
|
||||||
connect(m_d->m_splitter, SIGNAL(editorGroupsChanged()),
|
connect(m_d->m_splitter, SIGNAL(editorGroupsChanged()),
|
||||||
|
|||||||
@@ -51,10 +51,9 @@
|
|||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Core::Internal;
|
using namespace Core::Internal;
|
||||||
|
|
||||||
EditorSplitter::EditorSplitter(ICore *core, QWidget *parent)
|
EditorSplitter::EditorSplitter(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
m_curGroup(0),
|
m_curGroup(0)
|
||||||
m_core(core)
|
|
||||||
{
|
{
|
||||||
registerActions();
|
registerActions();
|
||||||
createRootGroup();
|
createRootGroup();
|
||||||
@@ -69,9 +68,9 @@ void EditorSplitter::registerActions()
|
|||||||
{
|
{
|
||||||
QList<int> gc = QList<int>() << Constants::C_GLOBAL_ID;
|
QList<int> gc = QList<int>() << Constants::C_GLOBAL_ID;
|
||||||
const QList<int> editorManagerContext =
|
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);
|
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
|
||||||
Command *cmd;
|
Command *cmd;
|
||||||
|
|
||||||
@@ -538,13 +537,13 @@ QWidget *EditorSplitter::recreateGroupTree(QWidget *node)
|
|||||||
|
|
||||||
void EditorSplitter::saveCurrentLayout()
|
void EditorSplitter::saveCurrentLayout()
|
||||||
{
|
{
|
||||||
QSettings *settings = m_core->settings();
|
QSettings *settings = ICore::instance()->settings();
|
||||||
settings->setValue("EditorManager/Splitting", saveState());
|
settings->setValue("EditorManager/Splitting", saveState());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorSplitter::restoreDefaultLayout()
|
void EditorSplitter::restoreDefaultLayout()
|
||||||
{
|
{
|
||||||
QSettings *settings = m_core->settings();
|
QSettings *settings = ICore::instance()->settings();
|
||||||
if (settings->contains("EditorManager/Splitting"))
|
if (settings->contains("EditorManager/Splitting"))
|
||||||
restoreState(settings->value("EditorManager/Splitting").toByteArray());
|
restoreState(settings->value("EditorManager/Splitting").toByteArray());
|
||||||
}
|
}
|
||||||
@@ -656,12 +655,12 @@ EditorGroup *EditorSplitter::createGroup()
|
|||||||
this, SLOT(updateActions()));
|
this, SLOT(updateActions()));
|
||||||
connect(group, SIGNAL(editorAdded(Core::IEditor *)),
|
connect(group, SIGNAL(editorAdded(Core::IEditor *)),
|
||||||
this, SLOT(updateActions()));
|
this, SLOT(updateActions()));
|
||||||
m_core->addContextObject(group->contextObject());
|
ICore::instance()->addContextObject(group->contextObject());
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorSplitter::deleteGroup(EditorGroup *group)
|
void EditorSplitter::deleteGroup(EditorGroup *group)
|
||||||
{
|
{
|
||||||
m_core->removeContextObject(group->contextObject());
|
ICore::instance()->removeContextObject(group->contextObject());
|
||||||
delete group;
|
delete group;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class EditorGroup;
|
class EditorGroup;
|
||||||
class ICore;
|
|
||||||
class IEditor;
|
class IEditor;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -55,7 +54,7 @@ class EditorSplitter : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EditorSplitter(ICore *core, QWidget *parent = 0);
|
explicit EditorSplitter(QWidget *parent = 0);
|
||||||
~EditorSplitter();
|
~EditorSplitter();
|
||||||
|
|
||||||
void setCurrentGroup(Core::EditorGroup *group);
|
void setCurrentGroup(Core::EditorGroup *group);
|
||||||
@@ -114,7 +113,6 @@ private:
|
|||||||
|
|
||||||
QWidget *m_root;
|
QWidget *m_root;
|
||||||
EditorGroup *m_curGroup;
|
EditorGroup *m_curGroup;
|
||||||
ICore *m_core;
|
|
||||||
|
|
||||||
QAction *m_horizontalSplitAction;
|
QAction *m_horizontalSplitAction;
|
||||||
QAction *m_verticalSplitAction;
|
QAction *m_verticalSplitAction;
|
||||||
|
|||||||
Reference in New Issue
Block a user