forked from qt-creator/qt-creator
QmakeProjectManager: Modernize
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using modernize-use-equals-default Change-Id: I7642992eee6838bb2566921de87390c1771ebcbe Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Tobias Hunger
parent
02d46e6c2c
commit
cd5066d86b
@@ -87,9 +87,7 @@ AddLibraryWizard::AddLibraryWizard(const QString &fileName, QWidget *parent) :
|
||||
addPage(m_summaryPage);
|
||||
}
|
||||
|
||||
AddLibraryWizard::~AddLibraryWizard()
|
||||
{
|
||||
}
|
||||
AddLibraryWizard::~AddLibraryWizard() = default;
|
||||
|
||||
QString AddLibraryWizard::proFile() const
|
||||
{
|
||||
@@ -114,7 +112,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
|
||||
setTitle(tr("Library Type"));
|
||||
setSubTitle(tr("Choose the type of the library to link to"));
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
auto *layout = new QVBoxLayout(this);
|
||||
|
||||
m_internalRadio = new QRadioButton(tr("Internal library"), this);
|
||||
layout->addWidget(m_internalRadio);
|
||||
@@ -221,7 +219,7 @@ void DetailsPage::initializePage()
|
||||
{
|
||||
if (m_libraryDetailsController) {
|
||||
delete m_libraryDetailsController;
|
||||
m_libraryDetailsController = 0;
|
||||
m_libraryDetailsController = nullptr;
|
||||
}
|
||||
QString title;
|
||||
QString subTitle;
|
||||
@@ -269,7 +267,7 @@ SummaryPage::SummaryPage(AddLibraryWizard *parent)
|
||||
setTitle(tr("Summary"));
|
||||
setFinalPage(true);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
auto *layout = new QVBoxLayout(this);
|
||||
m_summaryLabel = new QLabel(this);
|
||||
m_snippetLabel = new QLabel(this);
|
||||
m_snippetLabel->setWordWrap(true);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Internal {
|
||||
// refuses placeholders and invalid characters.
|
||||
class ClassModel : public QStandardItemModel {
|
||||
public:
|
||||
explicit ClassModel(QObject *parent = 0);
|
||||
explicit ClassModel(QObject *parent = nullptr);
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
|
||||
void appendPlaceHolder() { appendClass(m_newClassPlaceHolder); }
|
||||
@@ -68,7 +68,7 @@ ClassModel::ClassModel(QObject *parent) :
|
||||
|
||||
void ClassModel::appendClass(const QString &c)
|
||||
{
|
||||
QStandardItem *item = new QStandardItem(c);
|
||||
auto *item = new QStandardItem(c);
|
||||
item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsEditable);
|
||||
appendRow(item);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
|
||||
m_ui->deleteButton->setEnabled(false);
|
||||
|
||||
// Disabled dummy for <new class> column>.
|
||||
ClassDefinition *dummy = new ClassDefinition;
|
||||
auto *dummy = new ClassDefinition;
|
||||
dummy->setFileNamingParameters(m_fileNamingParameters);
|
||||
dummy->setEnabled(false);
|
||||
m_tabStackLayout->addWidget(dummy);
|
||||
@@ -89,7 +89,7 @@ void CustomWidgetWidgetsWizardPage::slotCurrentRowChanged(int row)
|
||||
|
||||
void CustomWidgetWidgetsWizardPage::on_classList_classAdded(const QString &name)
|
||||
{
|
||||
ClassDefinition *cdef = new ClassDefinition;
|
||||
auto *cdef = new ClassDefinition;
|
||||
cdef->setFileNamingParameters(m_fileNamingParameters);
|
||||
const int index = m_uiClassDefs.count();
|
||||
m_tabStackLayout->insertWidget(index, cdef);
|
||||
|
||||
@@ -62,7 +62,7 @@ Core::BaseFileWizard *CustomWidgetWizard::create(QWidget *parent, const Core::Wi
|
||||
Core::GeneratedFiles CustomWidgetWizard::generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const
|
||||
{
|
||||
const CustomWidgetWizardDialog *cw = qobject_cast<const CustomWidgetWizardDialog *>(w);
|
||||
const auto *cw = qobject_cast<const CustomWidgetWizardDialog *>(w);
|
||||
Q_ASSERT(w);
|
||||
GenerationParameters p;
|
||||
p.fileName = cw->projectName();
|
||||
|
||||
@@ -98,7 +98,7 @@ AddLibraryWizard::MacLibraryType LibraryDetailsController::macLibraryType() cons
|
||||
void LibraryDetailsController::updateGui()
|
||||
{
|
||||
// read values from gui
|
||||
m_platforms = 0;
|
||||
m_platforms = nullptr;
|
||||
if (libraryDetailsWidget()->linCheckBox->isChecked())
|
||||
m_platforms |= AddLibraryWizard::LinuxPlatform;
|
||||
if (libraryDetailsWidget()->macCheckBox->isChecked())
|
||||
@@ -424,7 +424,7 @@ static QString generateLibsSnippet(AddLibraryWizard::Platforms platforms,
|
||||
| AddLibraryWizard::WindowsMSVCPlatform);
|
||||
|
||||
AddLibraryWizard::Platforms diffPlatforms = platforms ^ commonPlatforms;
|
||||
AddLibraryWizard::Platforms generatedPlatforms = 0;
|
||||
AddLibraryWizard::Platforms generatedPlatforms = nullptr;
|
||||
|
||||
QString snippetMessage;
|
||||
QTextStream str(&snippetMessage);
|
||||
@@ -510,7 +510,7 @@ static QString generatePreTargetDepsSnippet(AddLibraryWizard::Platforms platform
|
||||
QString snippetMessage;
|
||||
QTextStream str(&snippetMessage);
|
||||
str << "\n";
|
||||
AddLibraryWizard::Platforms generatedPlatforms = 0;
|
||||
AddLibraryWizard::Platforms generatedPlatforms = nullptr;
|
||||
AddLibraryWizard::Platforms windowsPlatforms = platforms
|
||||
& (AddLibraryWizard::WindowsMinGWPlatform | AddLibraryWizard::WindowsMSVCPlatform);
|
||||
AddLibraryWizard::Platforms commonPlatforms = platforms;
|
||||
@@ -843,7 +843,7 @@ bool PackageLibraryDetailsController::isLinkPackageGenerated() const
|
||||
if (!project)
|
||||
return false;
|
||||
|
||||
const QmakeProFileNode *rootProject = dynamic_cast<const QmakeProFileNode *>(project->rootProjectNode());
|
||||
const auto *rootProject = dynamic_cast<const QmakeProFileNode *>(project->rootProjectNode());
|
||||
if (!rootProject)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ void QmakeProjectManagerPlugin::testMakefileParser()
|
||||
|
||||
QCOMPARE(Utils::QtcProcess::splitArgs(parser.unparsedArguments()),
|
||||
Utils::QtcProcess::splitArgs(unparsedArguments));
|
||||
QCOMPARE(parser.effectiveBuildConfig(0), effectiveBuildConfig);
|
||||
QCOMPARE(parser.effectiveBuildConfig(nullptr), effectiveBuildConfig);
|
||||
|
||||
const QMakeStepConfig qmsc = parser.config();
|
||||
QCOMPARE(qmsc.archConfig, static_cast<QMakeStepConfig::TargetArchConfig>(archConfig));
|
||||
|
||||
@@ -135,7 +135,7 @@ void QmakeBuildConfiguration::initialize(const BuildInfo *info)
|
||||
BuildStepList *cleanSteps = stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
|
||||
cleanSteps->appendStep(new QmakeMakeStep(cleanSteps));
|
||||
|
||||
const QmakeBuildInfo *qmakeInfo = static_cast<const QmakeBuildInfo *>(info);
|
||||
const auto *qmakeInfo = static_cast<const QmakeBuildInfo *>(info);
|
||||
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
|
||||
|
||||
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
|
||||
@@ -163,9 +163,7 @@ void QmakeBuildConfiguration::initialize(const BuildInfo *info)
|
||||
updateCacheAndEmitEnvironmentChanged();
|
||||
}
|
||||
|
||||
QmakeBuildConfiguration::~QmakeBuildConfiguration()
|
||||
{
|
||||
}
|
||||
QmakeBuildConfiguration::~QmakeBuildConfiguration() = default;
|
||||
|
||||
QVariantMap QmakeBuildConfiguration::toMap() const
|
||||
{
|
||||
@@ -309,24 +307,24 @@ QStringList QmakeBuildConfiguration::configCommandLineArguments() const
|
||||
|
||||
QMakeStep *QmakeBuildConfiguration::qmakeStep() const
|
||||
{
|
||||
QMakeStep *qs = 0;
|
||||
QMakeStep *qs = nullptr;
|
||||
BuildStepList *bsl = stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
|
||||
Q_ASSERT(bsl);
|
||||
for (int i = 0; i < bsl->count(); ++i)
|
||||
if ((qs = qobject_cast<QMakeStep *>(bsl->at(i))) != 0)
|
||||
if ((qs = qobject_cast<QMakeStep *>(bsl->at(i))) != nullptr)
|
||||
return qs;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QmakeMakeStep *QmakeBuildConfiguration::makeStep() const
|
||||
{
|
||||
QmakeMakeStep *ms = 0;
|
||||
QmakeMakeStep *ms = nullptr;
|
||||
BuildStepList *bsl = stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
|
||||
Q_ASSERT(bsl);
|
||||
for (int i = 0; i < bsl->count(); ++i)
|
||||
if ((ms = qobject_cast<QmakeMakeStep *>(bsl->at(i))) != 0)
|
||||
if ((ms = qobject_cast<QmakeMakeStep *>(bsl->at(i))) != nullptr)
|
||||
return ms;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Returns true if both are equal.
|
||||
@@ -563,7 +561,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
BuildConfiguration::BuildType type) const
|
||||
{
|
||||
BaseQtVersion *version = QtKitInformation::qtVersion(k);
|
||||
QmakeBuildInfo *info = new QmakeBuildInfo(this);
|
||||
auto *info = new QmakeBuildInfo(this);
|
||||
QString suffix;
|
||||
if (type == BuildConfiguration::Release) {
|
||||
//: The name of the release build configuration created by default for a qmake project.
|
||||
@@ -675,7 +673,7 @@ void QmakeBuildConfiguration::setupBuildEnvironment(Kit *k, Environment &env)
|
||||
env.prependOrSetPath(qt->binPath().toString());
|
||||
}
|
||||
|
||||
QmakeBuildConfiguration::LastKitState::LastKitState() { }
|
||||
QmakeBuildConfiguration::LastKitState::LastKitState() = default;
|
||||
|
||||
QmakeBuildConfiguration::LastKitState::LastKitState(Kit *k)
|
||||
: m_qtVersion(QtKitInformation::qtVersionId(k)),
|
||||
|
||||
@@ -203,7 +203,7 @@ QmakeProFileNode *QmakeProFileNode::findProFileFor(const FileName &fileName) con
|
||||
if (fileName == filePath())
|
||||
return const_cast<QmakeProFileNode *>(this);
|
||||
for (Node *node : nodes()) {
|
||||
if (QmakeProFileNode *qmakeProFileNode = dynamic_cast<QmakeProFileNode *>(node))
|
||||
if (auto *qmakeProFileNode = dynamic_cast<QmakeProFileNode *>(node))
|
||||
if (QmakeProFileNode *result = qmakeProFileNode->findProFileFor(fileName))
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ void QmakePriFile::processValues(QmakePriFileEvalResult &result)
|
||||
}
|
||||
|
||||
for (int i = 0; i < static_cast<int>(FileType::FileTypeSize); ++i) {
|
||||
FileType type = static_cast<FileType>(i);
|
||||
auto type = static_cast<FileType>(i);
|
||||
QSet<FileName> &foundFiles = result.foundFiles[type];
|
||||
result.recursiveEnumerateFiles.subtract(foundFiles);
|
||||
QSet<FileName> newFilePaths = filterFilesProVariables(type, foundFiles);
|
||||
@@ -355,7 +355,7 @@ void QmakePriFile::update(const Internal::QmakePriFileEvalResult &result)
|
||||
watchFolders(result.folders);
|
||||
|
||||
for (int i = 0; i < static_cast<int>(FileType::FileTypeSize); ++i) {
|
||||
const FileType type = static_cast<FileType>(i);
|
||||
const auto type = static_cast<FileType>(i);
|
||||
m_files[type] = result.foundFiles.value(type);
|
||||
}
|
||||
}
|
||||
@@ -403,7 +403,7 @@ bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet<FileNa
|
||||
|
||||
// Apply the differences per file type
|
||||
for (int i = 0; i < static_cast<int>(FileType::FileTypeSize); ++i) {
|
||||
FileType type = static_cast<FileType>(i);
|
||||
auto type = static_cast<FileType>(i);
|
||||
QSet<FileName> add = filterFilesRecursiveEnumerata(type, addedFiles);
|
||||
QSet<FileName> remove = filterFilesRecursiveEnumerata(type, removedFiles);
|
||||
|
||||
@@ -508,7 +508,7 @@ bool QmakePriFile::addFiles(const QStringList &filePaths, QStringList *notAdded)
|
||||
// So it's obviously a bit limited, but in those cases you need to edit the
|
||||
// project files manually anyway.
|
||||
|
||||
typedef QMap<QString, QStringList> TypeFileMap;
|
||||
using TypeFileMap = QMap<QString, QStringList>;
|
||||
// Split into lists by file type and bulk-add them.
|
||||
TypeFileMap typeFileMap;
|
||||
foreach (const QString &file, filePaths) {
|
||||
@@ -555,7 +555,7 @@ bool QmakePriFile::removeFiles(const QStringList &filePaths,
|
||||
QStringList *notRemoved)
|
||||
{
|
||||
QStringList failedFiles;
|
||||
typedef QMap<QString, QStringList> TypeFileMap;
|
||||
using TypeFileMap = QMap<QString, QStringList>;
|
||||
// Split into lists by file type and bulk-add them.
|
||||
TypeFileMap typeFileMap;
|
||||
foreach (const QString &file, filePaths) {
|
||||
@@ -1176,7 +1176,7 @@ void QmakeProFile::setValidParseRecursive(bool b)
|
||||
{
|
||||
m_validParse = b;
|
||||
foreach (QmakePriFile *c, children()) {
|
||||
if (QmakeProFile *node = dynamic_cast<QmakeProFile *>(c))
|
||||
if (auto *node = dynamic_cast<QmakeProFile *>(c))
|
||||
node->setValidParseRecursive(b);
|
||||
}
|
||||
}
|
||||
@@ -1275,7 +1275,7 @@ static bool evaluateOne(const QmakeEvalInput &input, ProFile *pro,
|
||||
|
||||
QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
|
||||
{
|
||||
QmakeEvalResult *result = new QmakeEvalResult;
|
||||
auto *result = new QmakeEvalResult;
|
||||
QtSupport::ProFileReader *exactBuildPassReader = nullptr;
|
||||
QtSupport::ProFileReader *cumulativeBuildPassReader = nullptr;
|
||||
ProFile *pro;
|
||||
@@ -1387,7 +1387,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
|
||||
= baseVPaths(cumulativeReader, input.projectDir, input.buildDirectory.toString());
|
||||
|
||||
for (int i = 0; i < static_cast<int>(FileType::FileTypeSize); ++i) {
|
||||
const FileType type = static_cast<FileType>(i);
|
||||
const auto type = static_cast<FileType>(i);
|
||||
const QStringList qmakeVariables = varNames(type, exactReader);
|
||||
foreach (const QString &qmakeVariable, qmakeVariables) {
|
||||
QHash<ProString, bool> handled;
|
||||
@@ -1587,14 +1587,14 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult)
|
||||
continue; // Do nothing
|
||||
|
||||
if (priFile->proFile) {
|
||||
QmakePriFile *qmakePriFileNode = new QmakePriFile(m_project, this, priFile->name);
|
||||
auto *qmakePriFileNode = new QmakePriFile(m_project, this, priFile->name);
|
||||
pn->addChild(qmakePriFileNode);
|
||||
qmakePriFileNode->setIncludedInExactParse(
|
||||
(result->state == QmakeEvalResult::EvalOk) && pn->includedInExactParse());
|
||||
qmakePriFileNode->update(priFile->result);
|
||||
toCompare.append(qMakePair(qmakePriFileNode, priFile));
|
||||
} else {
|
||||
QmakeProFile *qmakeProFileNode = new QmakeProFile(m_project, priFile->name);
|
||||
auto *qmakeProFileNode = new QmakeProFile(m_project, priFile->name);
|
||||
pn->addChild(qmakeProFileNode);
|
||||
qmakeProFileNode->setIncludedInExactParse(
|
||||
result->exactSubdirs.contains(qmakeProFileNode->filePath())
|
||||
|
||||
@@ -624,7 +624,7 @@ static FolderNode *folderOf(FolderNode *in, const FileName &fileName)
|
||||
static FileNode *fileNodeOf(FolderNode *in, const FileName &fileName)
|
||||
{
|
||||
for (FolderNode *folder = folderOf(in, fileName); folder; folder = folder->parentFolderNode()) {
|
||||
if (QmakeProFileNode *proFile = dynamic_cast<QmakeProFileNode *>(folder)) {
|
||||
if (auto *proFile = dynamic_cast<QmakeProFileNode *>(folder)) {
|
||||
foreach (FileNode *fileNode, proFile->fileNodes()) {
|
||||
if (fileNode->filePath() == fileName)
|
||||
return fileNode;
|
||||
|
||||
@@ -53,7 +53,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
||||
Utils::FileUtils::qmakeFriendlyName(bc->displayName()),
|
||||
bc->buildType());
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||
auto *vbox = new QVBoxLayout(this);
|
||||
vbox->setMargin(0);
|
||||
m_detailsContainer = new Utils::DetailsWidget(this);
|
||||
m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
|
||||
@@ -97,7 +97,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
||||
connect(m_ui->shadowBuildDirEdit, &Utils::PathChooser::rawPathChanged,
|
||||
this, &QmakeProjectConfigWidget::shadowBuildEdited);
|
||||
|
||||
QmakeProject *project = static_cast<QmakeProject *>(bc->target()->project());
|
||||
auto *project = static_cast<QmakeProject *>(bc->target()->project());
|
||||
project->subscribeSignal(&BuildConfiguration::environmentChanged, this, [this]() {
|
||||
if (static_cast<BuildConfiguration *>(sender())->isActive())
|
||||
environmentChanged();
|
||||
@@ -216,7 +216,7 @@ void QmakeProjectConfigWidget::updateProblemLabel()
|
||||
return;
|
||||
}
|
||||
|
||||
QmakeProject *p = static_cast<QmakeProject *>(m_buildConfiguration->target()->project());
|
||||
auto *p = static_cast<QmakeProject *>(m_buildConfiguration->target()->project());
|
||||
if (p->rootProFile()->parseInProgress() || !p->rootProFile()->validParse()) {
|
||||
setProblemLabel(QString());
|
||||
return;
|
||||
|
||||
@@ -198,7 +198,7 @@ QList<void *> QmakeProjectImporter::examineDirectory(const FileName &importPath)
|
||||
|
||||
bool QmakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
|
||||
{
|
||||
DirectoryData *data = static_cast<DirectoryData *>(directoryData);
|
||||
auto *data = static_cast<DirectoryData *>(directoryData);
|
||||
const QLoggingCategory &logs = MakeFileParse::logging();
|
||||
|
||||
BaseQtVersion *kitVersion = QtKitInformation::qtVersion(k);
|
||||
@@ -225,14 +225,14 @@ bool QmakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
|
||||
|
||||
Kit *QmakeProjectImporter::createKit(void *directoryData) const
|
||||
{
|
||||
DirectoryData *data = static_cast<DirectoryData *>(directoryData);
|
||||
auto *data = static_cast<DirectoryData *>(directoryData);
|
||||
return createTemporaryKit(data->qtVersionData, data->parsedSpec, data->archConfig, data->osType);
|
||||
}
|
||||
|
||||
QList<BuildInfo *> QmakeProjectImporter::buildInfoListForKit(const Kit *k, void *directoryData) const
|
||||
{
|
||||
QList<BuildInfo *> result;
|
||||
DirectoryData *data = static_cast<DirectoryData *>(directoryData);
|
||||
auto *data = static_cast<DirectoryData *>(directoryData);
|
||||
auto factory = qobject_cast<QmakeBuildConfigurationFactory *>(
|
||||
IBuildConfigurationFactory::find(k, projectFilePath().toString()));
|
||||
if (!factory)
|
||||
|
||||
@@ -148,13 +148,13 @@ void QmakeManager::runQMakeImpl(ProjectExplorer::Project *p, ProjectExplorer::No
|
||||
{
|
||||
if (!ProjectExplorerPlugin::saveModifiedFiles())
|
||||
return;
|
||||
QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(p);
|
||||
auto *qmakeProject = qobject_cast<QmakeProject *>(p);
|
||||
QTC_ASSERT(qmakeProject, return);
|
||||
|
||||
if (!qmakeProject->activeTarget() || !qmakeProject->activeTarget()->activeBuildConfiguration())
|
||||
return;
|
||||
|
||||
QmakeBuildConfiguration *bc = static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration());
|
||||
auto *bc = static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration());
|
||||
QMakeStep *qs = bc->qmakeStep();
|
||||
if (!qs)
|
||||
return;
|
||||
@@ -163,11 +163,11 @@ void QmakeManager::runQMakeImpl(ProjectExplorer::Project *p, ProjectExplorer::No
|
||||
qs->setForced(true);
|
||||
|
||||
if (node && node != qmakeProject->rootProjectNode())
|
||||
if (QmakeProFileNode *profile = dynamic_cast<QmakeProFileNode *>(node))
|
||||
if (auto *profile = dynamic_cast<QmakeProFileNode *>(node))
|
||||
bc->setSubNodeBuild(profile);
|
||||
|
||||
BuildManager::appendStep(qs, tr("QMake"));
|
||||
bc->setSubNodeBuild(0);
|
||||
bc->setSubNodeBuild(nullptr);
|
||||
}
|
||||
|
||||
void QmakeManager::buildSubDirContextMenu()
|
||||
@@ -218,14 +218,14 @@ void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isF
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(target->activeBuildConfiguration());
|
||||
auto *bc = qobject_cast<QmakeBuildConfiguration *>(target->activeBuildConfiguration());
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
if (!contextNode || !buildableFile)
|
||||
isFileBuild = false;
|
||||
|
||||
if (QmakePriFileNode *prifile = dynamic_cast<QmakePriFileNode *>(contextNode)) {
|
||||
if (auto *prifile = dynamic_cast<QmakePriFileNode *>(contextNode)) {
|
||||
if (QmakeProFileNode *profile = prifile->proFileNode()) {
|
||||
if (profile != contextProject->rootProjectNode() || isFileBuild)
|
||||
bc->setSubNodeBuild(profile->proFileNode());
|
||||
@@ -252,8 +252,8 @@ void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isF
|
||||
}
|
||||
}
|
||||
|
||||
bc->setSubNodeBuild(0);
|
||||
bc->setFileNodeBuild(0);
|
||||
bc->setSubNodeBuild(nullptr);
|
||||
bc->setFileNodeBuild(nullptr);
|
||||
}
|
||||
|
||||
} // namespace QmakeProjectManager
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Internal {
|
||||
class QmakeProjectManagerPluginPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
~QmakeProjectManagerPluginPrivate();
|
||||
~QmakeProjectManagerPluginPrivate() override;
|
||||
|
||||
void projectChanged();
|
||||
void activeTargetChanged();
|
||||
@@ -371,10 +371,10 @@ void QmakeProjectManagerPluginPrivate::updateContextActions()
|
||||
Project *project = ProjectTree::currentProject();
|
||||
|
||||
const ContainerNode *containerNode = node ? node->asContainerNode() : nullptr;
|
||||
const QmakeProFileNode *proFileNode = dynamic_cast<const QmakeProFileNode *>(containerNode ? containerNode->rootProjectNode() : node);
|
||||
const auto *proFileNode = dynamic_cast<const QmakeProFileNode *>(containerNode ? containerNode->rootProjectNode() : node);
|
||||
|
||||
m_addLibraryActionContextMenu->setEnabled(proFileNode);
|
||||
QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(QmakeManager::contextProject());
|
||||
auto *qmakeProject = qobject_cast<QmakeProject *>(QmakeManager::contextProject());
|
||||
QmakeProFileNode *subProjectNode = nullptr;
|
||||
disableBuildFileMenus();
|
||||
if (node) {
|
||||
|
||||
@@ -305,7 +305,7 @@ bool QMakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status)
|
||||
bool result = AbstractProcessStep::processSucceeded(exitCode, status);
|
||||
if (!result)
|
||||
m_needToRunQMake = true;
|
||||
QmakeProject *project = static_cast<QmakeProject *>(qmakeBuildConfiguration()->target()->project());
|
||||
auto *project = static_cast<QmakeProject *>(qmakeBuildConfiguration()->target()->project());
|
||||
project->emitBuildDirectoryInitialized();
|
||||
return result;
|
||||
}
|
||||
@@ -353,7 +353,7 @@ void QMakeStep::runNextCommand()
|
||||
return;
|
||||
case State::RUN_MAKE_QMAKE_ALL:
|
||||
{
|
||||
GnuMakeParser *parser = new GnuMakeParser;
|
||||
auto *parser = new GnuMakeParser;
|
||||
parser->setWorkingDirectory(processParameters()->workingDirectory());
|
||||
setOutputParser(parser);
|
||||
m_nextState = State::POST_PROCESS;
|
||||
@@ -450,7 +450,7 @@ void QMakeStep::setSeparateDebugInfo(bool enable)
|
||||
|
||||
QString QMakeStep::makeCommand() const
|
||||
{
|
||||
MakeStep *ms = qobject_cast<BuildStepList *>(parent())->firstOfType<MakeStep>();
|
||||
auto *ms = qobject_cast<BuildStepList *>(parent())->firstOfType<MakeStep>();
|
||||
return ms ? ms->effectiveMakeCommand() : QString();
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ void QMakeStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked)
|
||||
|
||||
void QMakeStepConfigWidget::askForRebuild(const QString &title)
|
||||
{
|
||||
QMessageBox *question = new QMessageBox(Core::ICore::mainWindow());
|
||||
auto *question = new QMessageBox(Core::ICore::mainWindow());
|
||||
question->setWindowTitle(title);
|
||||
question->setText(tr("The option will only take effect if the project is recompiled. Do you want to recompile now?"));
|
||||
question->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
@@ -169,7 +169,7 @@ static inline const item *itemForModule(const QString &module)
|
||||
foreach (const item *i, staticQtModuleInfo()->items)
|
||||
if (QLatin1String(i->config) == module)
|
||||
return i;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString QtModulesInfo::moduleName(const QString &module)
|
||||
|
||||
@@ -46,7 +46,7 @@ FilesPage::FilesPage(QWidget *parent) :
|
||||
"for which you want to generate skeleton source code files."));
|
||||
label->setWordWrap(true);
|
||||
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
auto *vlayout = new QVBoxLayout;
|
||||
vlayout->addWidget(label);
|
||||
vlayout->addItem(new QSpacerItem(0, 20));
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ static inline bool generateFormClass(const GuiAppParameters ¶ms,
|
||||
Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const
|
||||
{
|
||||
const GuiAppWizardDialog *dialog = qobject_cast<const GuiAppWizardDialog *>(w);
|
||||
const auto *dialog = qobject_cast<const GuiAppWizardDialog *>(w);
|
||||
const QtProjectParameters projectParams = dialog->projectParameters();
|
||||
const QString projectPath = projectParams.projectPath();
|
||||
const GuiAppParameters params = dialog->parameters();
|
||||
|
||||
@@ -76,7 +76,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
||||
QString *errorMessage) const
|
||||
{
|
||||
Q_UNUSED(errorMessage)
|
||||
const LibraryWizardDialog *dialog = qobject_cast<const LibraryWizardDialog *>(w);
|
||||
const auto *dialog = qobject_cast<const LibraryWizardDialog *>(w);
|
||||
const QtProjectParameters projectParams = dialog->parameters();
|
||||
const QString projectPath = projectParams.projectPath();
|
||||
const LibraryParameters params = dialog->libraryParameters();
|
||||
|
||||
@@ -53,15 +53,15 @@ struct PluginBaseClasses {
|
||||
static const PluginBaseClasses pluginBaseClasses[] =
|
||||
{
|
||||
{"QAccessiblePlugin", "QtGui", "QtCore", "accessible", "QAccessibleFactoryInterface"},
|
||||
{"QDecorationPlugin", "QtGui", "QtCore", 0, 0}, // Qt 4 only.
|
||||
{"QDecorationPlugin", "QtGui", "QtCore", nullptr, nullptr}, // Qt 4 only.
|
||||
{"QGenericPlugin", "QtGui", "QtCore", "generic", "QGenericPluginFactoryInterface"},
|
||||
{"QIconEnginePluginV2", "QtGui", "QtCore", "imageformats", 0}, // Qt 4 only.
|
||||
{"QIconEnginePluginV2", "QtGui", "QtCore", "imageformats", nullptr}, // Qt 4 only.
|
||||
{"QIconEnginePlugin", "QtGui", "QtCore", "imageformats", "QIconEngineFactoryInterface"},
|
||||
{"QImageIOPlugin", "QtGui", "QtCore", "imageformats", "QImageIOHandlerFactoryInterface"},
|
||||
{"QScriptExtensionPlugin", "QtScript", "QtCore", 0, "QScriptExtensionInterface"},
|
||||
{"QScriptExtensionPlugin", "QtScript", "QtCore", nullptr, "QScriptExtensionInterface"},
|
||||
{"QSqlDriverPlugin", "QtSql", "QtCore", "sqldrivers", "QSqlDriverFactoryInterface"},
|
||||
{"QStylePlugin", "QtGui", "QtCore", "styles", "QStyleFactoryInterface"},
|
||||
{"QTextCodecPlugin", "QtCore", 0, "codecs", 0} // Qt 4 only.
|
||||
{"QTextCodecPlugin", "QtCore", nullptr, "codecs", nullptr} // Qt 4 only.
|
||||
};
|
||||
|
||||
enum { defaultPluginBaseClass = 2 };
|
||||
@@ -72,7 +72,7 @@ static const PluginBaseClasses *findPluginBaseClass(const QString &name)
|
||||
for (int i = 0; i < pluginBaseClassCount; i++)
|
||||
if (name == QLatin1String(pluginBaseClasses[i].name))
|
||||
return pluginBaseClasses + i;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// return dependencies of a plugin as a line ready for the 'QT=' line in a pro
|
||||
@@ -96,7 +96,7 @@ static QStringList pluginDependencies(const PluginBaseClasses *plb)
|
||||
class LibraryIntroPage : public Utils::ProjectIntroPage
|
||||
{
|
||||
public:
|
||||
explicit LibraryIntroPage(QWidget *parent = 0);
|
||||
explicit LibraryIntroPage(QWidget *parent = nullptr);
|
||||
|
||||
QtProjectParameters::Type type() const;
|
||||
|
||||
@@ -154,7 +154,7 @@ LibraryWizardDialog::LibraryWizardDialog(const Core::BaseFileWizardFactory *fact
|
||||
m_filesPageId = addPage(m_filesPage);
|
||||
|
||||
Utils::WizardProgressItem *introItem = wizardProgress()->item(startId());
|
||||
Utils::WizardProgressItem *targetItem = 0;
|
||||
Utils::WizardProgressItem *targetItem = nullptr;
|
||||
if (m_targetPageId != -1)
|
||||
targetItem = wizardProgress()->item(m_targetPageId);
|
||||
Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId);
|
||||
@@ -165,11 +165,11 @@ LibraryWizardDialog::LibraryWizardDialog(const Core::BaseFileWizardFactory *fact
|
||||
if (m_targetPageId != -1) {
|
||||
targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||
<< modulesItem << filesItem);
|
||||
targetItem->setNextShownItem(0);
|
||||
targetItem->setNextShownItem(nullptr);
|
||||
} else {
|
||||
introItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||
<< modulesItem << filesItem);
|
||||
introItem->setNextShownItem(0);
|
||||
introItem->setNextShownItem(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void LibraryWizardDialog::cleanupPage(int id)
|
||||
{
|
||||
if (m_targetPageId != -1 && id == m_targetPageId) {
|
||||
Utils::WizardProgressItem *targetsItem = wizardProgress()->item(m_targetPageId);
|
||||
targetsItem->setNextShownItem(0);
|
||||
targetsItem->setNextShownItem(nullptr);
|
||||
}
|
||||
BaseQmakeProjectWizardDialog::cleanupPage(id);
|
||||
}
|
||||
|
||||
@@ -48,11 +48,11 @@ ModulesPage::ModulesPage(QWidget *parent)
|
||||
"project. The recommended modules for this project are selected by default."));
|
||||
label->setWordWrap(true);
|
||||
|
||||
QVBoxLayout *vlayout = new QVBoxLayout();
|
||||
auto *vlayout = new QVBoxLayout();
|
||||
vlayout->addWidget(label);
|
||||
vlayout->addItem(new QSpacerItem(0, 20));
|
||||
|
||||
QGridLayout *layout = new QGridLayout;
|
||||
auto *layout = new QGridLayout;
|
||||
|
||||
const QStringList &modulesList = QtModulesInfo::modules();
|
||||
int moduleId = 0;
|
||||
|
||||
@@ -88,7 +88,7 @@ bool QtWizard::qt4ProjectPostGenerateFiles(const QWizard *w,
|
||||
const Core::GeneratedFiles &generatedFiles,
|
||||
QString *errorMessage)
|
||||
{
|
||||
const BaseQmakeProjectWizardDialog *dialog = qobject_cast<const BaseQmakeProjectWizardDialog *>(w);
|
||||
const auto *dialog = qobject_cast<const BaseQmakeProjectWizardDialog *>(w);
|
||||
|
||||
// Generate user settings
|
||||
foreach (const Core::GeneratedFile &file, generatedFiles)
|
||||
@@ -118,14 +118,12 @@ bool QtWizard::lowerCaseFiles()
|
||||
}
|
||||
|
||||
// ------------ CustomQmakeProjectWizard
|
||||
CustomQmakeProjectWizard::CustomQmakeProjectWizard()
|
||||
{
|
||||
}
|
||||
CustomQmakeProjectWizard::CustomQmakeProjectWizard() = default;
|
||||
|
||||
Core::BaseFileWizard *CustomQmakeProjectWizard::create(QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) const
|
||||
{
|
||||
BaseQmakeProjectWizardDialog *wizard = new BaseQmakeProjectWizardDialog(this, false, parent,
|
||||
auto *wizard = new BaseQmakeProjectWizardDialog(this, false, parent,
|
||||
parameters);
|
||||
|
||||
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)))
|
||||
@@ -146,8 +144,6 @@ BaseQmakeProjectWizardDialog::BaseQmakeProjectWizardDialog(const Core::BaseFileW
|
||||
bool showModulesPage, QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) :
|
||||
ProjectExplorer::BaseProjectWizardDialog(factory, parent, parameters),
|
||||
m_modulesPage(0),
|
||||
m_targetSetupPage(0),
|
||||
m_profileIds(parameters.extraValues().value(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||
.value<QList<Core::Id> >())
|
||||
{
|
||||
@@ -160,8 +156,6 @@ BaseQmakeProjectWizardDialog::BaseQmakeProjectWizardDialog(const Core::BaseFileW
|
||||
int introId, QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) :
|
||||
ProjectExplorer::BaseProjectWizardDialog(factory, introPage, introId, parent, parameters),
|
||||
m_modulesPage(0),
|
||||
m_targetSetupPage(0),
|
||||
m_profileIds(parameters.extraValues().value(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS))
|
||||
.value<QList<Core::Id> >())
|
||||
{
|
||||
|
||||
@@ -134,8 +134,8 @@ private:
|
||||
|
||||
inline void init(bool showModulesPage);
|
||||
|
||||
ModulesPage *m_modulesPage;
|
||||
ProjectExplorer::TargetSetupPage *m_targetSetupPage;
|
||||
ModulesPage *m_modulesPage = nullptr;
|
||||
ProjectExplorer::TargetSetupPage *m_targetSetupPage = nullptr;
|
||||
QStringList m_selectedModules;
|
||||
QStringList m_deselectedModules;
|
||||
QList<Core::Id> m_profileIds;
|
||||
|
||||
@@ -68,7 +68,7 @@ Core::BaseFileWizard *SubdirsProjectWizard::create(QWidget *parent,
|
||||
Core::GeneratedFiles SubdirsProjectWizard::generateFiles(const QWizard *w,
|
||||
QString * /*errorMessage*/) const
|
||||
{
|
||||
const SubdirsProjectWizardDialog *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w);
|
||||
const auto *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w);
|
||||
const QtProjectParameters params = wizard->parameters();
|
||||
const QString projectPath = params.projectPath();
|
||||
const QString profileName = Core::BaseFileWizardFactory::buildFileName(projectPath, params.fileName, profileSuffix());
|
||||
@@ -82,7 +82,7 @@ Core::GeneratedFiles SubdirsProjectWizard::generateFiles(const QWizard *w,
|
||||
bool SubdirsProjectWizard::postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &files,
|
||||
QString *errorMessage) const
|
||||
{
|
||||
const SubdirsProjectWizardDialog *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w);
|
||||
const auto *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w);
|
||||
if (QtWizard::qt4ProjectPostGenerateFiles(wizard, files, errorMessage)) {
|
||||
const QtProjectParameters params = wizard->parameters();
|
||||
const QString projectPath = params.projectPath();
|
||||
|
||||
Reference in New Issue
Block a user