Commit b2b6d3c5 authored by Tobias Hunger's avatar Tobias Hunger

CMake: Semi-automatic cleanups

* Shorten header guards
* Use override and auto where possible
* Remove useless destructors, etc.
* Remove private slots sections, unify private: sections
* Use member initialization where it makes sense

Change-Id: I00eaf6d706adc16859176d1b68c631d3336bb39f
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent 079448d3
......@@ -42,7 +42,6 @@ class CMAKE_EXPORT CMakeAutoCompleter : public TextEditor::AutoCompleter
{
public:
CMakeAutoCompleter();
virtual ~CMakeAutoCompleter() {}
bool isInComment(const QTextCursor &cursor) const override;
bool isInString(const QTextCursor &cursor) const override;
......
......@@ -123,9 +123,6 @@ QString CMakeBuildConfiguration::initialArguments() const
return m_initialArguments;
}
CMakeBuildConfiguration::~CMakeBuildConfiguration()
{ }
ProjectExplorer::NamedWidget *CMakeBuildConfiguration::createConfigWidget()
{
return new CMakeBuildSettingsWidget(this);
......@@ -140,10 +137,6 @@ CMakeBuildConfigurationFactory::CMakeBuildConfigurationFactory(QObject *parent)
{
}
CMakeBuildConfigurationFactory::~CMakeBuildConfigurationFactory()
{
}
int CMakeBuildConfigurationFactory::priority(const ProjectExplorer::Target *parent) const
{
return canHandle(parent) ? 0 : -1;
......@@ -207,7 +200,7 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
copy.displayName, info->buildType);
}
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(parent);
auto bc = new CMakeBuildConfiguration(parent);
bc->setDisplayName(copy.displayName);
bc->setDefaultDisplayName(copy.displayName);
......@@ -257,7 +250,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::restore(ProjectExplorer
{
if (!canRestore(parent, map))
return 0;
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(parent);
auto bc = new CMakeBuildConfiguration(parent);
if (bc->fromMap(map))
return bc;
delete bc;
......
......@@ -51,13 +51,12 @@ class CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
public:
CMakeBuildConfiguration(ProjectExplorer::Target *parent);
~CMakeBuildConfiguration();
ProjectExplorer::NamedWidget *createConfigWidget();
ProjectExplorer::NamedWidget *createConfigWidget() override;
QVariantMap toMap() const;
QVariantMap toMap() const override;
BuildType buildType() const;
BuildType buildType() const override;
void emitBuildTypeChanged();
......@@ -66,7 +65,7 @@ public:
protected:
CMakeBuildConfiguration(ProjectExplorer::Target *parent, CMakeBuildConfiguration *source);
bool fromMap(const QVariantMap &map);
bool fromMap(const QVariantMap &map) override;
private:
QString m_initialArguments;
......@@ -80,20 +79,19 @@ class CMakeBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurati
public:
CMakeBuildConfigurationFactory(QObject *parent = 0);
~CMakeBuildConfigurationFactory();
int priority(const ProjectExplorer::Target *parent) const;
QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const;
int priority(const ProjectExplorer::Kit *k, const QString &projectPath) const;
int priority(const ProjectExplorer::Target *parent) const override;
QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const override;
int priority(const ProjectExplorer::Kit *k, const QString &projectPath) const override;
QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k,
const QString &projectPath) const;
const QString &projectPath) const override;
ProjectExplorer::BuildConfiguration *create(ProjectExplorer::Target *parent,
const ProjectExplorer::BuildInfo *info) const;
const ProjectExplorer::BuildInfo *info) const override;
bool canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) const;
CMakeBuildConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source);
bool canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const;
CMakeBuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
bool canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) const override;
CMakeBuildConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) override;
bool canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const override;
CMakeBuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map) override;
private:
bool canHandle(const ProjectExplorer::Target *t) const;
......
......@@ -46,32 +46,32 @@
namespace CMakeProjectManager {
namespace Internal {
CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) : m_buildConfiguration(0)
CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) :
m_pathLineEdit(new QLineEdit),
m_changeButton(new QPushButton)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
vbox->setMargin(0);
Utils::DetailsWidget *container = new Utils::DetailsWidget;
auto container = new Utils::DetailsWidget;
container->setState(Utils::DetailsWidget::NoSummary);
vbox->addWidget(container);
QWidget *details = new QWidget(container);
auto details = new QWidget(container);
container->setWidget(details);
QFormLayout *fl = new QFormLayout(details);
auto fl = new QFormLayout(details);
fl->setMargin(0);
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
QPushButton *runCmakeButton = new QPushButton(tr("Run CMake..."));
auto runCmakeButton = new QPushButton(tr("Run CMake..."));
connect(runCmakeButton, &QAbstractButton::clicked, this, &CMakeBuildSettingsWidget::runCMake);
fl->addRow(tr("Reconfigure project:"), runCmakeButton);
m_pathLineEdit = new QLineEdit(this);
m_pathLineEdit->setReadOnly(true);
QHBoxLayout *hbox = new QHBoxLayout();
auto hbox = new QHBoxLayout();
hbox->addWidget(m_pathLineEdit);
m_changeButton = new QPushButton(this);
m_changeButton->setText(tr("&Change"));
connect(m_changeButton, &QAbstractButton::clicked, this,
&CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog);
......
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CMAKEPROJECTMANAGER_INTERNAL_CMAKEBUILDSETTINGSWIDGET_H
#define CMAKEPROJECTMANAGER_INTERNAL_CMAKEBUILDSETTINGSWIDGET_H
#ifndef CMAKEBUILDSETTINGSWIDGET_H
#define CMAKEBUILDSETTINGSWIDGET_H
#include <projectexplorer/namedwidget.h>
......@@ -47,16 +47,16 @@ class CMakeBuildSettingsWidget : public ProjectExplorer::NamedWidget
public:
CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc);
private slots:
private:
void openChangeBuildDirectoryDialog();
void runCMake();
private:
QLineEdit *m_pathLineEdit;
QPushButton *m_changeButton;
CMakeBuildConfiguration *m_buildConfiguration;
CMakeBuildConfiguration *m_buildConfiguration = 0;
};
} // namespace Internal
} // namespace CMakeProjectManager
#endif // CMAKEPROJECTMANAGER_INTERNAL_CMAKEBUILDSETTINGSWIDGET_H
#endif // CMAKEBUILDSETTINGSWIDGET_H
......@@ -74,14 +74,12 @@ const char ADD_RUNCONFIGURATION_ARGUMENT_KEY[] = "CMakeProjectManager.MakeStep.A
const char ADD_RUNCONFIGURATION_TEXT[] = "Current executable";
}
CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl) :
AbstractProcessStep(bsl, Core::Id(MS_ID)), m_addRunConfigurationArgument(false)
CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl) : AbstractProcessStep(bsl, Core::Id(MS_ID))
{
ctor();
}
CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Core::Id id) :
AbstractProcessStep(bsl, id), m_addRunConfigurationArgument(false)
CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(bsl, id)
{
ctor();
}
......@@ -357,25 +355,26 @@ QString CMakeBuildStep::cleanTarget()
// CMakeBuildStepConfigWidget
//
CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep)
: m_buildStep(buildStep)
CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep) :
m_buildStep(buildStep),
m_toolArguments(new QLineEdit),
m_buildTargetsList(new QListWidget)
{
QFormLayout *fl = new QFormLayout(this);
auto fl = new QFormLayout(this);
fl->setMargin(0);
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
setLayout(fl);
m_toolArguments = new QLineEdit(this);
fl->addRow(tr("Tool arguments:"), m_toolArguments);
m_toolArguments->setText(m_buildStep->toolArguments());
m_buildTargetsList = new QListWidget;
m_buildTargetsList->setFrameStyle(QFrame::NoFrame);
m_buildTargetsList->setMinimumHeight(200);
QFrame *frame = new QFrame(this);
auto frame = new QFrame(this);
frame->setFrameStyle(QFrame::StyledPanel);
QVBoxLayout *frameLayout = new QVBoxLayout(frame);
auto frameLayout = new QVBoxLayout(frame);
frameLayout->setMargin(0);
frameLayout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_buildTargetsList,
Core::ItemViewFind::LightColored));
......@@ -393,7 +392,7 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep
QStringList targetList = pro->buildTargetTitles();
targetList.sort();
foreach (const QString &buildTarget, targetList) {
QListWidgetItem *item = new QListWidgetItem(buildTarget, m_buildTargetsList);
auto item = new QListWidgetItem(buildTarget, m_buildTargetsList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(m_buildStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
}
......@@ -437,7 +436,7 @@ void CMakeBuildStepConfigWidget::buildTargetsChanged()
CMakeProject *pro = static_cast<CMakeProject *>(m_buildStep->target()->project());
foreach (const QString& buildTarget, pro->buildTargetTitles()) {
QListWidgetItem *item = new QListWidgetItem(buildTarget, m_buildTargetsList);
auto item = new QListWidgetItem(buildTarget, m_buildTargetsList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(m_buildStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
}
......@@ -501,7 +500,7 @@ BuildStep *CMakeBuildStepFactory::create(BuildStepList *parent, Core::Id id)
{
if (!canCreate(parent, id))
return 0;
CMakeBuildStep *step = new CMakeBuildStep(parent);
auto step = new CMakeBuildStep(parent);
if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN)
step->setBuildTarget(CMakeBuildStep::cleanTarget(), true);
return step;
......@@ -528,7 +527,7 @@ BuildStep *CMakeBuildStepFactory::restore(BuildStepList *parent, const QVariantM
{
if (!canRestore(parent, map))
return 0;
CMakeBuildStep *bs(new CMakeBuildStep(parent));
auto bs = new CMakeBuildStep(parent);
if (bs->fromMap(map))
return bs;
delete bs;
......
......@@ -86,9 +86,6 @@ public:
static QString cleanTarget();
private:
void buildTargetsChanged();
signals:
void cmakeCommandChanged();
void targetsToBuildChanged();
......@@ -103,10 +100,12 @@ protected:
bool fromMap(const QVariantMap &map) override;
// For parsing [ 76%]
virtual void stdOutput(const QString &line) override;
void stdOutput(const QString &line) override;
private:
void ctor();
void buildTargetsChanged();
CMakeRunConfiguration *targetsActiveRunConfiguration() const;
QRegExp m_percentProgress;
......@@ -114,8 +113,8 @@ private:
QString m_ninjaProgressString;
QStringList m_buildTargets;
QString m_toolArguments;
bool m_addRunConfigurationArgument;
bool m_useNinja;
bool m_addRunConfigurationArgument = false;
bool m_useNinja = false;
};
class CMakeBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
......@@ -123,8 +122,8 @@ class CMakeBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
Q_OBJECT
public:
CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep);
virtual QString displayName() const;
virtual QString summaryText() const;
QString displayName() const override;
QString summaryText() const override;
private:
void itemChanged(QListWidgetItem*);
......@@ -133,10 +132,9 @@ private:
void buildTargetsChanged();
void selectedBuildTargetsChanged();
private:
CMakeBuildStep *m_buildStep;
QListWidget *m_buildTargetsList;
QLineEdit *m_toolArguments;
QListWidget *m_buildTargetsList;
QString m_summaryText;
};
......@@ -147,15 +145,15 @@ class CMakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory
public:
explicit CMakeBuildStepFactory(QObject *parent = 0);
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const override;
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id) override;
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const override;
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) override;
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
QString displayNameForId(Core::Id id) const;
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const override;
QString displayNameForId(Core::Id id) const override;
};
} // namespace Internal
......
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CMAKEPROJECTMANAGER_INTERNAL_CMAKECBPPARSER_H
#define CMAKEPROJECTMANAGER_INTERNAL_CMAKECBPPARSER_H
#ifndef CMAKECBPPARSER_H
#define CMAKECBPPARSER_H
#include "cmakeproject.h"
......@@ -73,7 +73,7 @@ private:
void sortFiles();
QMap<Utils::FileName, QString> m_unitTargetMap;
ProjectExplorer::Kit *m_kit;
ProjectExplorer::Kit *m_kit = 0;
QList<ProjectExplorer::FileNode *> m_fileList;
QList<ProjectExplorer::FileNode *> m_cmakeFileList;
QSet<Utils::FileName> m_processedUnits;
......@@ -91,4 +91,4 @@ private:
} // namespace Internal
} // namespace CMakeProjectManager
#endif // CMAKEPROJECTMANAGER_INTERNAL_CMAKECBPPARSER_H
#endif // CMAKECBPPARSER_H
......@@ -28,8 +28,8 @@
**
****************************************************************************/
#ifndef CMAKEPROJECTMANAGER_INTERNAL_CMAKEFILE_H
#define CMAKEPROJECTMANAGER_INTERNAL_CMAKEFILE_H
#ifndef CMAKEFILE_H
#define CMAKEFILE_H
#include <coreplugin/idocument.h>
......@@ -62,4 +62,4 @@ private:
} // namespace Internal
} // namespace CMakeProjectManager
#endif // CMAKEPROJECTMANAGER_INTERNAL_CMAKEFILE_H
#endif // CMAKEFILE_H
......@@ -54,9 +54,6 @@ using namespace ProjectExplorer;
CMakeFileCompletionAssistProvider::CMakeFileCompletionAssistProvider()
{}
CMakeFileCompletionAssistProvider::~CMakeFileCompletionAssistProvider()
{}
bool CMakeFileCompletionAssistProvider::supportsEditor(Core::Id editorId) const
{
return editorId == CMakeProjectManager::Constants::CMAKE_EDITOR_ID;
......
......@@ -54,10 +54,9 @@ class CMakeFileCompletionAssistProvider : public TextEditor::CompletionAssistPro
public:
CMakeFileCompletionAssistProvider();
~CMakeFileCompletionAssistProvider();
bool supportsEditor(Core::Id editorId) const;
TextEditor::IAssistProcessor *createProcessor() const;
bool supportsEditor(Core::Id editorId) const override;
TextEditor::IAssistProcessor *createProcessor() const override;
};
} // Internal
......
......@@ -39,10 +39,6 @@
namespace CMakeProjectManager {
namespace Internal {
CMakeIndenter::CMakeIndenter()
{
}
bool CMakeIndenter::isElectricCharacter(const QChar &ch) const
{
return ch == QLatin1Char('(') || ch == QLatin1Char(')');
......
......@@ -41,9 +41,6 @@ namespace Internal {
class CMAKE_EXPORT CMakeIndenter : public TextEditor::Indenter
{
public:
CMakeIndenter();
virtual ~CMakeIndenter() {}
bool isElectricCharacter(const QChar &ch) const override;
void indentBlock(QTextDocument *doc, const QTextBlock &block, const QChar &typedChar, const TextEditor::TabSettings &tabSettings) override;
};
......
......@@ -48,9 +48,9 @@ namespace Internal {
CMakeKitConfigWidget::CMakeKitConfigWidget(ProjectExplorer::Kit *kit,
const ProjectExplorer::KitInformation *ki) :
ProjectExplorer::KitConfigWidget(kit, ki),
m_removingItem(false)
m_comboBox(new QComboBox),
m_manageButton(new QPushButton(KitConfigWidget::msgManage()))
{
m_comboBox = new QComboBox;
m_comboBox->setEnabled(false);
m_comboBox->setToolTip(toolTip());
......@@ -63,7 +63,6 @@ CMakeKitConfigWidget::CMakeKitConfigWidget(ProjectExplorer::Kit *kit,
connect(m_comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &CMakeKitConfigWidget::currentCMakeToolChanged);
m_manageButton = new QPushButton(KitConfigWidget::msgManage());
m_manageButton->setContentsMargins(0, 0, 0, 0);
connect(m_manageButton, &QPushButton::clicked,
this, &CMakeKitConfigWidget::manageCMakeTools);
......
......@@ -27,8 +27,8 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef CMAKEPROJECTMANAGER_INTERNAL_CMAKEKITCONFIGWIDGET_H
#define CMAKEPROJECTMANAGER_INTERNAL_CMAKEKITCONFIGWIDGET_H
#ifndef CMAKEKITCONFIGWIDGET_H
#define CMAKEKITCONFIGWIDGET_H
#include <projectexplorer/kitconfigwidget.h>
......@@ -70,8 +70,7 @@ private:
void currentCMakeToolChanged(int index);
void manageCMakeTools();
private:
bool m_removingItem;
bool m_removingItem = false;
QComboBox *m_comboBox;
QPushButton *m_manageButton;
};
......@@ -79,4 +78,4 @@ private:
} // namespace Internal
} // namespace CMakeProjectManager
#endif // CMAKEPROJECTMANAGER_INTERNAL_CMAKEKITCONFIGWIDGET_H
#endif // CMAKEKITCONFIGWIDGET_H
......@@ -27,8 +27,8 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef CMAKEPROJECTMANAGER_CMAKEKITINFORMATION_H
#define CMAKEPROJECTMANAGER_CMAKEKITINFORMATION_H
#ifndef CMAKEKITINFORMATION_H
#define CMAKEKITINFORMATION_H
#include "cmake_global.h"
......@@ -55,10 +55,10 @@ public:
QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *k) const override;
void setup(ProjectExplorer::Kit *k) override;
void fix(ProjectExplorer::Kit *k) override;
virtual ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
virtual ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
};
} // namespace CMakeProjectManager
#endif // CMAKEPROJECTMANAGER_CMAKEKITINFORMATION_H
#endif // CMAKEKITINFORMATION_H
......@@ -53,20 +53,15 @@ CMakeLocatorFilter::CMakeLocatorFilter()
setShortcutString(QLatin1String("cm"));
setPriority(High);
connect(SessionManager::instance(), SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(slotProjectListUpdated()));
connect(SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(slotProjectListUpdated()));
connect(SessionManager::instance(), &SessionManager::projectAdded,
this, &CMakeLocatorFilter::slotProjectListUpdated);
connect(SessionManager::instance(), &SessionManager::projectRemoved,
this, &CMakeLocatorFilter::slotProjectListUpdated);
// Initialize the filter
slotProjectListUpdated();
}
CMakeLocatorFilter::~CMakeLocatorFilter()
{
}
void CMakeLocatorFilter::prepareSearch(const QString &entry)
{
m_result.clear();
......
......@@ -44,18 +44,17 @@ class CMakeLocatorFilter : public Core::ILocatorFilter
public:
CMakeLocatorFilter();
~CMakeLocatorFilter();
void prepareSearch(const QString &entry);
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry);
void accept(Core::LocatorFilterEntry selection) const;
void refresh(QFutureInterface<void> &future);
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection) const override;
void refresh(QFutureInterface<void> &future) override;
private slots:
void slotProjectListUpdated();
private:
QList<Core::LocatorFilterEntry> m_result;
void slotProjectListUpdated();
QList<Core::LocatorFilterEntry> m_result;
};
} // namespace Internal
......
......@@ -215,7 +215,7 @@ void CMakeOpenProjectWizard::setKit(Kit *kit)
NoKitPage::NoKitPage(CMakeOpenProjectWizard *cmakeWizard)
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
{
QVBoxLayout *layout = new QVBoxLayout;
auto layout = new QVBoxLayout;
setLayout(layout);
m_descriptionLabel = new QLabel(this);
......@@ -227,7 +227,7 @@ NoKitPage::NoKitPage(CMakeOpenProjectWizard *cmakeWizard)
connect(m_optionsButton, &QAbstractButton::clicked, this, &NoKitPage::showOptions);
QHBoxLayout *hbox = new QHBoxLayout;
auto hbox = new QHBoxLayout;
hbox->addWidget(m_optionsButton);
hbox->addStretch();
......@@ -272,7 +272,7 @@ InSourceBuildPage::InSourceBuildPage(CMakeOpenProjectWizard *cmakeWizard)
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
{
setLayout(new QVBoxLayout);
QLabel *label = new QLabel(this);
auto label = new QLabel(this);
label->setWordWrap(true);
label->setText(tr("Qt Creator has detected an <b>in-source-build in %1</b> "
"which prevents shadow builds. Qt Creator will not allow you to change the build directory. "
......@@ -285,10 +285,10 @@ InSourceBuildPage::InSourceBuildPage(CMakeOpenProjectWizard *cmakeWizard)
ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool change)
: QWizardPage(cmakeWizard), m_cmakeWizard(cmakeWizard)
{
QFormLayout *fl = new QFormLayout;
auto fl = new QFormLayout;
this->setLayout(fl);
QLabel *label = new QLabel(this);
auto label = new QLabel(this);
label->setWordWrap(true);
if (change)
label->setText(tr("Please enter the directory in which you want to build your project.") + QLatin1Char(' '));
......@@ -317,10 +317,9 @@ void ShadowBuildPage::buildDirectoryChanged()
// NoCMakePage
/////
NoCMakePage::NoCMakePage(CMakeOpenProjectWizard *cmakeWizard)
: QWizardPage(cmakeWizard)
NoCMakePage::NoCMakePage(CMakeOpenProjectWizard *cmakeWizard) : QWizardPage(cmakeWizard)
{
QVBoxLayout *layout = new QVBoxLayout;
auto layout = new QVBoxLayout;
setLayout(layout);
m_descriptionLabel = new QLabel(this);
......@@ -332,7 +331,7 @@ NoCMakePage::NoCMakePage(CMakeOpenProjectWizard *cmakeWizard)
connect(m_optionsButton, &QAbstractButton::clicked, this, &NoCMakePage::showOptions);
QHBoxLayout *hbox = new QHBoxLayout;
auto hbox = new QHBoxLayout;
hbox->addWidget(m_optionsButton);
hbox->addStretch();
......@@ -370,55 +369,48 @@ void NoCMakePage::showOptions()
CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, Mode mode,
const QString &buildDirectory, const QString &initialArguments,
const QString &kitName, const QString &buildConfigurationName)
: QWizardPage(cmakeWizard),
m_cmakeWizard(cmakeWizard),
m_haveCbpFile(false),
m_mode(mode),
m_buildDirectory(buildDirectory),
m_kitName(kitName),
m_buildConfigurationName(buildConfigurationName)
{
initWidgets();
m_argumentsLineEdit->setText(initialArguments);
}
void CMakeRunPage::initWidgets()
{
QFormLayout *fl = new QFormLayout;
const QString &kitName, const QString &buildConfigurationName) :
QWizardPage(cmakeWizard),
m_cmakeWizard(cmakeWizard),
m_descriptionLabel(new QLabel(this)),
m_argumentsLineEdit(new Utils::FancyLineEdit(this)),
m_generatorComboBox(new QComboBox(this)),
m_generatorExtraText(new QLabel(this)),
m_runCMake(new QPushButton(this)),
m_output(new QPlainTextEdit(this)),
m_exitCodeLabel(new QLabel(this)),
m_continueCheckBox(new QCheckBox(this)),
m_mode(mode),
m_buildDirectory(buildDirectory),
m_kitName(kitName),
m_buildConfigurationName(buildConfigurationName)
{
auto fl = new QFormLayout;
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
setLayout(fl);
// Description Label
m_descriptionLabel = new QLabel(this);
m_descriptionLabel->setWordWrap(true);
fl->addRow(m_descriptionLabel);
// Run CMake Line (with arguments)
m_argumentsLineEdit = new Utils::FancyLineEdit(this);
m_argumentsLineEdit->setHistoryCompleter(QLatin1String("CMakeArgumentsLineEdit"));
m_argumentsLineEdit->selectAll();
connect(m_argumentsLineEdit, &QLineEdit::returnPressed, this, &CMakeRunPage::runCMake);
fl->addRow(tr("Arguments:"), m_argumentsLineEdit);
m_generatorComboBox = new QComboBox(this);
fl->addRow(tr("Generator:"), m_generatorComboBox);
m_generatorExtraText = new QLabel(this);
fl->addRow(m_generatorExtraText);
m_runCMake = new QPushButton(this);
m_runCMake->setText(tr("Run CMake"));
connect(m_runCMake, &QAbstractButton::clicked, this, &CMakeRunPage::runCMake);