diff options
author | hjk <qtc-committer@nokia.com> | 2009-01-20 11:52:04 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-01-20 11:52:04 +0100 |
commit | 113b81e9dbc67dab5252eb9b6a8aaa57efda3de0 (patch) | |
tree | 7a80819280d648a2cdd1eecf1cf645d6bbcc64d5 /src/plugins/resourceeditor | |
parent | d1dac15cc57549ac7da6c6007685e5bacdbf1828 (diff) | |
download | qt-creator-113b81e9dbc67dab5252eb9b6a8aaa57efda3de0.tar.gz |
replace ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>() by Core::ICore::instance()
Diffstat (limited to 'src/plugins/resourceeditor')
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.cpp | 26 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.h | 13 |
2 files changed, 18 insertions, 21 deletions
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 3775564cc8..a1d612efc2 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -56,9 +56,8 @@ using namespace ResourceEditor::Internal; ResourceEditorPlugin::ResourceEditorPlugin() : m_wizard(0), m_editor(0), - m_core(NULL), - m_redoAction(NULL), - m_undoAction(NULL) + m_redoAction(0), + m_undoAction(0) { } @@ -68,13 +67,14 @@ ResourceEditorPlugin::~ResourceEditorPlugin() removeObject(m_wizard); } -bool ResourceEditorPlugin::initialize(const QStringList & /*arguments*/, QString *error_message) +bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage) { - m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>(); - if (!m_core->mimeDatabase()->addMimeTypes(QLatin1String(":/resourceeditor/ResourceEditor.mimetypes.xml"), error_message)) + Q_UNUSED(arguments); + Core::ICore *core = Core::ICore::instance(); + if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/resourceeditor/ResourceEditor.mimetypes.xml"), errorMessage)) return false; - m_editor = new ResourceEditorFactory(m_core, this); + m_editor = new ResourceEditorFactory(core, this); addObject(m_editor); Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard); @@ -83,16 +83,16 @@ bool ResourceEditorPlugin::initialize(const QStringList & /*arguments*/, QString wizardParameters.setCategory(QLatin1String("Qt")); wizardParameters.setTrCategory(tr("Qt")); - m_wizard = new ResourceWizard(wizardParameters, m_core, this); + m_wizard = new ResourceWizard(wizardParameters, core, this); addObject(m_wizard); - error_message->clear(); + errorMessage->clear(); // Register undo and redo - Core::ActionManager * const actionManager = m_core->actionManager(); - int const pluginId = m_core->uniqueIDManager()->uniqueIdentifier( + Core::ActionManager * const actionManager = core->actionManager(); + int const pluginId = core->uniqueIDManager()->uniqueIdentifier( Constants::C_RESOURCEEDITOR); - QList<int> const idList = QList<int>() << pluginId; + const QList<int> idList = QList<int>() << pluginId; m_undoAction = new QAction(tr("&Undo"), this); m_redoAction = new QAction(tr("&Redo"), this); actionManager->registerAction(m_undoAction, Core::Constants::UNDO, idList); @@ -129,7 +129,7 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor, ResourceEditorW * ResourceEditorPlugin::currentEditor() const { ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>( - m_core->editorManager()->currentEditor()); + Core::ICore::instance()->editorManager()->currentEditor()); QTC_ASSERT(focusEditor, return 0); return focusEditor; } diff --git a/src/plugins/resourceeditor/resourceeditorplugin.h b/src/plugins/resourceeditor/resourceeditorplugin.h index fd9576ea00..d8c4c3daf1 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.h +++ b/src/plugins/resourceeditor/resourceeditorplugin.h @@ -36,11 +36,9 @@ #include <extensionsystem/iplugin.h> -QT_FORWARD_DECLARE_CLASS(QAction); - -namespace Core { - class ICore; -} +QT_BEGIN_NAMESPACE +class QAction; +QT_END_NAMESPACE namespace ResourceEditor { namespace Internal { @@ -57,8 +55,8 @@ public: ResourceEditorPlugin(); virtual ~ResourceEditorPlugin(); - //Plugin - bool initialize(const QStringList &arguments, QString *error_message = 0); + // IPlugin + bool initialize(const QStringList &arguments, QString *errorMessage = 0); void extensionsInitialized(); private slots: @@ -74,7 +72,6 @@ private: private: ResourceWizard *m_wizard; ResourceEditorFactory *m_editor; - Core::ICore *m_core; QAction *m_redoAction; QAction *m_undoAction; }; |