Use new static ICore interface.

Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
hjk
2012-01-24 15:36:40 +01:00
committed by hjk
parent c14a4756a9
commit 4a21f0c3c8
254 changed files with 848 additions and 1007 deletions

View File

@@ -109,7 +109,7 @@ BauhausPlugin::BauhausPlugin() :
BauhausPlugin::~BauhausPlugin()
{
delete m_designerCore;
Core::ICore::instance()->removeContextObject(m_context);
Core::ICore::removeContextObject(m_context);
}
////////////////////////////////////////////////////
@@ -119,12 +119,10 @@ BauhausPlugin::~BauhausPlugin()
////////////////////////////////////////////////////
bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage/* = 0*/) // =0;
{
Core::ICore *core = Core::ICore::instance();
const Core::Context switchContext(QmlDesigner::Constants::C_QMLDESIGNER,
QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::actionManager();
QAction *switchAction = new QAction(tr("Switch Text/Design"), this);
Core::Command *command = am->registerAction(switchAction, QmlDesigner::Constants::SWITCH_TEXT_DESIGN, switchContext);
@@ -148,7 +146,7 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error
addAutoReleasedObject(new SettingsPage);
m_settings.fromSettings(core->settings());
m_settings.fromSettings(Core::ICore::settings());
errorMessage->clear();
@@ -157,15 +155,14 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error
void BauhausPlugin::createDesignModeWidget()
{
Core::ICore *creatorCore = Core::ICore::instance();
Core::ActionManager *actionManager = creatorCore->actionManager();
m_editorManager = creatorCore->editorManager();
Core::ActionManager *actionManager = Core::ICore::actionManager();
m_editorManager = Core::ICore::editorManager();
Core::ActionContainer *editMenu = actionManager->actionContainer(Core::Constants::M_EDIT);
m_mainWidget = new DesignModeWidget;
m_context = new DesignModeContext(m_mainWidget);
creatorCore->addContextObject(m_context);
Core::ICore::addContextObject(m_context);
Core::Context qmlDesignerMainContext(Constants::C_QMLDESIGNER);
Core::Context qmlDesignerFormEditorContext(Constants::C_QMLFORMEDITOR);
Core::Context qmlDesignerNavigatorContext(Constants::C_QMLNAVIGATOR);
@@ -283,7 +280,7 @@ void BauhausPlugin::createDesignModeWidget()
connect(m_editorManager, SIGNAL(editorsClosed(QList<Core::IEditor*>)),
this, SLOT(textEditorsClosed(QList<Core::IEditor*>)));
connect(creatorCore, SIGNAL(contextChanged(Core::IContext*,Core::Context)),
connect(Core::ICore::instance(), SIGNAL(contextChanged(Core::IContext*,Core::Context)),
this, SLOT(contextChanged(Core::IContext*,Core::Context)));
}
@@ -398,7 +395,7 @@ void BauhausPlugin::setSettings(const DesignerSettings &s)
{
if (s != m_settings) {
m_settings = s;
if (QSettings *settings = Core::ICore::instance()->settings())
if (QSettings *settings = Core::ICore::settings())
m_settings.toSettings(settings);
}
}