summaryrefslogtreecommitdiff
path: root/src/plugins/autotoolsprojectmanager
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2018-11-04 09:50:14 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2018-11-04 18:24:31 +0000
commitadf5305af620e2a70aa66780c5440344667c3c45 (patch)
tree08bc18c99fce1cdd192494d4d3a8cae7a12d3847 /src/plugins/autotoolsprojectmanager
parent24bcce4aa68754d2664bfd95458d85c29b7c9761 (diff)
downloadqt-creator-adf5305af620e2a70aa66780c5440344667c3c45.tar.gz
AutotoolsProjectManager: Modernize
modernize-use-nullptr modernize-use-override modernize-use-auto Change-Id: I7abab567a6dab1bde93c520aa8746380ae24fda8 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp12
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp2
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp4
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h2
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsproject.cpp2
-rw-r--r--src/plugins/autotoolsprojectmanager/makefileparser.cpp10
-rw-r--r--src/plugins/autotoolsprojectmanager/makefileparser.h2
-rw-r--r--src/plugins/autotoolsprojectmanager/makefileparserthread.h2
8 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp
index e303da1c9d..93f62323a1 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp
@@ -74,26 +74,26 @@ void AutotoolsBuildConfiguration::initialize(const BuildInfo *info)
// autogen.sh or autoreconf
QFile autogenFile(target()->project()->projectDirectory().toString() + "/autogen.sh");
if (autogenFile.exists()) {
- AutogenStep *autogenStep = new AutogenStep(buildSteps);
+ auto autogenStep = new AutogenStep(buildSteps);
buildSteps->appendStep(autogenStep);
} else {
- AutoreconfStep *autoreconfStep = new AutoreconfStep(buildSteps);
+ auto autoreconfStep = new AutoreconfStep(buildSteps);
buildSteps->appendStep(autoreconfStep);
}
// ./configure.
- ConfigureStep *configureStep = new ConfigureStep(buildSteps);
+ auto configureStep = new ConfigureStep(buildSteps);
buildSteps->appendStep(configureStep);
connect(this, &BuildConfiguration::buildDirectoryChanged,
configureStep, &ConfigureStep::notifyBuildDirectoryChanged);
// make
- MakeStep *makeStep = new MakeStep(buildSteps);
+ auto makeStep = new MakeStep(buildSteps);
buildSteps->appendStep(makeStep);
// ### Build Steps Clean ###
BuildStepList *cleanSteps = stepList(BUILDSTEPS_CLEAN);
- MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
+ auto cleanMakeStep = new MakeStep(cleanSteps);
cleanSteps->appendStep(cleanMakeStep);
}
@@ -133,7 +133,7 @@ QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableSetups(const Kit
BuildInfo *AutotoolsBuildConfigurationFactory::createBuildInfo(const Kit *k,
const Utils::FileName &buildDir) const
{
- BuildInfo *info = new BuildInfo(this);
+ auto info = new BuildInfo(this);
info->typeName = tr("Build");
info->buildDirectory = buildDir;
info->kitId = k->id();
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
index cf136546c3..08eb39d7ee 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
@@ -49,7 +49,7 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfigu
m_pathChooser(new Utils::PathChooser),
m_buildConfiguration(bc)
{
- QFormLayout *fl = new QFormLayout(this);
+ auto fl = new QFormLayout(this);
fl->setContentsMargins(0, 0, 0, 0);
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp
index 37a8d6fd92..cbfbe47173 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.cpp
@@ -75,7 +75,7 @@ void AutotoolsOpenProjectWizard::setBuildDirectory(const QString &directory)
BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *w) : QWizardPage(w),
m_pc(new Utils::PathChooser)
{
- QFormLayout *fl = new QFormLayout;
+ auto fl = new QFormLayout;
this->setLayout(fl);
QLabel *label = new QLabel(this);
@@ -86,7 +86,7 @@ BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *w) : QWizardPage(w),
"with different settings."));
fl->addWidget(label);
m_pc->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History"));
- AutotoolsOpenProjectWizard *wiz = static_cast<AutotoolsOpenProjectWizard *>(wizard());
+ auto wiz = static_cast<AutotoolsOpenProjectWizard *>(wizard());
m_pc->setBaseDirectory(wiz->sourceDirectory());
m_pc->setPath(wiz->buildDirectory());
connect(m_pc, &Utils::PathChooser::rawPathChanged, this, &BuildPathPage::buildDirectoryChanged);
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h
index ebd0a619e8..62eeab16d7 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h
+++ b/src/plugins/autotoolsprojectmanager/autotoolsopenprojectwizard.h
@@ -41,7 +41,7 @@ class AutotoolsOpenProjectWizard : public Utils::Wizard
public:
enum PageId { BuildPathPageId };
- AutotoolsOpenProjectWizard(const QString &sourceDirectory, QWidget *parent = 0);
+ AutotoolsOpenProjectWizard(const QString &sourceDirectory, QWidget *parent = nullptr);
QString buildDirectory() const;
QString sourceDirectory() const;
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
index fc4850b84f..4ea59f07a8 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
@@ -127,7 +127,7 @@ void AutotoolsProject::loadProjectTree()
this, &AutotoolsProject::makefileParsingFinished);
m_makefileParserThread->wait();
delete m_makefileParserThread;
- m_makefileParserThread = 0;
+ m_makefileParserThread = nullptr;
}
// Parse the makefile asynchronously in a thread
diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp
index 9c3e32216b..4587f7bacf 100644
--- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp
+++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp
@@ -56,7 +56,7 @@ bool MakefileParser::parse()
m_sources.clear();
m_makefiles.clear();
- QFile *file = new QFile(m_makefile);
+ auto file = new QFile(m_makefile);
if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning("%s: %s", qPrintable(m_makefile), qPrintable(file->errorString()));
delete file;
@@ -343,7 +343,7 @@ QStringList MakefileParser::directorySources(const QString &directory,
QStringList MakefileParser::targetValues(bool *hasVariables)
{
QStringList values;
- if (hasVariables != 0)
+ if (hasVariables)
*hasVariables = false;
const int index = m_line.indexOf(QLatin1Char('='));
@@ -366,7 +366,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
while (it != lineValues.end()) {
if ((*it).startsWith(QLatin1String("$("))) {
it = lineValues.erase(it);
- if (hasVariables != 0)
+ if (hasVariables)
*hasVariables = true;
} else {
++it;
@@ -400,9 +400,9 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
void MakefileParser::appendHeader(QStringList &list, const QDir &dir, const QString &fileName)
{
- const char *const headerExtensions[] = {".h", ".hh", ".hg", ".hxx", ".hpp", 0};
+ const char *const headerExtensions[] = {".h", ".hh", ".hg", ".hxx", ".hpp", nullptr};
int i = 0;
- while (headerExtensions[i] != 0) {
+ while (headerExtensions[i]) {
const QString headerFile = fileName + QLatin1String(headerExtensions[i]);
QFileInfo fileInfo(dir, headerFile);
if (fileInfo.exists())
diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h
index d6387bc29c..c9caec86ae 100644
--- a/src/plugins/autotoolsprojectmanager/makefileparser.h
+++ b/src/plugins/autotoolsprojectmanager/makefileparser.h
@@ -200,7 +200,7 @@ private:
* contained a variable like $(test). Note that all variables are not
* part of the return value, as they cannot get interpreted currently.
*/
- QStringList targetValues(bool *hasVariables = 0);
+ QStringList targetValues(bool *hasVariables = nullptr);
/**
* Adds recursively all sources of the current folder to m_sources and removes
diff --git a/src/plugins/autotoolsprojectmanager/makefileparserthread.h b/src/plugins/autotoolsprojectmanager/makefileparserthread.h
index 3e16bdccc4..fa300e8d35 100644
--- a/src/plugins/autotoolsprojectmanager/makefileparserthread.h
+++ b/src/plugins/autotoolsprojectmanager/makefileparserthread.h
@@ -56,7 +56,7 @@ public:
MakefileParserThread(const QString &makefile);
/** @see QThread::run() */
- void run();
+ void run() override;
/**
* @return List of sources that are set for the _SOURCES target.