diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-02-13 14:56:14 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-02-13 16:21:29 +0100 |
commit | 424b9a0036141d24cb6d563c8cf76e2d7e6b2ab5 (patch) | |
tree | f4c9b6c1162f499241dbdaaeefecdfb69cc90951 /src/plugins/resourceeditor | |
parent | 12b0fedcfc4b9de489aa9fa028a77333f7510801 (diff) |
IWizard and derived classes: Code cleanups
There should be no functional changes, just removal of unnecessary
code. This includes:
* Removal of unused QObject *parent = 0 parameters to constructors
* Removal of unnecessary explicits
* Removal of unnecessary virtuals
* Removal of unnecessary constructors/destructors
Some explicits were added though where those were missing.
Change-Id: Iab570349ea950dad0a2d01af17bc6175f70832f1
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/resourceeditor')
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.cpp | 26 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.h | 3 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcewizard.cpp | 5 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcewizard.h | 8 |
4 files changed, 11 insertions, 31 deletions
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 227d69b3ef2..3d6b622f732 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(); diff --git a/src/plugins/resourceeditor/resourceeditorplugin.h b/src/plugins/resourceeditor/resourceeditorplugin.h index 4f09ba69ab8..d488ec0b0ec 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.h +++ b/src/plugins/resourceeditor/resourceeditorplugin.h @@ -50,7 +50,6 @@ class ResourceEditorPlugin : public ExtensionSystem::IPlugin public: ResourceEditorPlugin(); - virtual ~ResourceEditorPlugin(); // IPlugin bool initialize(const QStringList &arguments, QString *errorMessage = 0); @@ -68,8 +67,6 @@ private: ResourceEditorW * currentEditor() const; private: - ResourceWizard *m_wizard; - ResourceEditorFactory *m_editor; QAction *m_redoAction; QAction *m_undoAction; QAction *m_refreshAction; diff --git a/src/plugins/resourceeditor/resourcewizard.cpp b/src/plugins/resourceeditor/resourcewizard.cpp index a05c68ab174..b62ef312794 100644 --- a/src/plugins/resourceeditor/resourcewizard.cpp +++ b/src/plugins/resourceeditor/resourcewizard.cpp @@ -34,11 +34,6 @@ using namespace ResourceEditor; using namespace ResourceEditor::Internal; -ResourceWizard::ResourceWizard(QObject *parent) - : Core::StandardFileWizard(parent) -{ -} - Core::GeneratedFiles ResourceWizard::generateFilesFromPath(const QString &path, const QString &name, diff --git a/src/plugins/resourceeditor/resourcewizard.h b/src/plugins/resourceeditor/resourcewizard.h index 25c86fb9c5d..b485afbba33 100644 --- a/src/plugins/resourceeditor/resourcewizard.h +++ b/src/plugins/resourceeditor/resourcewizard.h @@ -39,13 +39,9 @@ class ResourceWizard : public Core::StandardFileWizard { Q_OBJECT -public: - explicit ResourceWizard(QObject *parent); - protected: - virtual Core::GeneratedFiles - generateFilesFromPath(const QString &path, const QString &name, - QString *errorMessage) const; + Core::GeneratedFiles generateFilesFromPath(const QString &path, const QString &name, + QString *errorMessage) const; }; } // namespace Internal |