forked from qt-creator/qt-creator
QbsProjectManager: Modernize
modernize-use-auto modernize-use-nullptr modernize-use-override Change-Id: I8a67b87e614f54554f9ca50c9f5e3f3297458ec1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -45,10 +45,10 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
|
||||
int currentRow = 0;
|
||||
for (QVariantMap::ConstIterator it = properties.constBegin(); it != properties.constEnd();
|
||||
++it) {
|
||||
QTableWidgetItem * const nameItem = new QTableWidgetItem;
|
||||
auto * const nameItem = new QTableWidgetItem;
|
||||
nameItem->setData(Qt::DisplayRole, it.key());
|
||||
m_ui->propertiesTable->setItem(currentRow, 0, nameItem);
|
||||
QTableWidgetItem * const valueItem = new QTableWidgetItem;
|
||||
auto * const valueItem = new QTableWidgetItem;
|
||||
valueItem->setData(Qt::DisplayRole, qbs::settingsValueToRepresentation(it.value()));
|
||||
m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
|
||||
++currentRow;
|
||||
|
@@ -37,10 +37,10 @@ class CustomQbsPropertiesDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CustomQbsPropertiesDialog(const QVariantMap &properties, QWidget *parent = 0);
|
||||
explicit CustomQbsPropertiesDialog(const QVariantMap &properties, QWidget *parent = nullptr);
|
||||
|
||||
QVariantMap properties() const;
|
||||
~CustomQbsPropertiesDialog();
|
||||
~CustomQbsPropertiesDialog() override;
|
||||
|
||||
private:
|
||||
void addProperty();
|
||||
|
@@ -296,7 +296,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
|
||||
}
|
||||
data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFileInfo.absolutePath());
|
||||
|
||||
if (ProjectExplorer::GccToolChain *gcc = dynamic_cast<ProjectExplorer::GccToolChain *>(mainTc)) {
|
||||
if (auto gcc = dynamic_cast<ProjectExplorer::GccToolChain *>(mainTc)) {
|
||||
QStringList compilerFlags = gcc->platformCodeGenFlags();
|
||||
filterCompilerLinkerFlags(targetAbi, compilerFlags);
|
||||
data.insert(QLatin1String(CPP_PLATFORMCOMMONCOMPILERFLAGS), compilerFlags);
|
||||
|
@@ -35,8 +35,9 @@ class DefaultPropertyProvider : public PropertyProvider
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
bool canHandle(const ProjectExplorer::Kit *k) const { return k; }
|
||||
QVariantMap properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const;
|
||||
bool canHandle(const ProjectExplorer::Kit *k) const override { return k; }
|
||||
QVariantMap properties(const ProjectExplorer::Kit *k,
|
||||
const QVariantMap &defaultData) const override;
|
||||
|
||||
private:
|
||||
QVariantMap autoGeneratedProperties(const ProjectExplorer::Kit *k,
|
||||
|
@@ -40,7 +40,7 @@ class QBSPROJECTMANAGER_EXPORT PropertyProvider : public QObject
|
||||
|
||||
public:
|
||||
PropertyProvider();
|
||||
~PropertyProvider();
|
||||
~PropertyProvider() override;
|
||||
|
||||
virtual bool canHandle(const ProjectExplorer::Kit *k) const = 0;
|
||||
virtual QVariantMap properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const = 0;
|
||||
|
@@ -85,7 +85,7 @@ void QbsBuildConfiguration::initialize(const BuildInfo *info)
|
||||
{
|
||||
BuildConfiguration::initialize(info);
|
||||
|
||||
const QbsBuildInfo * const bi = static_cast<const QbsBuildInfo *>(info);
|
||||
const auto * const bi = static_cast<const QbsBuildInfo *>(info);
|
||||
QVariantMap configData = bi->config;
|
||||
configData.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY),
|
||||
(info->buildType == BuildConfiguration::Debug)
|
||||
@@ -136,7 +136,7 @@ bool QbsBuildConfiguration::fromMap(const QVariantMap &map)
|
||||
BuildStepList *bsl = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
// Fix up the existing build steps:
|
||||
for (int i = 0; i < bsl->count(); ++i) {
|
||||
QbsBuildStep *bs = qobject_cast<QbsBuildStep *>(bsl->at(i));
|
||||
auto bs = qobject_cast<QbsBuildStep *>(bsl->at(i));
|
||||
if (bs)
|
||||
connect(bs, &QbsBuildStep::qbsConfigurationChanged, this, &QbsBuildConfiguration::qbsConfigurationChanged);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ Internal::QbsProject *QbsBuildConfiguration::project() const
|
||||
IOutputParser *QbsBuildConfiguration::createOutputParser() const
|
||||
{
|
||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
return tc ? tc->outputParser() : 0;
|
||||
return tc ? tc->outputParser() : nullptr;
|
||||
}
|
||||
|
||||
bool QbsBuildConfiguration::isEnabled() const
|
||||
|
@@ -49,16 +49,16 @@ QbsBuildConfigurationWidget::QbsBuildConfigurationWidget(QbsProjectManager::Inte
|
||||
connect(bc, &ProjectExplorer::BuildConfiguration::environmentChanged,
|
||||
this, &QbsBuildConfigurationWidget::environmentHasChanged);
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||
auto vbox = new QVBoxLayout(this);
|
||||
vbox->setMargin(0);
|
||||
Utils::DetailsWidget *container = new Utils::DetailsWidget(this);
|
||||
auto container = new Utils::DetailsWidget(this);
|
||||
container->setState(Utils::DetailsWidget::NoSummary);
|
||||
vbox->addWidget(container);
|
||||
|
||||
QWidget *details = new QWidget(container);
|
||||
container->setWidget(details);
|
||||
|
||||
QGridLayout *layout = new QGridLayout(details);
|
||||
auto layout = new QGridLayout(details);
|
||||
layout->setMargin(0);
|
||||
layout->addWidget(new QLabel(tr("Build directory:")), 0, 0);
|
||||
|
||||
|
@@ -67,9 +67,9 @@ class QbsBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
QbsBuildStepConfigWidget(QbsBuildStep *step);
|
||||
~QbsBuildStepConfigWidget();
|
||||
QString summaryText() const;
|
||||
QString displayName() const;
|
||||
~QbsBuildStepConfigWidget() override;
|
||||
QString summaryText() const override;
|
||||
QString displayName() const override;
|
||||
|
||||
private:
|
||||
void updateState();
|
||||
@@ -137,7 +137,7 @@ QbsBuildStep::~QbsBuildStep()
|
||||
cancel();
|
||||
if (m_job) {
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
m_job = nullptr;
|
||||
}
|
||||
delete m_parser;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ bool QbsBuildStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
if (project()->isParsing() || m_job)
|
||||
return false;
|
||||
|
||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
|
||||
if (!bc)
|
||||
return false;
|
||||
@@ -220,7 +220,7 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co
|
||||
|
||||
void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
|
||||
{
|
||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
||||
auto pro = static_cast<QbsProject *>(project());
|
||||
|
||||
QVariantMap tmp = config;
|
||||
tmp.insert(Constants::QBS_CONFIG_PROFILE_KEY, pro->profileForTarget(target()));
|
||||
@@ -231,7 +231,7 @@ void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
|
||||
if (tmp == m_qbsConfiguration)
|
||||
return;
|
||||
m_qbsConfiguration = tmp;
|
||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
if (bc)
|
||||
bc->emitBuildTypeChanged();
|
||||
emit qbsConfigurationChanged();
|
||||
@@ -330,7 +330,7 @@ void QbsBuildStep::buildingDone(bool success)
|
||||
createTaskAndOutput(ProjectExplorer::Task::Error, item.description(),
|
||||
item.codeLocation().filePath(), item.codeLocation().line());
|
||||
|
||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
||||
auto pro = static_cast<QbsProject *>(project());
|
||||
|
||||
// Building can uncover additional target artifacts.
|
||||
pro->updateAfterBuild();
|
||||
@@ -424,7 +424,7 @@ void QbsBuildStep::setBuildVariant(const QString &variant)
|
||||
return;
|
||||
m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant);
|
||||
emit qbsConfigurationChanged();
|
||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
if (bc)
|
||||
bc->emitBuildTypeChanged();
|
||||
}
|
||||
@@ -517,10 +517,10 @@ void QbsBuildStep::finish()
|
||||
{
|
||||
QTC_ASSERT(m_fi, return);
|
||||
reportRunResult(*m_fi, m_lastWasSuccess);
|
||||
m_fi = 0; // do not delete, it is not ours
|
||||
m_fi = nullptr; // do not delete, it is not ours
|
||||
if (m_job) {
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
m_job = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@ QbsCleanStep::~QbsCleanStep()
|
||||
cancel();
|
||||
if (m_job) {
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
m_job = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool QbsCleanStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
if (project()->isParsing() || m_job)
|
||||
return false;
|
||||
|
||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||
|
||||
if (!bc)
|
||||
return false;
|
||||
@@ -82,7 +82,7 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
m_fi = &fi;
|
||||
|
||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
||||
auto pro = static_cast<QbsProject *>(project());
|
||||
qbs::CleanOptions options(m_qbsCleanOptions);
|
||||
|
||||
QString error;
|
||||
@@ -164,9 +164,9 @@ void QbsCleanStep::cleaningDone(bool success)
|
||||
|
||||
QTC_ASSERT(m_fi, return);
|
||||
reportRunResult(*m_fi, success);
|
||||
m_fi = 0; // do not delete, it is not ours
|
||||
m_fi = nullptr; // do not delete, it is not ours
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
m_job = nullptr;
|
||||
}
|
||||
|
||||
void QbsCleanStep::handleTaskStarted(const QString &desciption, int max)
|
||||
|
@@ -95,9 +95,9 @@ class QbsCleanStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
QbsCleanStepConfigWidget(QbsCleanStep *step);
|
||||
~QbsCleanStepConfigWidget();
|
||||
QString summaryText() const;
|
||||
QString displayName() const;
|
||||
~QbsCleanStepConfigWidget() override;
|
||||
QString summaryText() const override;
|
||||
QString displayName() const override;
|
||||
|
||||
private:
|
||||
void updateState();
|
||||
|
@@ -76,7 +76,7 @@ QbsInstallStep::~QbsInstallStep()
|
||||
cancel();
|
||||
if (m_job)
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
m_job = nullptr;
|
||||
}
|
||||
|
||||
bool QbsInstallStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
@@ -90,7 +90,7 @@ void QbsInstallStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
m_fi = &fi;
|
||||
|
||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
||||
auto pro = static_cast<QbsProject *>(project());
|
||||
m_job = pro->install(m_qbsInstallOptions);
|
||||
|
||||
if (!m_job) {
|
||||
@@ -187,9 +187,9 @@ void QbsInstallStep::installDone(bool success)
|
||||
|
||||
QTC_ASSERT(m_fi, return);
|
||||
reportRunResult(*m_fi, success);
|
||||
m_fi = 0; // do not delete, it is not ours
|
||||
m_fi = nullptr; // do not delete, it is not ours
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
m_job = nullptr;
|
||||
}
|
||||
|
||||
void QbsInstallStep::handleTaskStarted(const QString &desciption, int max)
|
||||
@@ -260,7 +260,7 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
|
||||
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QbsProject *project = static_cast<QbsProject *>(m_step->project());
|
||||
auto project = static_cast<QbsProject *>(m_step->project());
|
||||
|
||||
m_ui = new Ui::QbsInstallStepConfigWidget;
|
||||
m_ui->setupUi(this);
|
||||
|
@@ -98,9 +98,9 @@ class QbsInstallStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
QbsInstallStepConfigWidget(QbsInstallStep *step);
|
||||
~QbsInstallStepConfigWidget();
|
||||
QString summaryText() const;
|
||||
QString displayName() const;
|
||||
~QbsInstallStepConfigWidget() override;
|
||||
QString summaryText() const override;
|
||||
QString displayName() const override;
|
||||
|
||||
private:
|
||||
void updateState();
|
||||
|
@@ -40,7 +40,7 @@ class QbsLogSink : public QObject, public qbs::ILogSink
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QbsLogSink(QObject *parent = 0);
|
||||
QbsLogSink(QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void newTask(const ProjectExplorer::Task &task);
|
||||
@@ -48,8 +48,9 @@ signals:
|
||||
private:
|
||||
Q_INVOKABLE void sendMessages();
|
||||
|
||||
void doPrintWarning(const qbs::ErrorInfo &warning);
|
||||
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);
|
||||
void doPrintWarning(const qbs::ErrorInfo &warning) override;
|
||||
void doPrintMessage(qbs::LoggerLevel level, const QString &message,
|
||||
const QString &tag) override;
|
||||
|
||||
QStringList m_messages;
|
||||
QMutex m_mutex;
|
||||
|
@@ -56,21 +56,21 @@ namespace Internal {
|
||||
static const QbsProjectNode *parentQbsProjectNode(const ProjectExplorer::Node *node)
|
||||
{
|
||||
for (const ProjectExplorer::FolderNode *pn = node->managingProject(); pn; pn = pn->parentProjectNode()) {
|
||||
const QbsProjectNode *prjNode = dynamic_cast<const QbsProjectNode *>(pn);
|
||||
const auto prjNode = dynamic_cast<const QbsProjectNode *>(pn);
|
||||
if (prjNode)
|
||||
return prjNode;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static const QbsProductNode *parentQbsProductNode(const ProjectExplorer::Node *node)
|
||||
{
|
||||
for (; node; node = node->parentFolderNode()) {
|
||||
const QbsProductNode *prdNode = dynamic_cast<const QbsProductNode *>(node);
|
||||
const auto prdNode = dynamic_cast<const QbsProductNode *>(node);
|
||||
if (prdNode)
|
||||
return prdNode;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static qbs::GroupData findMainQbsGroup(const qbs::ProductData &productData)
|
||||
@@ -84,7 +84,7 @@ static qbs::GroupData findMainQbsGroup(const qbs::ProductData &productData)
|
||||
|
||||
class FileTreeNode {
|
||||
public:
|
||||
explicit FileTreeNode(const QString &n = QString(), FileTreeNode *p = 0, bool f = false) :
|
||||
explicit FileTreeNode(const QString &n = QString(), FileTreeNode *p = nullptr, bool f = false) :
|
||||
parent(p), name(n), m_isFile(f)
|
||||
{
|
||||
if (p)
|
||||
@@ -109,14 +109,14 @@ public:
|
||||
|
||||
static FileTreeNode *moveChildrenUp(FileTreeNode *node)
|
||||
{
|
||||
QTC_ASSERT(node, return 0);
|
||||
QTC_ASSERT(node, return nullptr);
|
||||
|
||||
FileTreeNode *newParent = node->parent;
|
||||
if (!newParent)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// disconnect node and parent:
|
||||
node->parent = 0;
|
||||
node->parent = nullptr;
|
||||
newParent->children.removeOne(node);
|
||||
|
||||
foreach (FileTreeNode *c, node->children) {
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
// Clean up node:
|
||||
node->children.clear();
|
||||
node->parent->children.removeOne(node);
|
||||
node->parent = 0;
|
||||
node->parent = nullptr;
|
||||
delete node;
|
||||
|
||||
return;
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
if (node->children.isEmpty() && !node->isFile()) {
|
||||
// Clean up empty folder nodes:
|
||||
node->parent->children.removeOne(node);
|
||||
node->parent = 0;
|
||||
node->parent = nullptr;
|
||||
delete node;
|
||||
} else if (node->children.count() == 1 && !node->children.at(0)->isFile()) {
|
||||
// Compact folder nodes with one child only:
|
||||
|
@@ -82,8 +82,8 @@ public:
|
||||
QbsGroupNode(const qbs::GroupData &grp, const QString &productPath);
|
||||
|
||||
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
||||
|
||||
qbs::GroupData qbsGroupData() const { return m_qbsGroupData; }
|
||||
@@ -106,8 +106,8 @@ public:
|
||||
|
||||
bool showInSimpleTree() const override;
|
||||
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
||||
|
||||
const qbs::ProductData qbsProductData() const { return m_qbsProductData; }
|
||||
|
@@ -42,8 +42,8 @@ public:
|
||||
explicit QbsParser();
|
||||
|
||||
private:
|
||||
void setWorkingDirectory(const QString &workingDirectory);
|
||||
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
|
||||
void setWorkingDirectory(const QString &workingDirectory) override;
|
||||
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines) override;
|
||||
|
||||
QDir m_workingDirectory;
|
||||
};
|
||||
|
@@ -52,7 +52,7 @@ class QbsProfilesSettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QbsProfilesSettingsWidget(QWidget *parent = 0);
|
||||
QbsProfilesSettingsWidget(QWidget *parent = nullptr);
|
||||
|
||||
void apply();
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
|
||||
QbsProfilesSettingsPage::QbsProfilesSettingsPage(QObject *parent)
|
||||
: Core::IOptionsPage(parent)
|
||||
, m_widget(0)
|
||||
, m_widget(nullptr)
|
||||
, m_useQtcSettingsDirPersistent(QbsProjectManagerSettings::useCreatorSettingsDirForQbs())
|
||||
|
||||
{
|
||||
@@ -92,7 +92,7 @@ void QbsProfilesSettingsPage::apply()
|
||||
void QbsProfilesSettingsPage::finish()
|
||||
{
|
||||
delete m_widget;
|
||||
m_widget = 0;
|
||||
m_widget = nullptr;
|
||||
QbsProjectManagerSettings::setUseCreatorSettingsDirForQbs(m_useQtcSettingsDirPersistent);
|
||||
QbsProjectManagerSettings::writeSettings();
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void QbsProfilesSettingsWidget::apply()
|
||||
void QbsProfilesSettingsWidget::refreshKitsList()
|
||||
{
|
||||
m_ui.kitsComboBox->disconnect(this);
|
||||
m_ui.propertiesView->setModel(0);
|
||||
m_ui.propertiesView->setModel(nullptr);
|
||||
m_model.reload();
|
||||
m_ui.profileValueLabel->clear();
|
||||
Core::Id currentId;
|
||||
@@ -159,7 +159,7 @@ void QbsProfilesSettingsWidget::refreshKitsList()
|
||||
|
||||
void QbsProfilesSettingsWidget::displayCurrentProfile()
|
||||
{
|
||||
m_ui.propertiesView->setModel(0);
|
||||
m_ui.propertiesView->setModel(nullptr);
|
||||
if (m_ui.kitsComboBox->currentIndex() == -1)
|
||||
return;
|
||||
const Core::Id kitId = Core::Id::fromSetting(m_ui.kitsComboBox->currentData());
|
||||
|
@@ -34,7 +34,7 @@ class QbsProfilesSettingsWidget;
|
||||
class QbsProfilesSettingsPage : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
QbsProfilesSettingsPage(QObject *parent = 0);
|
||||
QbsProfilesSettingsPage(QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
QWidget *widget() override;
|
||||
|
@@ -121,8 +121,8 @@ private:
|
||||
|
||||
QbsProject::QbsProject(const FileName &fileName) :
|
||||
Project(Constants::MIME_TYPE, fileName, [this]() { delayParsing(); }),
|
||||
m_qbsProjectParser(0),
|
||||
m_qbsUpdateFutureInterface(0),
|
||||
m_qbsProjectParser(nullptr),
|
||||
m_qbsUpdateFutureInterface(nullptr),
|
||||
m_parsingScheduled(false),
|
||||
m_cancelStatus(CancelStatusNone),
|
||||
m_cppCodeModelUpdater(new CppTools::CppProjectUpdater(this)),
|
||||
@@ -174,7 +174,7 @@ QbsProject::~QbsProject()
|
||||
m_qbsUpdateFutureInterface->reportCanceled();
|
||||
m_qbsUpdateFutureInterface->reportFinished();
|
||||
delete m_qbsUpdateFutureInterface;
|
||||
m_qbsUpdateFutureInterface = 0;
|
||||
m_qbsUpdateFutureInterface = nullptr;
|
||||
}
|
||||
qDeleteAll(m_extraCompilers);
|
||||
std::for_each(m_qbsDocuments.cbegin(), m_qbsDocuments.cend(),
|
||||
@@ -210,7 +210,7 @@ class ChangeExpector
|
||||
{
|
||||
public:
|
||||
ChangeExpector(const QString &filePath, const QSet<IDocument *> &documents)
|
||||
: m_document(0)
|
||||
: m_document(nullptr)
|
||||
{
|
||||
foreach (IDocument * const doc, documents) {
|
||||
if (doc->filePath().toString() == filePath) {
|
||||
@@ -362,8 +362,8 @@ template<typename Options>
|
||||
qbs::AbstractJob *QbsProject::buildOrClean(const Options &opts, const QStringList &productNames,
|
||||
QString &error)
|
||||
{
|
||||
QTC_ASSERT(qbsProject().isValid(), return 0);
|
||||
QTC_ASSERT(!isParsing(), return 0);
|
||||
QTC_ASSERT(qbsProject().isValid(), return nullptr);
|
||||
QTC_ASSERT(!isParsing(), return nullptr);
|
||||
|
||||
QList<qbs::ProductData> products;
|
||||
foreach (const QString &productName, productNames) {
|
||||
@@ -400,7 +400,7 @@ qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts, const QStringLis
|
||||
qbs::InstallJob *QbsProject::install(const qbs::InstallOptions &opts)
|
||||
{
|
||||
if (!qbsProject().isValid())
|
||||
return 0;
|
||||
return nullptr;
|
||||
return qbsProject().installAllProducts(opts);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ bool QbsProject::checkCancelStatus()
|
||||
return false;
|
||||
qCDebug(qbsPmLog) << "Cancel request while parsing, starting re-parse";
|
||||
m_qbsProjectParser->deleteLater();
|
||||
m_qbsProjectParser = 0;
|
||||
m_qbsProjectParser = nullptr;
|
||||
emitParsingFinished(false);
|
||||
parseCurrentBuildConfiguration();
|
||||
return true;
|
||||
@@ -514,10 +514,10 @@ void QbsProject::handleQbsParsingDone(bool success)
|
||||
}
|
||||
|
||||
m_qbsProjectParser->deleteLater();
|
||||
m_qbsProjectParser = 0;
|
||||
m_qbsProjectParser = nullptr;
|
||||
m_qbsUpdateFutureInterface->reportFinished();
|
||||
delete m_qbsUpdateFutureInterface;
|
||||
m_qbsUpdateFutureInterface = 0;
|
||||
m_qbsUpdateFutureInterface = nullptr;
|
||||
|
||||
if (dataChanged)
|
||||
updateAfterParse();
|
||||
@@ -539,10 +539,10 @@ void QbsProject::handleRuleExecutionDone()
|
||||
return;
|
||||
|
||||
m_qbsProjectParser->deleteLater();
|
||||
m_qbsProjectParser = 0;
|
||||
m_qbsProjectParser = nullptr;
|
||||
m_qbsUpdateFutureInterface->reportFinished();
|
||||
delete m_qbsUpdateFutureInterface;
|
||||
m_qbsUpdateFutureInterface = 0;
|
||||
m_qbsUpdateFutureInterface = nullptr;
|
||||
|
||||
QTC_ASSERT(m_qbsProject.isValid(), return);
|
||||
m_projectData = m_qbsProject.projectData();
|
||||
@@ -588,7 +588,7 @@ void QbsProject::parseCurrentBuildConfiguration()
|
||||
|
||||
if (!activeTarget())
|
||||
return;
|
||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
|
||||
auto bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
@@ -719,7 +719,7 @@ void QbsProject::prepareForParsing()
|
||||
m_qbsUpdateFutureInterface->reportFinished();
|
||||
}
|
||||
delete m_qbsUpdateFutureInterface;
|
||||
m_qbsUpdateFutureInterface = 0;
|
||||
m_qbsUpdateFutureInterface = nullptr;
|
||||
|
||||
m_qbsUpdateFutureInterface = new QFutureInterface<bool>();
|
||||
m_qbsUpdateFutureInterface->setProgressRange(0, 0);
|
||||
|
@@ -231,7 +231,7 @@ QList<BuildInfo *> QbsProjectImporter::buildInfoListForKit(const Kit *k, void *d
|
||||
return result;
|
||||
}
|
||||
const auto * const bgData = static_cast<BuildGraphData *>(directoryData);
|
||||
QbsBuildInfo * const buildInfo = new QbsBuildInfo(factory);
|
||||
auto * const buildInfo = new QbsBuildInfo(factory);
|
||||
buildInfo->displayName = bgData->bgFilePath.toFileInfo().completeBaseName();
|
||||
buildInfo->buildType = bgData->buildVariant == "debug"
|
||||
? BuildConfiguration::Debug : BuildConfiguration::Release;
|
||||
|
@@ -46,7 +46,7 @@ class QbsManager : public QObject
|
||||
|
||||
public:
|
||||
QbsManager();
|
||||
~QbsManager();
|
||||
~QbsManager() override;
|
||||
|
||||
// QBS profiles management:
|
||||
static QString profileForKit(const ProjectExplorer::Kit *k);
|
||||
|
@@ -301,7 +301,7 @@ void QbsProjectManagerPlugin::extensionsInitialized()
|
||||
|
||||
void QbsProjectManagerPlugin::projectWasAdded(Project *project)
|
||||
{
|
||||
QbsProject *qbsProject = qobject_cast<QbsProject *>(project);
|
||||
auto qbsProject = qobject_cast<QbsProject *>(project);
|
||||
|
||||
if (!qbsProject)
|
||||
return;
|
||||
@@ -314,7 +314,7 @@ void QbsProjectManagerPlugin::projectWasAdded(Project *project)
|
||||
|
||||
void QbsProjectManagerPlugin::updateContextActions()
|
||||
{
|
||||
QbsProject *project = qobject_cast<Internal::QbsProject *>(ProjectTree::currentProject());
|
||||
auto project = qobject_cast<Internal::QbsProject *>(ProjectTree::currentProject());
|
||||
const Node *node = ProjectTree::findCurrentNode();
|
||||
bool isEnabled = !BuildManager::isBuilding(project)
|
||||
&& project && !project->isParsing()
|
||||
@@ -322,7 +322,7 @@ void QbsProjectManagerPlugin::updateContextActions()
|
||||
|
||||
bool isFile = project && node && (node->nodeType() == NodeType::File);
|
||||
const bool isProduct = project && node && dynamic_cast<const QbsProductNode *>(node);
|
||||
const QbsProjectNode *subproject = dynamic_cast<const QbsProjectNode *>(node);
|
||||
const auto subproject = dynamic_cast<const QbsProjectNode *>(node);
|
||||
bool isSubproject = project && subproject && subproject != project->rootProjectNode();
|
||||
|
||||
m_reparseQbsCtx->setEnabled(isEnabled);
|
||||
@@ -337,7 +337,7 @@ void QbsProjectManagerPlugin::updateContextActions()
|
||||
|
||||
void QbsProjectManagerPlugin::updateReparseQbsAction()
|
||||
{
|
||||
QbsProject *project = qobject_cast<QbsProject *>(SessionManager::startupProject());
|
||||
auto project = qobject_cast<QbsProject *>(SessionManager::startupProject());
|
||||
m_reparseQbs->setEnabled(project
|
||||
&& !BuildManager::isBuilding(project)
|
||||
&& !project->isParsing());
|
||||
@@ -363,14 +363,14 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
||||
fileName = editorNode->filePath().fileName();
|
||||
fileVisible = editorProject && editorNode && dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
||||
|
||||
QbsProductNode *productNode =
|
||||
dynamic_cast<QbsProductNode *>(editorNode ? editorNode->parentProjectNode() : 0);
|
||||
auto productNode =
|
||||
dynamic_cast<QbsProductNode *>(editorNode ? editorNode->parentProjectNode() : nullptr);
|
||||
if (productNode) {
|
||||
productVisible = true;
|
||||
productName = productNode->displayName();
|
||||
}
|
||||
QbsProjectNode *subprojectNode =
|
||||
dynamic_cast<QbsProjectNode *>(productNode ? productNode->parentFolderNode() : 0);
|
||||
auto subprojectNode =
|
||||
dynamic_cast<QbsProjectNode *>(productNode ? productNode->parentFolderNode() : nullptr);
|
||||
if (subprojectNode && editorProject && subprojectNode != editorProject->rootProjectNode()) {
|
||||
subprojectVisible = true;
|
||||
subprojectName = subprojectNode->displayName();
|
||||
@@ -404,7 +404,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
||||
|
||||
void QbsProjectManagerPlugin::projectChanged()
|
||||
{
|
||||
QbsProject *project = qobject_cast<QbsProject *>(sender());
|
||||
auto project = qobject_cast<QbsProject *>(sender());
|
||||
|
||||
if (!project || project == SessionManager::startupProject())
|
||||
updateReparseQbsAction();
|
||||
@@ -420,7 +420,7 @@ void QbsProjectManagerPlugin::buildFileContextMenu()
|
||||
{
|
||||
const Node *node = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(node, return);
|
||||
QbsProject *project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||
auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||
QTC_ASSERT(project, return);
|
||||
buildSingleFile(project, node->filePath().toString());
|
||||
}
|
||||
@@ -457,10 +457,10 @@ void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Core::Id
|
||||
{
|
||||
const Node *node = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(node, return);
|
||||
QbsProject *project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||
auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||
QTC_ASSERT(project, return);
|
||||
|
||||
const QbsProductNode * const productNode = dynamic_cast<const QbsProductNode *>(node);
|
||||
const auto * const productNode = dynamic_cast<const QbsProductNode *>(node);
|
||||
QTC_ASSERT(productNode, return);
|
||||
|
||||
runStepsForProducts(project, {QbsProject::uniqueProductName(productNode->qbsProductData())},
|
||||
@@ -490,7 +490,7 @@ void QbsProjectManagerPlugin::runStepsForProduct(const QList<Core::Id> &stepType
|
||||
Node *node = currentEditorNode();
|
||||
if (!node)
|
||||
return;
|
||||
QbsProductNode *product = dynamic_cast<QbsProductNode *>(node->parentProjectNode());
|
||||
auto product = dynamic_cast<QbsProductNode *>(node->parentProjectNode());
|
||||
if (!product)
|
||||
return;
|
||||
QbsProject *project = currentEditorProject();
|
||||
@@ -522,10 +522,10 @@ void QbsProjectManagerPlugin::runStepsForSubprojectContextMenu(const QList<Core:
|
||||
{
|
||||
const Node *node = ProjectTree::findCurrentNode();
|
||||
QTC_ASSERT(node, return);
|
||||
QbsProject *project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||
auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||
QTC_ASSERT(project, return);
|
||||
|
||||
const QbsProjectNode *subProject = dynamic_cast<const QbsProjectNode *>(node);
|
||||
const auto subProject = dynamic_cast<const QbsProjectNode *>(node);
|
||||
QTC_ASSERT(subProject, return);
|
||||
|
||||
QStringList toBuild;
|
||||
@@ -560,10 +560,10 @@ void QbsProjectManagerPlugin::runStepsForSubproject(const QList<Core::Id> &stepT
|
||||
if (!editorNode || !editorProject)
|
||||
return;
|
||||
|
||||
QbsProjectNode *subproject = 0;
|
||||
QbsBaseProjectNode *start = dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
||||
QbsProjectNode *subproject = nullptr;
|
||||
auto start = dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
||||
while (start && start != editorProject->rootProjectNode()) {
|
||||
QbsProjectNode *tmp = dynamic_cast<QbsProjectNode *>(start);
|
||||
auto tmp = dynamic_cast<QbsProjectNode *>(start);
|
||||
if (tmp) {
|
||||
subproject = tmp;
|
||||
break;
|
||||
@@ -590,7 +590,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
||||
Target *t = project->activeTarget();
|
||||
if (!t)
|
||||
return;
|
||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||
auto bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
@@ -623,7 +623,7 @@ void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project,
|
||||
Target *t = project->activeTarget();
|
||||
if (!t)
|
||||
return;
|
||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||
auto bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
|
@@ -49,8 +49,8 @@ namespace Internal {
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
QbsProjectParser::QbsProjectParser(QbsProject *project, QFutureInterface<bool> *fi) :
|
||||
m_qbsSetupProjectJob(0),
|
||||
m_ruleExecutionJob(0),
|
||||
m_qbsSetupProjectJob(nullptr),
|
||||
m_ruleExecutionJob(nullptr),
|
||||
m_fi(fi),
|
||||
m_currentProgressBase(0)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ QbsProjectParser::~QbsProjectParser()
|
||||
};
|
||||
deleteJob(m_qbsSetupProjectJob);
|
||||
deleteJob(m_ruleExecutionJob);
|
||||
m_fi = 0; // we do not own m_fi, do not delete
|
||||
m_fi = nullptr; // we do not own m_fi, do not delete
|
||||
}
|
||||
|
||||
void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, const QString &dir,
|
||||
@@ -114,7 +114,7 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
|
||||
params.setPropertyCheckingMode(qbs::ErrorHandlingMode::Relaxed);
|
||||
params.setLogElapsedTime(!qEnvironmentVariableIsEmpty(Constants::QBS_PROFILING_ENV));
|
||||
|
||||
m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0);
|
||||
m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), nullptr);
|
||||
|
||||
connect(m_qbsSetupProjectJob, &qbs::AbstractJob::finished,
|
||||
this, &QbsProjectParser::handleQbsParsingDone);
|
||||
|
@@ -44,7 +44,7 @@ class QbsProjectParser : public QObject
|
||||
public:
|
||||
QbsProjectParser(QbsProjectManager::Internal::QbsProject *project,
|
||||
QFutureInterface<bool> *fi);
|
||||
~QbsProjectParser();
|
||||
~QbsProjectParser() override;
|
||||
|
||||
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir,
|
||||
const QString &configName);
|
||||
|
@@ -81,7 +81,7 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target, Core::Id id)
|
||||
connect(target, &Target::kitChanged,
|
||||
this, &QbsRunConfiguration::updateTargetInformation);
|
||||
|
||||
QbsProject *qbsProject = static_cast<QbsProject *>(target->project());
|
||||
auto qbsProject = static_cast<QbsProject *>(target->project());
|
||||
connect(qbsProject, &QbsProject::dataChanged, this, [this] { m_envCache.clear(); });
|
||||
connect(qbsProject, &Project::parsingFinished,
|
||||
this, &QbsRunConfiguration::updateTargetInformation);
|
||||
|
Reference in New Issue
Block a user