summaryrefslogtreecommitdiff
path: root/src/plugins/resourceeditor/resourceeditorplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/resourceeditor/resourceeditorplugin.cpp')
-rw-r--r--src/plugins/resourceeditor/resourceeditorplugin.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp
index 227d69b3ef..3d6b622f73 100644
--- a/src/plugins/resourceeditor/resourceeditorplugin.cpp
+++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp
@@ -51,36 +51,28 @@
using namespace ResourceEditor::Internal;
ResourceEditorPlugin::ResourceEditorPlugin() :
- m_wizard(0),
- m_editor(0),
m_redoAction(0),
m_undoAction(0)
{
}
-ResourceEditorPlugin::~ResourceEditorPlugin()
-{
- removeObject(m_editor);
- removeObject(m_wizard);
-}
-
bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/resourceeditor/ResourceEditor.mimetypes.xml"), errorMessage))
return false;
- m_editor = new ResourceEditorFactory(this);
- addObject(m_editor);
+ ResourceEditorFactory *editor = new ResourceEditorFactory(this);
+ addAutoReleasedObject(editor);
- m_wizard = new ResourceWizard(this);
- m_wizard->setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project."));
- m_wizard->setDisplayName(tr("Qt Resource file"));
- m_wizard->setId(QLatin1String("F.Resource"));
- m_wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
- m_wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
+ ResourceWizard *wizard = new ResourceWizard;
+ wizard->setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project."));
+ wizard->setDisplayName(tr("Qt Resource file"));
+ wizard->setId(QLatin1String("F.Resource"));
+ wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
+ wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
- addObject(m_wizard);
+ addAutoReleasedObject(wizard);
errorMessage->clear();