diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2018-07-12 22:17:17 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2018-07-16 10:01:53 +0000 |
commit | 8d19333075b10d4b52c302224f8ed99aab0ec13f (patch) | |
tree | b54695475f5fa54d864f2774b715a3c73c28b8fe | |
parent | af8bd1238724e3d578b9a16e4ffa88a6a046dca6 (diff) |
ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors
Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
66 files changed, 241 insertions, 269 deletions
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index a8f557e670..bc8c9efa4e 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -88,7 +88,7 @@ static void insertIntoOsFlavorMap(const std::vector<Abi::OS> &oses, const Abi::O static void registerOsFlavor(const Abi::OSFlavor &flavor, const QByteArray &flavorName, const std::vector<Abi::OS> &oses) { - const size_t pos = static_cast<size_t>(flavor); + const auto pos = static_cast<size_t>(flavor); if (m_registeredOsFlavors.size() <= pos) m_registeredOsFlavors.resize(pos + 1); @@ -675,7 +675,7 @@ QString Abi::toString(const OS &o) QString Abi::toString(const OSFlavor &of) { - const size_t index = static_cast<size_t>(of); + const auto index = static_cast<size_t>(of); const std::vector<QByteArray> &flavors = registeredOsFlavors(); QTC_ASSERT(index < flavors.size(), return QString::fromUtf8(flavors.at(int(UnknownFlavor)))); @@ -845,7 +845,7 @@ Abi::OSFlavor Abi::registerOsFlavor(const std::vector<OS> &oses, const QString & if (index < 0) index = int(registeredOsFlavors().size()); - OSFlavor toRegister = OSFlavor(index); + auto toRegister = OSFlavor(index); ProjectExplorer::registerOsFlavor(toRegister, flavorBytes, oses); return toRegister; } @@ -1030,7 +1030,7 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiRoundTrips() for (const Abi::OSFlavor flavorIt : Abi::allOsFlavors()) { const QString string = Abi::toString(flavorIt); for (int os = 0; os <= Abi::UnknownOS; ++os) { - const Abi::OS osEnum = static_cast<Abi::OS>(os); + const auto osEnum = static_cast<Abi::OS>(os); const Abi::OSFlavor flavor = Abi::osFlavorFromString(QStringRef(&string), osEnum); if (isGenericFlavor(flavorIt) && flavor != Abi::UnknownFlavor) QVERIFY(isGenericFlavor(flavor)); diff --git a/src/plugins/projectexplorer/abiwidget.cpp b/src/plugins/projectexplorer/abiwidget.cpp index 577bd2e983..162427342f 100644 --- a/src/plugins/projectexplorer/abiwidget.cpp +++ b/src/plugins/projectexplorer/abiwidget.cpp @@ -77,7 +77,7 @@ public: AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), d(new Internal::AbiWidgetPrivate) { - QHBoxLayout *layout = new QHBoxLayout(this); + auto *layout = new QHBoxLayout(this); layout->setMargin(0); layout->setSpacing(2); diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index 74cc13b6db..6b4ba9d615 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -437,7 +437,7 @@ bool AbstractMsvcToolChain::operator ==(const ToolChain &other) const if (!ToolChain::operator ==(other)) return false; - const AbstractMsvcToolChain *msvcTc = static_cast<const AbstractMsvcToolChain *>(&other); + const auto *msvcTc = static_cast<const AbstractMsvcToolChain *>(&other); return targetAbi() == msvcTc->targetAbi() && m_vcvarsBat == msvcTc->m_vcvarsBat; } diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 29d427e847..70b55b7aae 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -69,7 +69,7 @@ class ApplicationLauncherPrivate : public QObject public: enum State { Inactive, Run }; explicit ApplicationLauncherPrivate(ApplicationLauncher *parent); - ~ApplicationLauncherPrivate() { setFinished(); } + ~ApplicationLauncherPrivate() override { setFinished(); } void start(const Runnable &runnable, const IDevice::ConstPtr &device, bool local); void stop(); @@ -324,7 +324,7 @@ void ApplicationLauncherPrivate::readLocalStandardError() void ApplicationLauncherPrivate::cannotRetrieveLocalDebugOutput() { #ifdef Q_OS_WIN - disconnect(WinDebugInterface::instance(), 0, this, 0); + disconnect(WinDebugInterface::instance(), nullptr, this, nullptr); emit q->appendMessage(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput(), ErrorMessageFormat); #endif } @@ -446,7 +446,7 @@ void ApplicationLauncherPrivate::setFinished() if (m_deviceProcess) { m_deviceProcess->disconnect(this); m_deviceProcess->deleteLater(); - m_deviceProcess = 0; + m_deviceProcess = nullptr; } m_state = Inactive; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index e99ad86d9b..b3e200dfb3 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -121,14 +121,14 @@ bool TabWidget::eventFilter(QObject *object, QEvent *event) { if (object == tabBar()) { if (event->type() == QEvent::MouseButtonPress) { - QMouseEvent *me = static_cast<QMouseEvent *>(event); + auto *me = static_cast<QMouseEvent *>(event); if (me->button() == Qt::MiddleButton) { m_tabIndexForMiddleClick = tabBar()->tabAt(me->pos()); event->accept(); return true; } } else if (event->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast<QMouseEvent *>(event); + auto *me = static_cast<QMouseEvent *>(event); if (me->button() == Qt::MiddleButton) { int tab = tabBar()->tabAt(me->pos()); if (tab != -1 && tab == m_tabIndexForMiddleClick) @@ -221,7 +221,7 @@ AppOutputPane::AppOutputPane() : // Spacer (?) - QVBoxLayout *layout = new QVBoxLayout; + auto *layout = new QVBoxLayout; layout->setMargin(0); m_tabWidget->setDocumentMode(true); m_tabWidget->setTabsClosable(true); @@ -353,7 +353,7 @@ int AppOutputPane::priorityInStatusBar() const void AppOutputPane::clearContents() { - Core::OutputWindow *currentWindow = qobject_cast<Core::OutputWindow *>(m_tabWidget->currentWidget()); + auto *currentWindow = qobject_cast<Core::OutputWindow *>(m_tabWidget->currentWidget()); if (currentWindow) currentWindow->clear(); } @@ -458,7 +458,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) tab.window->setFontZoom(m_zoom); }); - Aggregation::Aggregate *agg = new Aggregation::Aggregate; + auto *agg = new Aggregation::Aggregate; agg->add(ow); agg->add(new Core::BaseTextFind(ow)); m_runControlTabs.push_back(RunControlTab(rc, ow)); @@ -689,7 +689,7 @@ void AppOutputPane::tabChanged(int i) void AppOutputPane::contextMenuRequested(const QPoint &pos, int index) { QList<QAction *> actions = QList<QAction *>() << m_closeCurrentTabAction << m_closeAllTabsAction << m_closeOtherTabsAction; - QAction *action = QMenu::exec(actions, m_tabWidget->mapToGlobal(pos), 0, m_tabWidget); + QAction *action = QMenu::exec(actions, m_tabWidget->mapToGlobal(pos), nullptr, m_tabWidget); const int currentIdx = index != -1 ? index : currentIndex(); if (action == m_closeCurrentTabAction) { if (currentIdx >= 0) @@ -712,7 +712,7 @@ void AppOutputPane::slotRunControlChanged() void AppOutputPane::slotRunControlFinished() { - RunControl *rc = qobject_cast<RunControl *>(sender()); + auto *rc = qobject_cast<RunControl *>(sender()); QTimer::singleShot(0, this, [this, rc]() { slotRunControlFinished2(rc); }); if (rc->outputFormatter()) rc->outputFormatter()->flush(); diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index b8a9b9d575..202e6cb463 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -358,7 +358,7 @@ int IBuildConfigurationFactory::priority(const Kit *k, const QString &projectPat // setup IBuildConfigurationFactory *IBuildConfigurationFactory::find(const Kit *k, const QString &projectPath) { - IBuildConfigurationFactory *factory = 0; + IBuildConfigurationFactory *factory = nullptr; int priority = -1; for (IBuildConfigurationFactory *i : g_buildConfigurationFactories) { int iPriority = i->priority(k, projectPath); @@ -373,7 +373,7 @@ IBuildConfigurationFactory *IBuildConfigurationFactory::find(const Kit *k, const // create IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent) { - IBuildConfigurationFactory *factory = 0; + IBuildConfigurationFactory *factory = nullptr; int priority = -1; for (IBuildConfigurationFactory *i : g_buildConfigurationFactories) { int iPriority = i->priority(parent); diff --git a/src/plugins/projectexplorer/buildinfo.cpp b/src/plugins/projectexplorer/buildinfo.cpp index d8b9d6987c..67dca0e280 100644 --- a/src/plugins/projectexplorer/buildinfo.cpp +++ b/src/plugins/projectexplorer/buildinfo.cpp @@ -27,5 +27,4 @@ using namespace ProjectExplorer; -BuildInfo::~BuildInfo() -{ } +BuildInfo::~BuildInfo() = default; diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index ac23d7f3e7..db53631f66 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -61,7 +61,7 @@ namespace ProjectExplorer { static QString msgProgress(int progress, int total) { - return BuildManager::tr("Finished %1 of %n steps", 0, total).arg(progress); + return BuildManager::tr("Finished %1 of %n steps", nullptr, total).arg(progress); } class BuildManagerPrivate @@ -642,8 +642,8 @@ void BuildManager::decrementActiveBuildSteps(BuildStep *bs) void BuildManager::disconnectOutput(BuildStep *bs) { - disconnect(bs, &BuildStep::addTask, m_instance, 0); - disconnect(bs, &BuildStep::addOutput, m_instance, 0); + disconnect(bs, &BuildStep::addTask, m_instance, nullptr); + disconnect(bs, &BuildStep::addOutput, m_instance, nullptr); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 6ae0cd6319..f961d9f4ef 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -184,7 +184,7 @@ Target *BuildStepList::target() const auto dc = qobject_cast<DeployConfiguration *>(parent()); if (dc) return dc->target(); - return 0; + return nullptr; } Project *BuildStepList::project() const diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 6b6b6af6bb..2465ef002d 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -50,8 +50,7 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; using namespace Utils; -ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent), - m_targetOpacity(.999) +ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent) { auto layout = new QHBoxLayout; layout->setMargin(4); @@ -169,7 +168,7 @@ void ToolWidget::setDownVisible(bool b) } BuildStepsWidgetData::BuildStepsWidgetData(BuildStep *s) : - step(s), widget(0), detailsWidget(0) + step(s), widget(nullptr), detailsWidget(nullptr) { widget = s->createConfigWidget(); Q_ASSERT(widget); diff --git a/src/plugins/projectexplorer/buildstepspage.h b/src/plugins/projectexplorer/buildstepspage.h index 81fd9a4c3d..17b2879376 100644 --- a/src/plugins/projectexplorer/buildstepspage.h +++ b/src/plugins/projectexplorer/buildstepspage.h @@ -52,8 +52,8 @@ class ToolWidget : public Utils::FadingPanel public: explicit ToolWidget(QWidget *parent = nullptr); - void fadeTo(qreal value); - void setOpacity(qreal value); + void fadeTo(qreal value) override; + void setOpacity(qreal value) override; void setBuildStepEnabled(bool b); void setUpEnabled(bool b); @@ -77,7 +77,7 @@ private: bool m_buildStepEnabled = true; Utils::FadingWidget *m_firstWidget; Utils::FadingWidget *m_secondWidget; - qreal m_targetOpacity; + qreal m_targetOpacity = .999; }; class BuildStepsWidgetData @@ -98,7 +98,7 @@ class BuildStepListWidget : public NamedWidget public: BuildStepListWidget(QWidget *parent = nullptr); - virtual ~BuildStepListWidget(); + ~BuildStepListWidget() override; void init(BuildStepList *bsl); diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 2f1e4f75a0..ffdd9c24fb 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -108,7 +108,7 @@ private: } protected: - void mouseMoveEvent(QMouseEvent *ev) + void mouseMoveEvent(QMouseEvent *ev) override { const int line = cursorForPosition(ev->pos()).block().blockNumber(); if (m_taskids.contains(line) && m_mousePressButton == Qt::NoButton) @@ -118,14 +118,14 @@ protected: QPlainTextEdit::mouseMoveEvent(ev); } - void mousePressEvent(QMouseEvent *ev) + void mousePressEvent(QMouseEvent *ev) override { m_mousePressPosition = ev->pos(); m_mousePressButton = ev->button(); QPlainTextEdit::mousePressEvent(ev); } - void mouseReleaseEvent(QMouseEvent *ev) + void mouseReleaseEvent(QMouseEvent *ev) override { if ((m_mousePressPosition - ev->pos()).manhattanLength() < 4 && m_mousePressButton == Qt::LeftButton) { diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index 79a418afc8..578e0bdba7 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -66,7 +66,7 @@ QString CurrentProjectFind::displayName() const bool CurrentProjectFind::isEnabled() const { - return ProjectTree::currentProject() != 0 && BaseFileFind::isEnabled(); + return ProjectTree::currentProject() != nullptr && BaseFileFind::isEnabled(); } QVariant CurrentProjectFind::additionalParameters() const diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 454a010f59..b26591ca81 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -152,7 +152,7 @@ void CustomExecutableDialog::accept() bool CustomExecutableDialog::event(QEvent *event) { if (event->type() == QEvent::ShortcutOverride) { - QKeyEvent *ke = static_cast<QKeyEvent *>(event); + auto *ke = static_cast<QKeyEvent *>(event); if (ke->key() == Qt::Key_Escape && !ke->modifiers()) { ke->accept(); return true; diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index c9a84889d1..9a3ea42a4e 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -160,7 +160,7 @@ void CustomWizard::setParameters(const CustomWizardParametersPtr &p) Core::BaseFileWizard *CustomWizard::create(QWidget *parent, const Core::WizardDialogParameters &p) const { - QTC_ASSERT(!d->m_parameters.isNull(), return 0); + QTC_ASSERT(!d->m_parameters.isNull(), return nullptr); auto wizard = new Core::BaseFileWizard(this, p.extraValues(), parent); d->m_context->reset(); @@ -213,7 +213,7 @@ static inline bool createFile(CustomWizardFile cwFile, generatedFile.setContents(CustomWizardContext::processFile(fm, contentsIn)); } - Core::GeneratedFile::Attributes attributes = 0; + Core::GeneratedFile::Attributes attributes = {}; if (cwFile.openEditor) attributes |= Core::GeneratedFile::OpenEditorAttribute; if (cwFile.openProject) @@ -230,7 +230,7 @@ template <class WizardPage> foreach (int pageId, w->pageIds()) if (auto wp = qobject_cast<WizardPage *>(w->page(pageId))) return wp; - return 0; + return nullptr; } // Determine where to run the generator script. The user may specify @@ -362,7 +362,7 @@ CustomWizard *CustomWizard::createWizard(const CustomProjectWizard::CustomWizard if (!rc) { qWarning("Unable to create custom wizard for class %s.", qPrintable(p->klass)); - return 0; + return nullptr; } rc->setParameters(p); @@ -487,9 +487,7 @@ QList<Core::IWizardFactory *> CustomWizard::createWizards() for QLineEdit-type fields' default text. */ -CustomProjectWizard::CustomProjectWizard() -{ -} +CustomProjectWizard::CustomProjectWizard() = default; /*! Can be reimplemented to create custom project wizards. @@ -540,7 +538,7 @@ void CustomProjectWizard::initProjectWizardDialog(BaseProjectWizardDialog *w, Core::GeneratedFiles CustomProjectWizard::generateFiles(const QWizard *w, QString *errorMessage) const { - const BaseProjectWizardDialog *dialog = qobject_cast<const BaseProjectWizardDialog *>(w); + const auto *dialog = qobject_cast<const BaseProjectWizardDialog *>(w); QTC_ASSERT(dialog, return Core::GeneratedFiles()); // Add project name as macro. Path is here under project directory CustomWizardContextPtr ctx = context(); diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index 3cdfe71bbd..2f5f9923f6 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -163,7 +163,7 @@ void CustomWizardFieldPage::addField(const CustomWizardField &field)\ static void comboChoices(const CustomWizardField::ControlAttributeMap &controlAttributes, QStringList *values, QStringList *displayTexts) { - typedef CustomWizardField::ControlAttributeMap::ConstIterator AttribMapConstIt; + using AttribMapConstIt = CustomWizardField::ControlAttributeMap::ConstIterator; values->clear(); displayTexts->clear(); @@ -260,7 +260,7 @@ QWidget *CustomWizardFieldPage::registerCheckBox(const QString &fieldName, const QString &fieldDescription, const CustomWizardField &field) { - typedef CustomWizardField::ControlAttributeMap::const_iterator AttributeMapConstIt; + using AttributeMapConstIt = CustomWizardField::ControlAttributeMap::const_iterator; auto checkBox = new TextFieldCheckBox(fieldDescription); const bool defaultValue = field.controlAttributes.value(QLatin1String("defaultvalue")) == QLatin1String("true"); diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp index 14fd113138..827edbedb3 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp @@ -835,8 +835,8 @@ bool CustomWizardContext::replaceFields(const FieldReplacementMap &fm, QString * // used for the arguments of a generator script. class TemporaryFileTransform { public: - typedef CustomWizardContext::TemporaryFilePtr TemporaryFilePtr; - typedef CustomWizardContext::TemporaryFilePtrList TemporaryFilePtrList; + using TemporaryFilePtr = CustomWizardContext::TemporaryFilePtr; + using TemporaryFilePtrList = CustomWizardContext::TemporaryFilePtrList; explicit TemporaryFileTransform(TemporaryFilePtrList *f); diff --git a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp index 80c5866248..71c43b01c1 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.cpp @@ -230,7 +230,7 @@ bool runCustomWizardGeneratorScript(const QString &targetPath, { return runGenerationScriptHelper(targetPath, script, arguments, false, fieldMap, - 0, errorMessage); + nullptr, errorMessage); } } // namespace Internal diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index f779d1eba4..eef4931904 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -60,9 +60,7 @@ DesktopDevice::DesktopDevice() : IDevice(Core::Id(DESKTOP_DEVICE_TYPE), setFreePorts(Utils::PortList::fromString(portRange)); } -DesktopDevice::DesktopDevice(const DesktopDevice &other) : - IDevice(other) -{ } +DesktopDevice::DesktopDevice(const DesktopDevice &other) = default; IDevice::DeviceInfo DesktopDevice::deviceInformation() const { @@ -76,7 +74,7 @@ QString DesktopDevice::displayType() const IDeviceWidget *DesktopDevice::createWidget() { - return 0; + return nullptr; // DesktopDeviceConfigurationWidget currently has just one editable field viz. free ports. // Querying for an available port is quite straightforward. Having a field for the port // range can be confusing to the user. Hence, disabling the widget for now. @@ -127,7 +125,7 @@ DeviceProcessSignalOperation::Ptr DesktopDevice::signalOperation() const class DesktopDeviceEnvironmentFetcher : public DeviceEnvironmentFetcher { public: - DesktopDeviceEnvironmentFetcher() {} + DesktopDeviceEnvironmentFetcher() = default; void start() override { diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 585478a611..9a0e1b0e11 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -57,8 +57,7 @@ const char DefaultDevicesKey[] = "DefaultDevices"; class DeviceManagerPrivate { public: - DeviceManagerPrivate() : writer(0) - { } + DeviceManagerPrivate() = default; int indexForId(Core::Id id) const { @@ -74,15 +73,15 @@ public: QHash<Core::Id, Core::Id> defaultDevices; QSsh::SshHostKeyDatabasePtr hostKeyDatabase; - Utils::PersistentSettingsWriter *writer; + Utils::PersistentSettingsWriter *writer = nullptr; }; -DeviceManager *DeviceManagerPrivate::clonedInstance = 0; +DeviceManager *DeviceManagerPrivate::clonedInstance = nullptr; } // namespace Internal using namespace Internal; -DeviceManager *DeviceManager::m_instance = 0; +DeviceManager *DeviceManager::m_instance = nullptr; DeviceManager *DeviceManager::instance() { @@ -104,12 +103,12 @@ void DeviceManager::replaceInstance() void DeviceManager::removeClonedInstance() { delete DeviceManagerPrivate::clonedInstance; - DeviceManagerPrivate::clonedInstance = 0; + DeviceManagerPrivate::clonedInstance = nullptr; } DeviceManager *DeviceManager::cloneInstance() { - QTC_ASSERT(!DeviceManagerPrivate::clonedInstance, return 0); + QTC_ASSERT(!DeviceManagerPrivate::clonedInstance, return nullptr); DeviceManagerPrivate::clonedInstance = new DeviceManager(false); copy(instance(), DeviceManagerPrivate::clonedInstance, true); @@ -210,7 +209,7 @@ QVariantMap DeviceManager::toMap() const { QVariantMap map; QVariantMap defaultDeviceMap; - typedef QHash<Core::Id, Core::Id> TypeIdHash; + using TypeIdHash = QHash<Core::Id, Core::Id>; for (TypeIdHash::ConstIterator it = d->defaultDevices.constBegin(); it != d->defaultDevices.constEnd(); ++it) { defaultDeviceMap.insert(it.key().toString(), it.value().toSetting()); @@ -370,7 +369,7 @@ DeviceManager::~DeviceManager() if (d->clonedInstance != this) delete d->writer; if (m_instance == this) - m_instance = 0; + m_instance = nullptr; delete d; } @@ -429,9 +428,9 @@ public: static Core::Id testTypeId() { return "TestType"; } private: - TestDevice(const TestDevice &other) : IDevice(other) {} + TestDevice(const TestDevice &other) = default; QString displayType() const override { return QLatin1String("blubb"); } - IDeviceWidget *createWidget() override { return 0; } + IDeviceWidget *createWidget() override { return nullptr; } QList<Core::Id> actionIds() const override { return QList<Core::Id>(); } QString displayNameForActionId(Core::Id) const override { return QString(); } void executeAction(Core::Id, QWidget *) override { } diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp index 1e5ea1bade..a51da5de5e 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp @@ -58,7 +58,7 @@ class ProcessListFilterModel : public QSortFilterProxyModel { public: ProcessListFilterModel(); - bool lessThan(const QModelIndex &left, const QModelIndex &right) const; + bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; }; ProcessListFilterModel::ProcessListFilterModel() @@ -120,14 +120,14 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, : q(parent) , kitLabel(new QLabel(DeviceProcessesDialog::tr("Kit:"), parent)) , kitChooser(chooser) - , acceptButton(0) + , acceptButton(nullptr) , buttonBox(new QDialogButtonBox(parent)) { q->setWindowTitle(DeviceProcessesDialog::tr("List of Processes")); q->setWindowFlags(q->windowFlags() & ~Qt::WindowContextHelpButtonHint); q->setMinimumHeight(500); - processList = 0; + processList = nullptr; processFilterLineEdit = new FancyLineEdit(q); processFilterLineEdit->setPlaceholderText(DeviceProcessesDialog::tr("Filter")); @@ -159,7 +159,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, buttonBox->addButton(updateListButton, QDialogButtonBox::ActionRole); buttonBox->addButton(killProcessButton, QDialogButtonBox::ActionRole); - QFormLayout *leftColumn = new QFormLayout(); + auto *leftColumn = new QFormLayout(); leftColumn->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); leftColumn->addRow(kitLabel, kitChooser); leftColumn->addRow(DeviceProcessesDialog::tr("&Filter:"), processFilterLineEdit); @@ -173,7 +173,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, // horizontalLayout->addLayout(leftColumn); // horizontalLayout->addLayout(rightColumn); - QVBoxLayout *mainLayout = new QVBoxLayout(q); + auto *mainLayout = new QVBoxLayout(q); mainLayout->addLayout(leftColumn); mainLayout->addWidget(procView); mainLayout->addWidget(errorText); @@ -212,8 +212,8 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser, void DeviceProcessesDialogPrivate::setDevice(const IDevice::ConstPtr &device) { delete processList; - processList = 0; - proxyModel.setSourceModel(0); + processList = nullptr; + proxyModel.setSourceModel(nullptr); if (!device) return; diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp index 98a841122e..117ba78043 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp @@ -58,14 +58,14 @@ const char LastDeviceIndexKey[] = "LastDisplayedMaemoDeviceConfig"; class NameValidator : public QValidator { public: - NameValidator(const DeviceManager *deviceManager, QWidget *parent = 0) + NameValidator(const DeviceManager *deviceManager, QWidget *parent = nullptr) : QValidator(parent), m_deviceManager(deviceManager) { } void setDisplayName(const QString &name) { m_oldName = name; } - virtual State validate(QString &input, int & /* pos */) const + State validate(QString &input, int & /* pos */) const override { if (input.trimmed().isEmpty() || (input != m_oldName && m_deviceManager->hasDevice(input))) @@ -73,7 +73,7 @@ public: return Acceptable; } - virtual void fixup(QString &input) const + void fixup(QString &input) const override { int dummy = 0; if (validate(input, dummy) != Acceptable) @@ -91,7 +91,7 @@ DeviceSettingsWidget::DeviceSettingsWidget(QWidget *parent) m_deviceManager(DeviceManager::cloneInstance()), m_deviceManagerModel(new DeviceManagerModel(m_deviceManager, this)), m_nameValidator(new NameValidator(m_deviceManager, this)), - m_configWidget(0) + m_configWidget(nullptr) { initGui(); connect(m_deviceManager, &DeviceManager::deviceUpdated, @@ -270,7 +270,7 @@ void DeviceSettingsWidget::currentDeviceChanged(int index) { qDeleteAll(m_additionalActionButtons); delete m_configWidget; - m_configWidget = 0; + m_configWidget = nullptr; m_additionalActionButtons.clear(); const IDevice::ConstPtr device = m_deviceManagerModel->device(index); if (device.isNull()) { diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index 83a36ccbe7..975ca59217 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -93,7 +93,7 @@ void DeviceUsedPortsGatherer::stop() d->remoteStdout.clear(); d->remoteStderr.clear(); if (d->process) - disconnect(d->process.data(), 0, this, 0); + disconnect(d->process.data(), nullptr, this, nullptr); d->process.clear(); } @@ -187,9 +187,7 @@ PortsGatherer::PortsGatherer(RunControl *runControl) }); } -PortsGatherer::~PortsGatherer() -{ -} +PortsGatherer::~PortsGatherer() = default; void PortsGatherer::start() { @@ -353,9 +351,7 @@ ChannelProvider::ChannelProvider(RunControl *runControl, int requiredChannels) } } -ChannelProvider::~ChannelProvider() -{ -} +ChannelProvider::~ChannelProvider() = default; QUrl ChannelProvider::channel(int i) const { diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index f46095c1f9..6dd073962c 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -128,7 +128,7 @@ const char SshOptionsKey[] = "SshOptions"; const char DebugServerKey[] = "DebugServerKey"; const char QmlsceneKey[] = "QmlsceneKey"; -typedef QSsh::SshConnectionParameters::AuthenticationType AuthType; +using AuthType = QSsh::SshConnectionParameters::AuthenticationType; const AuthType DefaultAuthType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; const IDevice::MachineType DefaultMachineType = IDevice::Hardware; @@ -138,20 +138,15 @@ namespace Internal { class IDevicePrivate { public: - IDevicePrivate() : - origin(IDevice::AutoDetected), - deviceState(IDevice::DeviceStateUnknown), - machineType(IDevice::Hardware), - version(0) - { } + IDevicePrivate() = default; QString displayName; Core::Id type; - IDevice::Origin origin; + IDevice::Origin origin = IDevice::AutoDetected; Core::Id id; - IDevice::DeviceState deviceState; - IDevice::MachineType machineType; - int version; // This is used by devices that have been added by the SDK. + IDevice::DeviceState deviceState = IDevice::DeviceStateUnknown; + IDevice::MachineType machineType = IDevice::Hardware; + int version = 0; // This is used by devices that have been added by the SDK. QSsh::SshConnectionParameters sshParameters; Utils::PortList freePorts; @@ -270,14 +265,14 @@ PortsGatheringMethod::Ptr IDevice::portsGatheringMethod() const DeviceProcessList *IDevice::createProcessListModel(QObject *parent) const { Q_UNUSED(parent); - QTC_ASSERT(false, qDebug("This should not have been called..."); return 0); - return 0; + QTC_ASSERT(false, qDebug("This should not have been called..."); return nullptr); + return nullptr; } DeviceTester *IDevice::createDeviceTester() const { QTC_ASSERT(false, qDebug("This should not have been called...")); - return 0; + return nullptr; } Utils::OsType IDevice::osType() const @@ -288,7 +283,7 @@ Utils::OsType IDevice::osType() const DeviceProcess *IDevice::createProcess(QObject * /* parent */) const { QTC_CHECK(false); - return 0; + return nullptr; } DeviceEnvironmentFetcher::Ptr IDevice::environmentFetcher() const @@ -479,12 +474,8 @@ void DeviceProcessSignalOperation::setDebuggerCommand(const QString &cmd) m_debuggerCommand = cmd; } -DeviceProcessSignalOperation::DeviceProcessSignalOperation() -{ -} +DeviceProcessSignalOperation::DeviceProcessSignalOperation() = default; -DeviceEnvironmentFetcher::DeviceEnvironmentFetcher() -{ -} +DeviceEnvironmentFetcher::DeviceEnvironmentFetcher() = default; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index b34e0ce805..a3177944cb 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -342,7 +342,7 @@ void SshDeviceProcess::SshDeviceProcessPrivate::setState(SshDeviceProcess::SshDe if (connection) { connection->disconnect(q); QSsh::releaseConnection(connection); - connection = 0; + connection = nullptr; } } diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index f011eb3a7e..d6c447ad7f 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -273,7 +273,7 @@ void EditorConfiguration::deconfigureEditor(BaseTextEditor *textEditor) const void EditorConfiguration::setUseGlobalSettings(bool use) { d->m_useGlobal = use; - d->m_defaultCodeStyle->setCurrentDelegate(use ? TextEditorSettings::codeStyle() : 0); + d->m_defaultCodeStyle->setCurrentDelegate(use ? TextEditorSettings::codeStyle() : nullptr); foreach (Core::IEditor *editor, Core::DocumentModel::editorsForOpenedDocuments()) { if (auto widget = qobject_cast<TextEditorWidget *>(editor->widget())) { Project *project = SessionManager::projectForFile(editor->document()->filePath()); diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 726352bf0f..fb67c4a4f3 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -96,7 +96,7 @@ public: : QStyledItemDelegate(view), m_model(model), m_view(view) {} - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override { QWidget *w = QStyledItemDelegate::createEditor(parent, option, index); if (index.column() != 0) diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index 478287d5b1..a1da2193fd 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -51,7 +51,7 @@ class AbiFlavorUpgraderV0 : public VersionUpgrader public: AbiFlavorUpgraderV0() : VersionUpgrader(0, "") { } - virtual QVariantMap upgrade(const QVariantMap &data) { return data; } + QVariantMap upgrade(const QVariantMap &data) override { return data; } }; class AbiFlavorAccessor : public UpgradingSettingsAccessor diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 0df7005c56..cc838a143b 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -147,7 +147,7 @@ public: FolderSortProxyModel(QObject *parent = nullptr); protected: - bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; + bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; }; FolderSortProxyModel::FolderSortProxyModel(QObject *parent) diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index 736833cacd..92c49a020a 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -83,11 +83,11 @@ void GnuMakeParser::stdOutput(const QString &line) class Result { public: - Result() : isFatal(false), type(Task::Error) { } + Result() = default; QString description; - bool isFatal; - Task::TaskType type; + bool isFatal = false; + Task::TaskType type = Task::Error; }; static Result parseDescription(const QString &description) @@ -401,8 +401,8 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() void ProjectExplorerPlugin::testGnuMakeParserParsing() { OutputParserTester testbench; - GnuMakeParser *childParser = new GnuMakeParser; - GnuMakeParserTester *tester = new GnuMakeParserTester(childParser); + auto *childParser = new GnuMakeParser; + auto *tester = new GnuMakeParserTester(childParser); connect(&testbench, &OutputParserTester::aboutToDeleteParser, tester, &GnuMakeParserTester::parserIsAboutToBeDeleted); @@ -494,7 +494,7 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data() void ProjectExplorerPlugin::testGnuMakeParserTaskMangling() { OutputParserTester testbench; - GnuMakeParser *childParser = new GnuMakeParser; + auto *childParser = new GnuMakeParser; testbench.appendOutputParser(childParser); QFETCH(QStringList, files); diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index bf772e576c..0da7005948 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -149,7 +149,7 @@ IOutputParser *IOutputParser::takeOutputParserChain() IOutputParser *parser = m_parser; disconnect(parser, &IOutputParser::addOutput, this, &IOutputParser::outputAdded); disconnect(parser, &IOutputParser::addTask, this, &IOutputParser::taskAdded); - m_parser = 0; + m_parser = nullptr; return parser; } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index 578023972f..a2e2cc0722 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -114,13 +114,13 @@ public: m_fixupExpando = expando; } - QValidator::State validate(QString &input, int &pos) const + QValidator::State validate(QString &input, int &pos) const override { fixup(input); return QRegularExpressionValidator::validate(input, pos); } - void fixup(QString &fixup) const + void fixup(QString &fixup) const override { if (m_fixupExpando.isEmpty()) return; @@ -159,7 +159,7 @@ JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString if (input.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", "Field is not an object."); - return 0; + return nullptr; } QVariantMap tmp = input.toMap(); @@ -167,13 +167,13 @@ JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString if (name.isEmpty()) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", "Field has no name."); - return 0; + return nullptr; } const QString type = consumeValue(tmp, TYPE_KEY).toString(); if (type.isEmpty()) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", "Field \"%1\" has no type.").arg(name); - return 0; + return nullptr; } Field *data = createFieldData(type); @@ -181,7 +181,7 @@ JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", "Field \"%1\" has unsupported type \"%2\".") .arg(name).arg(type); - return 0; + return nullptr; } data->setTexts(name, JsonWizardFactory::localizedString(consumeValue(tmp, DISPLAY_NAME_KEY).toString()), @@ -200,7 +200,7 @@ JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString "When parsing Field \"%1\": %2") .arg(name).arg(*errorMessage); delete data; - return 0; + return nullptr; } warnAboutUnsupportedKeys(tmp, name); @@ -927,7 +927,7 @@ void ListField::initializeData(MacroExpander *expander) QString iconPath = expandedValuesItem->data(IconStringRole).toString(); if (!iconPath.isEmpty()) { - if (JsonFieldPage *page = qobject_cast<JsonFieldPage*>(widget()->parentWidget())) { + if (auto *page = qobject_cast<JsonFieldPage*>(widget()->parentWidget())) { const QString wizardDirectory = page->value("WizardDir").toString(); iconPath = QDir::cleanPath(QDir(wizardDirectory).absoluteFilePath(iconPath)); if (QFileInfo::exists(iconPath)) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index d8d781908c..1ef81e7d45 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -127,7 +127,7 @@ static JsonWizardFactory::Generator parseGenerator(const QVariant &value, QStrin } Core::Id typeId = Core::Id::fromString(QLatin1String(Constants::GENERATOR_ID_PREFIX) + strVal); JsonWizardGeneratorFactory *factory - = Utils::findOr(s_generatorFactories, 0, [typeId](JsonWizardGeneratorFactory *f) { return f->canCreate(typeId); }); + = Utils::findOr(s_generatorFactories, nullptr, [typeId](JsonWizardGeneratorFactory *f) { return f->canCreate(typeId); }); if (!factory) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizardFactory", "TypeId \"%1\" of generator is unknown. Supported typeIds are: \"%2\".") @@ -164,7 +164,7 @@ static JsonWizardFactory::Page parsePage(const QVariant &value, QString *errorMe Core::Id typeId = Core::Id::fromString(QLatin1String(Constants::PAGE_ID_PREFIX) + strVal); JsonWizardPageFactory *factory - = Utils::findOr(s_pageFactories, 0, [typeId](JsonWizardPageFactory *f) { return f->canCreate(typeId); }); + = Utils::findOr(s_pageFactories, nullptr, [typeId](JsonWizardPageFactory *f) { return f->canCreate(typeId); }); if (!factory) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizardFactory", "TypeId \"%1\" of page is unknown. Supported typeIds are: \"%2\".") @@ -306,7 +306,7 @@ QList<Core::IWizardFactory *> JsonWizardFactory::createWizardFactories() JsonWizardFactory *JsonWizardFactory::createWizardFactory(const QVariantMap &data, const QDir &baseDir, QString *errorMessage) { - JsonWizardFactory *factory = new JsonWizardFactory; + auto *factory = new JsonWizardFactory; if (!factory->initialize(data, baseDir, errorMessage)) { delete factory; factory = nullptr; @@ -404,7 +404,7 @@ Utils::Wizard *JsonWizardFactory::runWizardImpl(const QString &path, QWidget *pa continue; havePage = true; - JsonWizardPageFactory *factory = Utils::findOr(s_pageFactories, 0, + JsonWizardPageFactory *factory = Utils::findOr(s_pageFactories, nullptr, [&data](JsonWizardPageFactory *f) { return f->canCreate(data.typeId); }); @@ -427,7 +427,7 @@ Utils::Wizard *JsonWizardFactory::runWizardImpl(const QString &path, QWidget *pa foreach (const Generator &data, m_generators) { QTC_ASSERT(data.isValid(), continue); - JsonWizardGeneratorFactory *factory = Utils::findOr(s_generatorFactories, 0, + JsonWizardGeneratorFactory *factory = Utils::findOr(s_generatorFactories, nullptr, [&data](JsonWizardGeneratorFactory *f) { return f->canCreate(data.typeId); }); @@ -441,7 +441,7 @@ Utils::Wizard *JsonWizardFactory::runWizardImpl(const QString &path, QWidget *pa if (!havePage) { wizard->accept(); wizard->deleteLater(); - return 0; + return nullptr; } wizard->show(); @@ -629,7 +629,7 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir, return false; } - WizardFlags flags = 0; + WizardFlags flags = {}; if (data.value(QLatin1String(PLATFORM_INDEPENDENT_KEY), false).toBool()) flags |= PlatformIndependent; setFlags(flags); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp index 5e599c39de..ee7da5b419 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp @@ -139,7 +139,7 @@ Core::GeneratedFile JsonWizardFileGenerator::generateFile(const File &file, } } - Core::GeneratedFile::Attributes attributes = 0; + Core::GeneratedFile::Attributes attributes = {}; if (JsonWizard::boolFromVariant(file.openInEditor, expander)) attributes |= Core::GeneratedFile::OpenEditorAttribute; if (JsonWizard::boolFromVariant(file.openAsProject, expander)) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp index 6d96f67114..013de06c0a 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp @@ -67,7 +67,7 @@ namespace ProjectExplorer { static ICodeStylePreferences *codeStylePreferences(Project *project, Id languageId) { if (!languageId.isValid()) - return 0; + return nullptr; if (project) return project->editorConfiguration()->codeStyle(languageId); @@ -310,7 +310,7 @@ JsonWizardGenerator *FileGeneratorFactory::create(Id typeId, const QVariant &dat Q_UNUSED(platform); Q_UNUSED(variables); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); auto gen = new JsonWizardFileGenerator; QString errorMessage; @@ -319,7 +319,7 @@ JsonWizardGenerator *FileGeneratorFactory::create(Id typeId, const QVariant &dat if (!errorMessage.isEmpty()) { qWarning() << "FileGeneratorFactory setup error:" << errorMessage; delete gen; - return 0; + return nullptr; } return gen; @@ -350,7 +350,7 @@ JsonWizardGenerator *ScannerGeneratorFactory::create(Id typeId, const QVariant & Q_UNUSED(platform); Q_UNUSED(variables); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); auto gen = new JsonWizardScannerGenerator; QString errorMessage; @@ -359,7 +359,7 @@ JsonWizardGenerator *ScannerGeneratorFactory::create(Id typeId, const QVariant & if (!errorMessage.isEmpty()) { qWarning() << "ScannerGeneratorFactory setup error:" << errorMessage; delete gen; - return 0; + return nullptr; } return gen; diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp index 3e6f12a15e..c2c49b61ed 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp @@ -35,8 +35,7 @@ namespace ProjectExplorer { // JsonWizardPageFactory: // -------------------------------------------------------------------- -JsonWizardPageFactory::~JsonWizardPageFactory() -{ } +JsonWizardPageFactory::~JsonWizardPageFactory() = default; void JsonWizardPageFactory::setTypeIdsSuffixes(const QStringList &suffixes) { diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 17f067abe9..02c9ceca05 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -472,7 +472,7 @@ bool Kit::isEqual(const Kit *other) const QVariantMap Kit::toMap() const { - typedef QHash<Id, QVariant>::ConstIterator IdVariantConstIt; + using IdVariantConstIt = QHash<Id, QVariant>::ConstIterator; QVariantMap data; data.insert(QLatin1String(ID_KEY), QString::fromLatin1(d->m_id.name())); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 0d1c052b69..df290f732f 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -324,7 +324,7 @@ KitManager::KitList KitManager::restoreKits(const FileName &fileName) const QVariantMap stMap = data.value(key).toMap(); - Kit *k = new Kit(stMap); + auto *k = new Kit(stMap); if (k->id().isValid()) { result.kits.append(k); } else { @@ -380,7 +380,7 @@ QList<KitInformation *> KitManager::kitInformation() KitManagerConfigWidget *KitManager::createConfigWidget(Kit *k) { - KitManagerConfigWidget *result = new KitManagerConfigWidget(k); + auto *result = new KitManagerConfigWidget(k); foreach (KitInformation *ki, kitInformation()) result->addConfigWidget(ki->createConfigWidget(result->workingCopy())); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index a7e19ff9e9..4570b14f37 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -218,7 +218,7 @@ void KitManagerConfigWidget::addConfigWidget(KitConfigWidget *widget) QString name = widget->displayName(); QString toolTip = widget->toolTip(); - auto action = new QAction(tr("Mark as Mutable"), 0); + auto action = new QAction(tr("Mark as Mutable"), nullptr); action->setCheckable(true); action->setChecked(widget->isMutable()); action->setEnabled(!widget->isSticky()); diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp index 43205858c9..cc35e243ef 100644 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ b/src/plugins/projectexplorer/kitmodel.cpp @@ -54,12 +54,12 @@ public: } } - ~KitNode() + ~KitNode() override { delete widget; } - QVariant data(int, int role) const + QVariant data(int, int role) const override { if (widget) { if (role == Qt::FontRole) { @@ -132,7 +132,7 @@ KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) Kit *KitModel::kit(const QModelIndex &index) { KitNode *n = kitNode(index); - return n ? n->widget->workingCopy() : 0; + return n ? n->widget->workingCopy() : nullptr; } KitNode *KitModel::kitNode(const QModelIndex &index) @@ -161,7 +161,7 @@ bool KitModel::isDefaultKit(Kit *k) const KitManagerConfigWidget *KitModel::widget(const QModelIndex &index) { KitNode *n = kitNode(index); - return n ? n->widget : 0; + return n ? n->widget : nullptr; } void KitModel::isAutoDetectedChanged() @@ -244,7 +244,7 @@ void KitModel::markForRemoval(Kit *k) setDefaultNode(findItemAtLevel<2>([node](KitNode *kn) { return kn != node; })); takeItem(node); - if (node->widget->configures(0)) + if (node->widget->configures(nullptr)) delete node; else m_toRemoveList.append(node); @@ -252,7 +252,7 @@ void KitModel::markForRemoval(Kit *k) Kit *KitModel::markForAddition(Kit *baseKit) { - KitNode *node = createNode(0); + KitNode *node = createNode(nullptr); m_manualRoot->appendChild(node); Kit *k = node->widget->workingCopy(); KitGuard g(k); @@ -331,7 +331,7 @@ void KitModel::removeKit(Kit *k) if (n->widget->configures(k)) { m_toRemoveList.removeOne(n); if (m_defaultNode == n) - m_defaultNode = 0; + m_defaultNode = nullptr; delete n; return; } diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 24535eb57c..262d6c2706 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -157,7 +157,7 @@ void KitOptionsPageWidget::kitSelectionChanged() void KitOptionsPageWidget::addNewKit() { - Kit *k = m_model->markForAddition(0); + Kit *k = m_model->markForAddition(nullptr); QModelIndex newIdx = m_model->indexOf(k); m_selectionModel->select(newIdx, diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 438fed2834..adc7ad7125 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -66,7 +66,7 @@ static QIcon createCenteredIcon(const QIcon &icon, const QIcon &overlay) { QPixmap targetPixmap; const qreal appDevicePixelRatio = qApp->devicePixelRatio(); - const int deviceSpaceIconSize = static_cast<int>(Core::Constants::MODEBAR_ICON_SIZE * appDevicePixelRatio); + const auto deviceSpaceIconSize = static_cast<int>(Core::Constants::MODEBAR_ICON_SIZE * appDevicePixelRatio); targetPixmap = QPixmap(deviceSpaceIconSize, deviceSpaceIconSize); targetPixmap.setDevicePixelRatio(appDevicePixelRatio); targetPixmap.fill(Qt::transparent); @@ -107,10 +107,10 @@ class TargetSelectorDelegate : public QItemDelegate public: TargetSelectorDelegate(ListWidget *parent) : QItemDelegate(parent), m_listWidget(parent) { } private: - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const override; ListWidget *m_listWidget; }; @@ -227,8 +227,8 @@ void ListWidget::setOptimalWidth(int width) int ListWidget::padding() { // there needs to be enough extra pixels to show a scrollbar - return 2 * style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, this) - + style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, this) + return 2 * style()->pixelMetric(QStyle::PM_FocusFrameHMargin, nullptr, this) + + style()->pixelMetric(QStyle::PM_ScrollBarExtent, nullptr, this) + 10; } @@ -272,7 +272,7 @@ void ProjectListWidget::addProject(Project *project) int pos = count(); for (int i = 0; i < count(); ++i) { - Project *p = item(i)->data(Qt::UserRole).value<Project*>(); + auto *p = item(i)->data(Qt::UserRole).value<Project*>(); if (projectLesserThan(project, p)) { pos = i; break; @@ -281,7 +281,7 @@ void ProjectListWidget::addProject(Project *project) bool useFullName = false; for (int i = 0; i < count(); ++i) { - Project *p = item(i)->data(Qt::UserRole).value<Project*>(); + auto *p = item(i)->data(Qt::UserRole).value<Project*>(); if (p->displayName() == project->displayName()) { useFullName = true; item(i)->setText(fullName(p)); @@ -289,7 +289,7 @@ void ProjectListWidget::addProject(Project *project) } QString displayName = useFullName ? fullName(project) : project->displayName(); - QListWidgetItem *item = new QListWidgetItem(); + auto *item = new QListWidgetItem(); item->setData(Qt::UserRole, QVariant::fromValue(project)); item->setText(displayName); insertItem(pos, item); @@ -317,14 +317,14 @@ void ProjectListWidget::removeProject(Project *project) int countDisplayName = 0; int otherIndex = -1; for (int i = 0; i < count(); ++i) { - Project *p = item(i)->data(Qt::UserRole).value<Project *>(); + auto *p = item(i)->data(Qt::UserRole).value<Project *>(); if (p->displayName() == name) { ++countDisplayName; otherIndex = i; } } if (countDisplayName == 1) { - Project *p = item(otherIndex)->data(Qt::UserRole).value<Project *>(); + auto *p = item(otherIndex)->data(Qt::UserRole).value<Project *>(); item(otherIndex)->setText(p->displayName()); } @@ -346,7 +346,7 @@ void ProjectListWidget::projectDisplayNameChanged(Project *project) int oldPos = 0; bool useFullName = false; for (int i = 0; i < count(); ++i) { - Project *p = item(i)->data(Qt::UserRole).value<Project*>(); + auto *p = item(i)->data(Qt::UserRole).value<Project*>(); if (p == project) { oldPos = i; } else if (p->displayName() == project->displayName()) { @@ -360,7 +360,7 @@ void ProjectListWidget::projectDisplayNameChanged(Project *project) int pos = count(); for (int i = 0; i < count(); ++i) { - Project *p = item(i)->data(Qt::UserRole).value<Project*>(); + auto *p = item(i)->data(Qt::UserRole).value<Project*>(); if (projectLesserThan(project, p)) { pos = i; break; @@ -389,7 +389,7 @@ void ProjectListWidget::setProject(int index) return; if (index < 0) return; - Project *p = item(index)->data(Qt::UserRole).value<Project *>(); + auto *p = item(index)->data(Qt::UserRole).value<Project *>(); SessionManager::setStartupProject(p); } @@ -415,7 +415,7 @@ void GenericListWidget::setProjectConfigurations(const QList<ProjectConfiguratio clear(); for (int i = 0; i < count(); ++i) { - ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); + auto *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); disconnect(p, &ProjectConfiguration::displayNameChanged, this, &GenericListWidget::displayNameChanged); } @@ -450,7 +450,7 @@ void GenericListWidget::addProjectConfiguration(ProjectConfiguration *pc) // Figure out pos int pos = count(); for (int i = 0; i < count(); ++i) { - ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); + auto *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); if (caseFriendlyCompare(pc->displayName(), p->displayName()) < 0) { pos = i; break; @@ -480,7 +480,7 @@ void GenericListWidget::removeProjectConfiguration(ProjectConfiguration *pc) QFontMetrics fn(font()); int width = 0; for (int i = 0; i < count(); ++i) { - ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); + auto *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); width = qMax(width, fn.width(p->displayName()) + padding()); } setOptimalWidth(width); @@ -504,7 +504,7 @@ void GenericListWidget::displayNameChanged() if (currentItem()) activeProjectConfiguration = currentItem()->data(Qt::UserRole).value<ProjectConfiguration *>(); - ProjectConfiguration *pc = qobject_cast<ProjectConfiguration *>(sender()); + auto *pc = qobject_cast<ProjectConfiguration *>(sender()); int index = -1; int i = 0; for (; i < count(); ++i) { @@ -520,7 +520,7 @@ void GenericListWidget::displayNameChanged() lwi->setText(pc->displayName()); int pos = count(); for (int i = 0; i < count(); ++i) { - ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); + auto *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); if (caseFriendlyCompare(pc->displayName(), p->displayName()) < 0) { pos = i; break; @@ -533,7 +533,7 @@ void GenericListWidget::displayNameChanged() QFontMetrics fn(font()); int width = 0; for (int i = 0; i < count(); ++i) { - ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); + auto *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>(); width = qMax(width, fn.width(p->displayName()) + padding()); } setOptimalWidth(width); @@ -543,7 +543,7 @@ void GenericListWidget::displayNameChanged() void GenericListWidget::toolTipChanged() { - ProjectConfiguration *pc = qobject_cast<ProjectConfiguration *>(sender()); + auto *pc = qobject_cast<ProjectConfiguration *>(sender()); if (QListWidgetItem *lwi = itemForProjectConfiguration(pc)) { lwi->setData(Qt::ToolTipRole, pc->toolTip()); lwi->setData(Qt::UserRole + 1, pc->toolTip()); @@ -646,9 +646,9 @@ void KitAreaWidget::updateKit(Kit *k) QWidget *MiniProjectTargetSelector::createTitleLabel(const QString &text) { - StyledBar *bar = new StyledBar(this); + auto *bar = new StyledBar(this); bar->setSingleRow(true); - QVBoxLayout *toolLayout = new QVBoxLayout(bar); + auto *toolLayout = new QVBoxLayout(bar); toolLayout->setContentsMargins(6, 0, 6, 0); toolLayout->setSpacing(0); @@ -864,7 +864,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) // if there's a configured project in the seesion // that could be improved static QStatusBar *statusBar = Core::ICore::statusBar(); - static QWidget *actionBar = Core::ICore::mainWindow()->findChild<QWidget*>(QLatin1String("actionbar")); + static auto *actionBar = Core::ICore::mainWindow()->findChild<QWidget*>(QLatin1String("actionbar")); Q_ASSERT(actionBar); m_kitAreaWidget->move(0, 0); @@ -1407,7 +1407,7 @@ void MiniProjectTargetSelector::nextOrShow() } else { m_hideOnRelease = true; m_earliestHidetime = QDateTime::currentDateTime().addMSecs(800); - if (ListWidget *lw = qobject_cast<ListWidget *>(focusWidget())) { + if (auto *lw = qobject_cast<ListWidget *>(focusWidget())) { if (lw->currentRow() < lw->count() -1) lw->setCurrentRow(lw->currentRow() + 1); else diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 1a2757e5ca..cd48fe16f4 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -389,10 +389,10 @@ static QByteArray msvcCompilationFile() "_WIN64", "_WINRT_DLL", "_Wp64", - 0 + nullptr }; QByteArray file = "#define __PPOUT__(x) V##x=x\n\n"; - for (int i = 0; macros[i] != 0; ++i) + for (int i = 0; macros[i] != nullptr; ++i) file += msvcCompilationDefine(macros[i]); file += "\nvoid main(){}\n\n"; return file; @@ -778,7 +778,7 @@ MsvcBasedToolChainConfigWidget::MsvcBasedToolChainConfigWidget(ToolChain *tc) : void MsvcBasedToolChainConfigWidget::setFromMsvcToolChain() { - const MsvcToolChain *tc = static_cast<const MsvcToolChain *>(toolChain()); + const auto *tc = static_cast<const MsvcToolChain *>(toolChain()); QTC_ASSERT(tc, return); m_nameDisplayLabel->setText(tc->displayName()); QString varsBatDisplay = QDir::toNativeSeparators(tc->varsBat()); @@ -1251,7 +1251,7 @@ bool MsvcToolChain::operator ==(const ToolChain &other) const { if (!AbstractMsvcToolChain::operator ==(other)) return false; - const MsvcToolChain *msvcTc = static_cast<const MsvcToolChain *>(&other); + const auto *msvcTc = static_cast<const MsvcToolChain *>(&other); return m_varsBatArg == msvcTc->m_varsBatArg; } diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index d785106722..cb2a9772c3 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -38,8 +38,7 @@ static inline QByteArray msgFileComparisonFail(const Utils::FileName &f1, const return result.toLocal8Bit(); } -OutputParserTester::OutputParserTester() -{ } +OutputParserTester::OutputParserTester() = default; // test functions: void OutputParserTester::testParsing(const QString &lines, diff --git a/src/plugins/projectexplorer/panelswidget.cpp b/src/plugins/projectexplorer/panelswidget.cpp index 2ba2e5c583..882f4d0f44 100644 --- a/src/plugins/projectexplorer/panelswidget.cpp +++ b/src/plugins/projectexplorer/panelswidget.cpp @@ -62,7 +62,7 @@ public: setMinimumHeight(1); setMaximumHeight(1); } - void paintEvent(QPaintEvent *e) + void paintEvent(QPaintEvent *e) override { Q_UNUSED(e); QPainter p(this); @@ -77,7 +77,7 @@ public: RootWidget(QWidget *parent) : QWidget(parent) { setFocusPolicy(Qt::NoFocus); } - void paintEvent(QPaintEvent *); + void paintEvent(QPaintEvent *) override; }; void RootWidget::paintEvent(QPaintEvent *e) @@ -153,9 +153,7 @@ PanelsWidget::PanelsWidget(const QString &displayName, const QIcon &icon, QWidge addPropertiesPanel(displayName, icon, widget); } -PanelsWidget::~PanelsWidget() -{ -} +PanelsWidget::~PanelsWidget() = default; /* * Add a widget with heading information into the grid diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 08082200a6..164f299b3b 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2447,7 +2447,7 @@ void ProjectExplorerPluginPrivate::runProjectContextMenu() auto act = qobject_cast<QAction *>(sender()); if (!act) return; - RunConfiguration *rc = act->data().value<RunConfiguration *>(); + auto *rc = act->data().value<RunConfiguration *>(); if (!rc) return; m_instance->runRunConfiguration(rc, Constants::NORMAL_RUN_MODE); @@ -2877,7 +2877,7 @@ void ProjectExplorerPluginPrivate::updateUnloadProjectMenu() void ProjectExplorerPluginPrivate::updateRecentProjectMenu() { - typedef QList<QPair<QString, QString> >::const_iterator StringPairListConstIterator; + using StringPairListConstIterator = QList<QPair<QString, QString> >::const_iterator; ActionContainer *aci = ActionManager::actionContainer(Constants::M_RECENTPROJECTS); QMenu *menu = aci->menu(); menu->clear(); @@ -2994,7 +2994,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions() } else if (runConfigs.count() > 1) { runMenu->menu()->menuAction()->setVisible(true); foreach (RunConfiguration *rc, runConfigs) { - QAction *act = new QAction(runMenu->menu()); + auto *act = new QAction(runMenu->menu()); act->setData(QVariant::fromValue(rc)); act->setText(tr("Run %1").arg(rc->displayName())); runMenu->menu()->addAction(act); @@ -3099,7 +3099,7 @@ void ProjectExplorerPluginPrivate::updateLocationSubMenus() for (const FolderNode::LocationInfo &li : locations) { const int line = li.line; const Utils::FileName path = li.path; - QAction *action = new QAction(li.displayName, nullptr); + auto *action = new QAction(li.displayName, nullptr); connect(action, &QAction::triggered, this, [line, path]() { Core::EditorManager::openEditorAt(path.toString(), line); }); @@ -3442,7 +3442,7 @@ void ProjectExplorerPluginPrivate::updateSessionMenu() m_sessionMenu->clear(); dd->m_sessionMenu->addAction(dd->m_sessionManagerAction); dd->m_sessionMenu->addSeparator(); - QActionGroup *ag = new QActionGroup(m_sessionMenu); + auto *ag = new QActionGroup(m_sessionMenu); connect(ag, &QActionGroup::triggered, this, &ProjectExplorerPluginPrivate::setSession); const QString activeSession = SessionManager::activeSession(); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index cbb375da61..a4d9e39d9b 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -178,7 +178,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const Qt::ItemFlags FlatModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return nullptr; // We claim that everything is editable // That's slightly wrong // We control the only view, and that one does the checks diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 688c7b245c..f2f94d9880 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -202,7 +202,7 @@ public: NavigationTreeView::setModel(newModel); } - ~ProjectTreeView() + ~ProjectTreeView() override { ICore::removeContextObject(m_context); delete m_context; @@ -423,7 +423,7 @@ void ProjectTreeWidget::editCurrentItem() const Node *node = m_model->nodeForIndex(currentIndex); if (!node) return; - QLineEdit *editor = qobject_cast<QLineEdit*>(m_view->indexWidget(currentIndex)); + auto *editor = qobject_cast<QLineEdit*>(m_view->indexWidget(currentIndex)); if (!editor) return; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index b0ad690ef7..028c8e9ccf 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -78,7 +78,7 @@ public: : m_factory(factory), m_project(project) {} - ~MiscSettingsPanelItem() { delete m_widget; } + ~MiscSettingsPanelItem() override { delete m_widget; } QVariant data(int column, int role) const override; Qt::ItemFlags flags(int column) const override; @@ -174,7 +174,7 @@ public: Q_UNUSED(column) if (role == ItemActivatedFromBelowRole) { - TreeItem *item = data.value<TreeItem *>(); + auto *item = data.value<TreeItem *>(); QTC_ASSERT(item, return false); m_currentPanelIndex = indexOf(item); QTC_ASSERT(m_currentPanelIndex != -1, return false); @@ -198,7 +198,7 @@ private: class ProjectItem : public TreeItem { public: - ProjectItem() {} + ProjectItem() = default; ProjectItem(Project *project, const std::function<void()> &changeListener) : m_project(project), m_changeListener(changeListener) @@ -279,7 +279,7 @@ public: QModelIndex activeIndex() const { - TreeItem *activeItem = data(0, ActiveItemRole).value<TreeItem *>(); + auto *activeItem = data(0, ActiveItemRole).value<TreeItem *>(); return activeItem ? activeItem->index() : QModelIndex(); } @@ -295,7 +295,7 @@ private: class SelectorDelegate : public QStyledItemDelegate { public: - SelectorDelegate() {} + SelectorDelegate() = default; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const final; @@ -538,8 +538,8 @@ public: void handleImportBuild() { ProjectItem *projectItem = m_projectsModel.rootItem()->childAt(0); - Project *project = projectItem ? projectItem->project() : 0; - ProjectImporter *projectImporter = project ? project->projectImporter() : 0; + Project *project = projectItem ? projectItem->project() : nullptr; + ProjectImporter *projectImporter = project ? project->projectImporter() : nullptr; QTC_ASSERT(projectImporter, return); QString dir = project->projectDirectory().toString(); diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 062439db64..ee86abe895 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -68,8 +68,8 @@ public: AddNewTree(FolderNode *node, QList<AddNewTree *> children, const QString &displayName); AddNewTree(FolderNode *node, QList<AddNewTree *> children, const FolderNode::AddNewInformation &info); - QVariant data(int column, int role) const; - Qt::ItemFlags flags(int column) const; + QVariant data(int column, int role) const override; + Qt::ItemFlags flags(int column) const override; QString displayName() const { return m_displayName; } FolderNode *node() const { return m_node; } @@ -202,7 +202,7 @@ void BestNodeSelector::inspect(AddNewTree *tree, bool isContextNode) AddNewTree *BestNodeSelector::bestChoice() const { if (m_deploys) - return 0; + return nullptr; return m_bestChoice; } diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 43f636e888..12ded83d40 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -890,7 +890,7 @@ public: } } - ~RunControlPrivate() + ~RunControlPrivate() override { QTC_CHECK(state == RunControlState::Finished || state == RunControlState::Initialized); disconnect(); @@ -1048,7 +1048,7 @@ RunWorkerFactory::WorkerCreator RunControl::producer(RunConfiguration *runConfig if (candidates.empty()) return {}; - const auto higherPriority = std::bind(std::greater<int>(), + const auto higherPriority = std::bind(std::greater<>(), std::bind(&RunWorkerFactory::priority, std::placeholders::_1), std::bind(&RunWorkerFactory::priority, std::placeholders::_2)); const auto bestFactory = std::max_element(candidates.begin(), candidates.end(), higherPriority); diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index a8fce7aee4..6895a6457e 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -700,7 +700,7 @@ void SelectableFilesWidget::parsingFinished() const Utils::FileNameList preservedFiles = m_model->preservedFiles(); m_preservedFilesLabel->setText(tr("Not showing %n files that are outside of the base directory.\n" - "These files are preserved.", 0, preservedFiles.count())); + "These files are preserved.", nullptr, preservedFiles.count())); enableWidgets(true); } diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp index 5145bd0c7e..2dfb944a35 100644 --- a/src/plugins/projectexplorer/sessiondialog.cpp +++ b/src/plugins/projectexplorer/sessiondialog.cpp @@ -39,8 +39,8 @@ class SessionValidator : public QValidator { public: SessionValidator(QObject *parent, const QStringList &sessions); - void fixup(QString & input) const; - QValidator::State validate(QString & input, int & pos) const; + void fixup(QString & input) const override; + QValidator::State validate(QString & input, int & pos) const override; private: QStringList m_sessions; }; diff --git a/src/plugins/projectexplorer/sessionview.cpp b/src/plugins/projectexplorer/sessionview.cpp index 3f99aa6794..4e3bda6510 100644 --- a/src/plugins/projectexplorer/sessionview.cpp +++ b/src/plugins/projectexplorer/sessionview.cpp @@ -42,7 +42,7 @@ public: } protected: - void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; }; void RemoveItemFocusDelegate::paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex &index) const diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 94813f6200..71d52af9e3 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -208,7 +208,7 @@ class TargetGroupItemPrivate : public QObject public: TargetGroupItemPrivate(TargetGroupItem *q, Project *project); - ~TargetGroupItemPrivate(); + ~TargetGroupItemPrivate() override; void handleRemovedKit(Kit *kit); void handleAddedKit(Kit *kit); @@ -302,7 +302,7 @@ public: Qt::ItemFlags flags(int column) const override { Q_UNUSED(column) - return m_kitErrorsForProject ? Qt::ItemFlags(0) + return m_kitErrorsForProject ? Qt::ItemFlags({}) : Qt::ItemFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); } @@ -375,7 +375,7 @@ public: Q_UNUSED(column) if (role == ContextMenuItemAdderRole) { - QMenu *menu = data.value<QMenu *>(); + auto *menu = data.value<QMenu *>(); addToContextMenu(menu); return true; } @@ -663,7 +663,7 @@ public: { Q_UNUSED(column) if (role == ContextMenuItemAdderRole) { - QMenu *menu = data.value<QMenu *>(); + auto *menu = data.value<QMenu *>(); auto enableAction = menu->addAction(tr("Enable Kit")); enableAction->setEnabled(!isEnabled()); QObject::connect(enableAction, &QAction::triggered, [this] { diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index bc99334c93..94185f7c8f 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -529,13 +529,13 @@ TargetSetupWidget *TargetSetupPage::addWidget(Kit *k) if (factory) return factory->availableSetups(k, m_projectPath); - BuildInfo *info = new BuildInfo(nullptr); + auto *info = new BuildInfo(nullptr); info->kitId = k->id(); return QList<BuildInfo *>({info}); }(); // Not all projects have BuildConfigurations, that is perfectly fine. - TargetSetupWidget *widget = new TargetSetupWidget(k, m_projectPath); + auto *widget = new TargetSetupWidget(k, m_projectPath); m_baseLayout->removeWidget(m_importWidget); foreach (QWidget *potentialWidget, m_potentialWidgets) diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index b59f3dbb56..9635128415 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -149,7 +149,7 @@ void TargetSetupWidget::addBuildInfo(BuildInfo *info, bool isImport) m_haveImported = true; } - const int pos = static_cast<int>(m_infoStore.size()); + const auto pos = static_cast<int>(m_infoStore.size()); BuildInfoStore store; store.buildInfo = info; @@ -233,7 +233,7 @@ QList<BuildInfo *> TargetSetupWidget::buildInfoList(const Kit *k, const QString if (factory) return factory->availableSetups(k, projectPath); - BuildInfo *info = new BuildInfo(nullptr); + auto *info = new BuildInfo(nullptr); info->kitId = k->id(); return QList<BuildInfo *>({info}); } @@ -303,7 +303,7 @@ void TargetSetupWidget::pathChanged() void TargetSetupWidget::reportIssues(int index) { - const int size = static_cast<int>(m_infoStore.size()); + const auto size = static_cast<int>(m_infoStore.size()); QTC_ASSERT(index >= 0 && index < size, return); BuildInfoStore &store = m_infoStore[static_cast<size_t>(index)]; diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp index 726034f066..5ed8aa9677 100644 --- a/src/plugins/projectexplorer/taskhub.cpp +++ b/src/plugins/projectexplorer/taskhub.cpp @@ -76,12 +76,12 @@ public: setVisible(!task.icon.isNull()); } - bool isClickable() const; - void clicked(); + bool isClickable() const override; + void clicked() override; - void updateFileName(const FileName &fileName); - void updateLineNumber(int lineNumber); - void removedFromEditor(); + void updateFileName(const FileName &fileName) override; + void updateLineNumber(int lineNumber) override; + void removedFromEditor() override; private: unsigned int m_id; }; diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 0b3381fadc..a7ac388487 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -161,7 +161,7 @@ void TaskModel::updateTaskLineNumber(unsigned int id, int line) void TaskModel::clearTasks(Core::Id categoryId) { - typedef QHash<Core::Id,CategoryData>::ConstIterator IdCategoryConstIt; + using IdCategoryConstIt = QHash<Core::Id,CategoryData>::ConstIterator; if (!categoryId.isValid()) { if (m_tasks.isEmpty()) diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 79255cd367..418d590fee 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -74,9 +74,9 @@ namespace Internal { class TaskView : public Utils::ListView { public: - TaskView(QWidget *parent = 0); - ~TaskView(); - void resizeEvent(QResizeEvent *e); + TaskView(QWidget *parent = nullptr); + ~TaskView() override; + void resizeEvent(QResizeEvent *e) override; }; class TaskWindowContext : public Core::IContext @@ -92,10 +92,10 @@ class TaskDelegate : public QStyledItemDelegate friend class TaskView; // for using Positions::minimumSize() public: - TaskDelegate(QObject * parent = 0); - ~TaskDelegate(); - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + TaskDelegate(QObject * parent = nullptr); + ~TaskDelegate() override; + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; // TaskView uses this method if the size of the taskview changes void emitSizeHintChanged(const QModelIndex &index); @@ -105,7 +105,7 @@ public: private: void generateGradientPixmap(int width, int height, QColor color, bool selected) const; - mutable int m_cachedHeight; + mutable int m_cachedHeight = 0; mutable QFont m_cachedFont; /* @@ -194,8 +194,7 @@ TaskView::TaskView(QWidget *parent) verticalScrollBar()->setSingleStep(vStepSize); } -TaskView::~TaskView() -{ } +TaskView::~TaskView() = default; void TaskView::resizeEvent(QResizeEvent *e) { @@ -253,7 +252,7 @@ TaskWindow::TaskWindow() : d(new TaskWindowPrivate) d->m_listview->setFrameStyle(QFrame::NoFrame); d->m_listview->setWindowTitle(displayName()); d->m_listview->setSelectionMode(QAbstractItemView::SingleSelection); - Internal::TaskDelegate *tld = new Internal::TaskDelegate(this); + auto *tld = new Internal::TaskDelegate(this); d->m_listview->setItemDelegate(tld); d->m_listview->setWindowIcon(Icons::WINDOW.icon()); d->m_listview->setContextMenuPolicy(Qt::ActionsContextMenu); @@ -533,7 +532,7 @@ void TaskWindow::setShowWarnings(bool show) void TaskWindow::updateCategoriesMenu() { - typedef QMap<QString, Core::Id>::ConstIterator NameToIdsConstIt; + using NameToIdsConstIt = QMap<QString, Core::Id>::ConstIterator; d->m_categoriesMenu->clear(); @@ -670,13 +669,10 @@ bool TaskWindow::canNavigate() const ///// TaskDelegate::TaskDelegate(QObject *parent) : - QStyledItemDelegate(parent), - m_cachedHeight(0) + QStyledItemDelegate(parent) { } -TaskDelegate::~TaskDelegate() -{ -} +TaskDelegate::~TaskDelegate() = default; QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 4cc3ee120d..a28a035d3d 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -53,7 +53,7 @@ namespace Internal { class ToolChainPrivate { public: - typedef ToolChain::Detection Detection; + using Detection = ToolChain::Detection; explicit ToolChainPrivate(Core::Id typeId, Detection d) : m_id(QUuid::createUuid().toByteArray()), diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 15ebda4998..562c7c6d62 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -75,7 +75,7 @@ public: } } - QVariant data(int column, int role) const + QVariant data(int column, int role) const override { switch (role) { case Qt::DisplayRole: diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 301ab75071..39b465bea4 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -287,7 +287,7 @@ QList<ToolChain *> ToolChainSettingsAccessor::toolChains(const QVariantMap &data namespace ProjectExplorer { -typedef QList<ToolChain *> TCList; +using TCList = QList<ToolChain *>; class TTC : public ToolChain { diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 82343bafd9..005d3fee21 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -59,7 +59,7 @@ class UserFileVersion1Upgrader : public VersionUpgrader { public: UserFileVersion1Upgrader(UserFileAccessor *a) : VersionUpgrader(1, "1.3+git"), m_accessor(a) { } - QVariantMap upgrade(const QVariantMap &map); + QVariantMap upgrade(const QVariantMap &map) override; private: struct TargetDescription @@ -433,7 +433,7 @@ public: FileNameList UserFileBackUpStrategy::readFileCandidates(const FileName &baseFileName) const { - const UserFileAccessor *const ac = static_cast<const UserFileAccessor *>(accessor()); + const auto *const ac = static_cast<const UserFileAccessor *>(accessor()); const FileName externalUser = ac->externalUserFile(); const FileName projectUser = ac->projectUserFile(); QTC_CHECK(!baseFileName.isEmpty()); @@ -1203,9 +1203,9 @@ static const char * const envExpandedKeys[] = { "Qt4ProjectManager.S60DeviceRunConfiguration.CommandLineArguments", "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory", "CMakeProjectManager.CMakeRunConfiguration.Arguments", - 0, - 0, - 0 + nullptr, + nullptr, + nullptr }; static QString version8NewVar(const QString &old) @@ -1314,11 +1314,11 @@ static const char * const varExpandedKeys[] = { "GenericProjectManager.GenericMakeStep.MakeCommand", "GenericProjectManager.GenericMakeStep.MakeArguments", "GenericProjectManager.GenericMakeStep.BuildTargets", - 0, - 0, - 0, - 0, - 0 + nullptr, + nullptr, + nullptr, + nullptr, + nullptr }; // Translate old-style ${} var expansions into new-style %{} ones @@ -2238,7 +2238,7 @@ public: TestUserFileAccessor(Project *project) : UserFileAccessor(project) { } void storeSharedSettings(const QVariantMap &data) const { m_storedSettings = data; } - QVariant retrieveSharedSettings() const { return m_storedSettings; } + QVariant retrieveSharedSettings() const override { return m_storedSettings; } using UserFileAccessor::preprocessReadSettings; using UserFileAccessor::prepareToWriteSettings; diff --git a/src/plugins/projectexplorer/windebuginterface.cpp b/src/plugins/projectexplorer/windebuginterface.cpp index 985fec933f..ce3950acb9 100644 --- a/src/plugins/projectexplorer/windebuginterface.cpp +++ b/src/plugins/projectexplorer/windebuginterface.cpp @@ -81,31 +81,31 @@ WinDebugInterface::~WinDebugInterface() void WinDebugInterface::run() { - m_waitHandles[DataReadyEventHandle] = m_waitHandles[TerminateEventHandle] = 0; - m_bufferReadyEvent = 0; - m_sharedFile = 0; - m_sharedMem = 0; + m_waitHandles[DataReadyEventHandle] = m_waitHandles[TerminateEventHandle] = nullptr; + m_bufferReadyEvent = nullptr; + m_sharedFile = nullptr; + m_sharedMem = nullptr; if (!runLoop()) emit cannotRetrieveDebugOutput(); if (m_sharedMem) { UnmapViewOfFile(m_sharedMem); - m_sharedMem = 0; + m_sharedMem = nullptr; } if (m_sharedFile) { CloseHandle(m_sharedFile); - m_sharedFile = 0; + m_sharedFile = nullptr; } if (m_waitHandles[TerminateEventHandle]) { CloseHandle(m_waitHandles[TerminateEventHandle]); - m_waitHandles[TerminateEventHandle] = 0; + m_waitHandles[TerminateEventHandle] = nullptr; } if (m_waitHandles[DataReadyEventHandle]) { CloseHandle(m_waitHandles[DataReadyEventHandle]); - m_waitHandles[DataReadyEventHandle] = 0; + m_waitHandles[DataReadyEventHandle] = nullptr; } if (m_bufferReadyEvent) { CloseHandle(m_bufferReadyEvent); - m_bufferReadyEvent = 0; + m_bufferReadyEvent = nullptr; } } @@ -130,7 +130,7 @@ bool WinDebugInterface::runLoop() return false; LPSTR message = reinterpret_cast<LPSTR>(m_sharedMem) + sizeof(DWORD); - LPDWORD processId = reinterpret_cast<LPDWORD>(m_sharedMem); + auto processId = reinterpret_cast<LPDWORD>(m_sharedMem); SetEvent(m_bufferReadyEvent); diff --git a/src/plugins/projectexplorer/xcodebuildparser.cpp b/src/plugins/projectexplorer/xcodebuildparser.cpp index 470cb7fcae..a96d4bb097 100644 --- a/src/plugins/projectexplorer/xcodebuildparser.cpp +++ b/src/plugins/projectexplorer/xcodebuildparser.cpp @@ -270,8 +270,8 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data() void ProjectExplorerPlugin::testXcodebuildParserParsing() { OutputParserTester testbench; - XcodebuildParser *childParser = new XcodebuildParser; - XcodebuildParserTester *tester = new XcodebuildParserTester(childParser); + auto *childParser = new XcodebuildParser; + auto *tester = new XcodebuildParserTester(childParser); connect(&testbench, &OutputParserTester::aboutToDeleteParser, tester, &XcodebuildParserTester::onAboutToDeleteParser); |