forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -175,17 +175,6 @@ void WizardEventLoop::rejected()
|
||||
\sa Core::Internal::WizardEventLoop
|
||||
*/
|
||||
|
||||
|
||||
BaseFileWizard::BaseFileWizard(QObject *parent) :
|
||||
IWizard(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseFileWizard::~BaseFileWizard()
|
||||
{
|
||||
}
|
||||
|
||||
BaseFileWizard::ExtensionList BaseFileWizard::selectExtensions()
|
||||
{
|
||||
return ExtensionSystem::PluginManager::getObjects<IFileWizardExtension>();
|
||||
@@ -532,11 +521,6 @@ QString BaseFileWizard::preferredSuffix(const QString &mimeType)
|
||||
Creates the files with the \a name under the \a path.
|
||||
*/
|
||||
|
||||
StandardFileWizard::StandardFileWizard(QObject *parent) :
|
||||
BaseFileWizard(parent)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Creates a Utils::FileWizardDialog.
|
||||
*/
|
||||
|
||||
@@ -108,10 +108,8 @@ class CORE_EXPORT BaseFileWizard : public IWizard
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual ~BaseFileWizard();
|
||||
|
||||
// IWizard
|
||||
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||
|
||||
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
|
||||
static void applyExtensionPageShortTitle(Utils::Wizard *wizard, int pageId);
|
||||
@@ -120,8 +118,6 @@ protected:
|
||||
typedef QList<QWizardPage *> WizardPageList;
|
||||
typedef QList<Core::IFileWizardExtension*> ExtensionList;
|
||||
|
||||
explicit BaseFileWizard(QObject *parent = 0);
|
||||
|
||||
virtual ExtensionList selectExtensions();
|
||||
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
@@ -147,9 +143,8 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
explicit StandardFileWizard(QObject *parent = 0);
|
||||
virtual QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
||||
virtual GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
||||
GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
virtual GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
||||
QString *errorMessage) const = 0;
|
||||
};
|
||||
|
||||
@@ -74,8 +74,7 @@ public:
|
||||
QString descriptionImage;
|
||||
};
|
||||
|
||||
IWizard(QObject *parent = 0) : QObject(parent) {}
|
||||
~IWizard() {}
|
||||
IWizard() { }
|
||||
|
||||
QString id() const { return m_data.id; }
|
||||
WizardKind kind() const { return m_data.kind; }
|
||||
|
||||
@@ -42,7 +42,7 @@ class CppFileWizard : public Core::StandardFileWizard
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CppFileWizard(FileType type);
|
||||
explicit CppFileWizard(FileType type);
|
||||
|
||||
private:
|
||||
QString fileContents(FileType type, const QString &baseName) const;
|
||||
|
||||
@@ -52,8 +52,7 @@ private:
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const;
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -46,8 +46,7 @@ private:
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const;
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -78,14 +78,14 @@ public:
|
||||
typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr;
|
||||
|
||||
CustomWizard();
|
||||
virtual ~CustomWizard();
|
||||
~CustomWizard();
|
||||
|
||||
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
||||
// called.
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
|
||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
|
||||
// Register a factory for a derived custom widget
|
||||
static void registerFactory(const QString &name, const ICustomWizardFactoryPtr &f);
|
||||
@@ -110,7 +110,7 @@ protected:
|
||||
Core::GeneratedFiles generateWizardFiles(QString *errorMessage) const;
|
||||
// Create replacement map as static base fields + QWizard fields
|
||||
FieldReplacementMap replacementMap(const QWizard *w) const;
|
||||
virtual bool writeFiles(const Core::GeneratedFiles &files, QString *errorMessage);
|
||||
bool writeFiles(const Core::GeneratedFiles &files, QString *errorMessage);
|
||||
|
||||
CustomWizardParametersPtr parameters() const;
|
||||
CustomWizardContextPtr context() const;
|
||||
@@ -144,7 +144,7 @@ signals:
|
||||
void projectLocationChanged(const QString &path);
|
||||
|
||||
protected:
|
||||
virtual bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
|
||||
void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath,
|
||||
const WizardPageList &extensionPages) const;
|
||||
|
||||
@@ -55,10 +55,6 @@ FileWizard::FileWizard()
|
||||
setDescription(FileWizard::tr(Constants::EN_PY_SOURCE_DESCRIPTION));
|
||||
}
|
||||
|
||||
FileWizard::~FileWizard()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FileWizard::createWizardDialog
|
||||
* @param parent
|
||||
|
||||
@@ -40,14 +40,12 @@ class FileWizard : public Core::BaseFileWizard
|
||||
|
||||
public:
|
||||
FileWizard();
|
||||
~FileWizard();
|
||||
|
||||
protected:
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶ms) const;
|
||||
|
||||
Core::GeneratedFiles generateFiles( const QWizard *dialog,
|
||||
QString *errorMessage) const;
|
||||
Core::GeneratedFiles generateFiles( const QWizard *dialog, QString *errorMessage) const;
|
||||
};
|
||||
|
||||
} // namespace PythonEditor
|
||||
|
||||
@@ -97,11 +97,6 @@ int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QSt
|
||||
return pageId;
|
||||
}
|
||||
|
||||
|
||||
AbstractMobileAppWizard::AbstractMobileAppWizard(QObject *parent)
|
||||
: Core::BaseFileWizard(parent)
|
||||
{ }
|
||||
|
||||
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||
{
|
||||
|
||||
@@ -72,8 +72,6 @@ private:
|
||||
class QMAKEPROJECTMANAGER_EXPORT AbstractMobileAppWizard : public Core::BaseFileWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
explicit AbstractMobileAppWizard(QObject *parent = 0);
|
||||
|
||||
private slots:
|
||||
void useProjectPath(const QString &projectName, const QString &projectPath);
|
||||
@@ -82,20 +80,17 @@ protected:
|
||||
virtual QString fileToOpenPostGeneration() const = 0;
|
||||
|
||||
private:
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
virtual Core::GeneratedFiles generateFiles(const QWizard *wizard,
|
||||
QString *errorMessage) const;
|
||||
virtual bool postGenerateFiles(const QWizard *w,
|
||||
const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
Core::GeneratedFiles generateFiles(const QWizard *wizard, QString *errorMessage) const;
|
||||
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
|
||||
virtual AbstractMobileApp *app() const = 0;
|
||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const = 0;
|
||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const = 0;
|
||||
virtual void projectPathChanged(const QString &path) const = 0;
|
||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||
QString *errorMessage) const = 0;
|
||||
virtual void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const = 0;
|
||||
};
|
||||
|
||||
} // namespace QmakeProjectManager
|
||||
|
||||
@@ -48,8 +48,7 @@ protected:
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const;
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -54,7 +54,6 @@ private:
|
||||
static bool parametrizeTemplate(const QString &templatePath, const QString &templateName,
|
||||
const GuiAppParameters ¶ms,
|
||||
QString *target, QString *errorMessage);
|
||||
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -47,13 +47,12 @@ protected:
|
||||
QString fileToOpenPostGeneration() const;
|
||||
|
||||
private:
|
||||
virtual AbstractMobileApp *app() const;
|
||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) const;
|
||||
virtual void projectPathChanged(const QString &path) const;
|
||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||
QString *errorMessage) const;
|
||||
AbstractMobileApp *app() const;
|
||||
AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||
AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) const;
|
||||
void projectPathChanged(const QString &path) const;
|
||||
void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const;
|
||||
|
||||
class Html5AppWizardPrivate *d;
|
||||
};
|
||||
|
||||
@@ -47,13 +47,12 @@ protected:
|
||||
QString fileToOpenPostGeneration() const;
|
||||
|
||||
private:
|
||||
virtual AbstractMobileApp *app() const;
|
||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||
const Core::WizardDialogParameters &baseParameters) const;
|
||||
virtual void projectPathChanged(const QString &path) const;
|
||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
||||
QString *errorMessage) const;
|
||||
AbstractMobileApp *app() const;
|
||||
AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||
AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||
const Core::WizardDialogParameters &baseParameters) const;
|
||||
void projectPathChanged(const QString &path) const;
|
||||
void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const;
|
||||
|
||||
class QtQuickAppWizardPrivate *d;
|
||||
};
|
||||
|
||||
@@ -95,8 +95,8 @@ public:
|
||||
|
||||
private:
|
||||
QWizard *createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||
|
||||
private:
|
||||
enum { targetPageId = 1 };
|
||||
@@ -120,7 +120,7 @@ protected:
|
||||
public:
|
||||
explicit BaseQmakeProjectWizardDialog(bool showModulesPage, QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters);
|
||||
virtual ~BaseQmakeProjectWizardDialog();
|
||||
~BaseQmakeProjectWizardDialog();
|
||||
|
||||
int addModulesPage(int id = -1);
|
||||
int addTargetSetupPage(int id = -1);
|
||||
|
||||
@@ -61,7 +61,7 @@ class QmlApplicationWizard : public Core::BaseFileWizard
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QmlApplicationWizard();
|
||||
QmlApplicationWizard();
|
||||
|
||||
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
||||
|
||||
|
||||
@@ -111,8 +111,7 @@ void CascadesImportWizardDialog::onSrcProjectPathChanged(const QString &path)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static const char IMPORT_LOG_FILE_NAME[] = "import.log";
|
||||
|
||||
CascadesImportWizard::CascadesImportWizard(QObject *parent)
|
||||
: Core::BaseFileWizard(parent)
|
||||
CascadesImportWizard::CascadesImportWizard()
|
||||
{
|
||||
setWizardKind(ProjectWizard);
|
||||
setIcon(QPixmap(QLatin1String(Qnx::Constants::QNX_BB_CATEGORY_ICON)));
|
||||
@@ -125,10 +124,6 @@ CascadesImportWizard::CascadesImportWizard(QObject *parent)
|
||||
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
||||
}
|
||||
|
||||
CascadesImportWizard::~CascadesImportWizard()
|
||||
{
|
||||
}
|
||||
|
||||
Core::BaseFileWizard::ExtensionList CascadesImportWizard::selectExtensions()
|
||||
{
|
||||
return Core::BaseFileWizard::ExtensionList();
|
||||
|
||||
@@ -63,8 +63,7 @@ class CascadesImportWizard : public Core::BaseFileWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CascadesImportWizard(QObject *parent = 0);
|
||||
virtual ~CascadesImportWizard();
|
||||
CascadesImportWizard();
|
||||
|
||||
protected:
|
||||
ExtensionList selectExtensions();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -45,9 +45,8 @@ public:
|
||||
const QString &suggestedFileName);
|
||||
|
||||
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;
|
||||
private:
|
||||
const QString m_mimeType;
|
||||
const QString m_suggestedFileName;
|
||||
|
||||
@@ -84,8 +84,7 @@ void BaseCheckoutWizardPrivate::clear()
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
BaseCheckoutWizard::BaseCheckoutWizard(QObject *parent) :
|
||||
Core::IWizard(parent),
|
||||
BaseCheckoutWizard::BaseCheckoutWizard() :
|
||||
d(new Internal::BaseCheckoutWizardPrivate)
|
||||
{
|
||||
setWizardKind(IWizard::ProjectWizard);
|
||||
|
||||
@@ -50,7 +50,7 @@ class VCSBASE_EXPORT BaseCheckoutWizard : public Core::IWizard
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BaseCheckoutWizard(QObject *parent = 0);
|
||||
BaseCheckoutWizard();
|
||||
~BaseCheckoutWizard();
|
||||
|
||||
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||
|
||||
Reference in New Issue
Block a user