diff options
author | hjk <hjk121@nokiamail.com> | 2013-09-20 15:12:44 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-09-24 09:57:32 +0200 |
commit | 49d0789e641e118dd412d3094e1f121f6ddfcb86 (patch) | |
tree | 8c19f6d76670e4c097edc44338b2b9813ebb0cb9 /src/plugins/cppeditor/cppeditorplugin.cpp | |
parent | aa32c2be87f7192e03f06b8b5223100354e269a6 (diff) | |
download | qt-creator-49d0789e641e118dd412d3094e1f121f6ddfcb86.tar.gz |
Cleanup IWizard interface and users
Added 639 lines, removed 1391.
Change-Id: I15ec7dd056d4f7ad79c6dd6a4181007ad14f6a43
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cppeditorplugin.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppeditorplugin.cpp | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 17afbf148e..3b939b49d0 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -163,28 +163,35 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err addAutoReleasedObject(m_quickFixProvider); CppEditor::Internal::registerQuickFixes(this); - QObject *core = ICore::instance(); - CppFileWizard::BaseFileWizardParameters wizardParameters(IWizard::FileWizard); - - wizardParameters.setCategory(QLatin1String(Constants::WIZARD_CATEGORY)); - wizardParameters.setDisplayCategory(QCoreApplication::translate(Constants::WIZARD_CATEGORY, - Constants::WIZARD_TR_CATEGORY)); - wizardParameters.setDisplayName(tr("C++ Class")); - wizardParameters.setId(QLatin1String("A.Class")); - wizardParameters.setKind(IWizard::ClassWizard); - wizardParameters.setDescription(tr("Creates a C++ header and a source file for a new class that you can add to a C++ project.")); - addAutoReleasedObject(new CppClassWizard(wizardParameters, core)); - - wizardParameters.setKind(IWizard::FileWizard); - wizardParameters.setDescription(tr("Creates a C++ source file that you can add to a C++ project.")); - wizardParameters.setDisplayName(tr("C++ Source File")); - wizardParameters.setId(QLatin1String("B.Source")); - addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, core)); - - wizardParameters.setDescription(tr("Creates a C++ header file that you can add to a C++ project.")); - wizardParameters.setDisplayName(tr("C++ Header File")); - wizardParameters.setId(QLatin1String("C.Header")); - addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core)); + QString trCat = QCoreApplication::translate(Constants::WIZARD_CATEGORY, Constants::WIZARD_TR_CATEGORY); + + IWizard *wizard = new CppClassWizard; + wizard->setWizardKind(IWizard::ClassWizard); + wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY)); + wizard->setDisplayCategory(trCat); + wizard->setDisplayName(tr("C++ Class")); + wizard->setId(QLatin1String("A.Class")); + wizard->setDescription(tr("Creates a C++ header and a source file for a new class that you can add to a C++ project.")); + addAutoReleasedObject(wizard); + + wizard = new CppFileWizard(Source); + wizard->setWizardKind(IWizard::FileWizard); + wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY)); + wizard->setDisplayCategory(trCat); + wizard->setDisplayName(tr("C++ Class")); + wizard->setDescription(tr("Creates a C++ source file that you can add to a C++ project.")); + wizard->setDisplayName(tr("C++ Source File")); + wizard->setId(QLatin1String("B.Source")); + addAutoReleasedObject(wizard); + + wizard = new CppFileWizard(Header); + wizard->setWizardKind(IWizard::FileWizard); + wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY)); + wizard->setDisplayCategory(trCat); + wizard->setDescription(tr("Creates a C++ header file that you can add to a C++ project.")); + wizard->setDisplayName(tr("C++ Header File")); + wizard->setId(QLatin1String("C.Header")); + addAutoReleasedObject(wizard); Context context(CppEditor::Constants::C_CPPEDITOR); |