diff --git a/src/AirspaceManagement/AirspaceFlightPlanProvider.cc b/src/AirspaceManagement/AirspaceFlightPlanProvider.cc index 434c5b8745a101ff3bc7791deda4b7a092c5dba7..a46bc19ab6b278235d9c5d1bb4928e9e87dc4271 100644 --- a/src/AirspaceManagement/AirspaceFlightPlanProvider.cc +++ b/src/AirspaceManagement/AirspaceFlightPlanProvider.cc @@ -41,7 +41,7 @@ AirspaceFlightInfo* AirspaceFlightModel::get(int index) { if (index < 0 || index >= _flightEntries.count()) { - return NULL; + return nullptr; } return _flightEntries[index]; } diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc index 421d34d1c2022b912761a81445433df45ab825c6..9bfe1bf95dcfd61c34b43cdee62c4f566ba19cee 100644 --- a/src/AnalyzeView/LogDownloadController.cc +++ b/src/AnalyzeView/LogDownloadController.cc @@ -104,9 +104,9 @@ QGCLogEntry::sizeStr() const //---------------------------------------------------------------------------------------- LogDownloadController::LogDownloadController(void) - : _uas(NULL) - , _downloadData(NULL) - , _vehicle(NULL) + : _uas(nullptr) + , _downloadData(nullptr) + , _vehicle(nullptr) , _requestingLogEntries(false) , _downloadingLogs(false) , _retries(0) @@ -137,7 +137,7 @@ LogDownloadController::_setActiveVehicle(Vehicle* vehicle) _logEntriesModel.clear(); disconnect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry); disconnect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData); - _uas = NULL; + _uas = nullptr; } _vehicle = vehicle; if(_vehicle) { @@ -566,7 +566,7 @@ LogDownloadController::_getNextSelected() } } } - return NULL; + return nullptr; } //---------------------------------------------------------------------------------------- @@ -575,7 +575,7 @@ LogDownloadController::_prepareLogDownload() { if(_downloadData) { delete _downloadData; - _downloadData = NULL; + _downloadData = nullptr; } QGCLogEntry* entry = _getNextSelected(); if(!entry) { @@ -634,7 +634,7 @@ LogDownloadController::_prepareLogDownload() } _downloadData->entry->setStatus(tr("Error")); delete _downloadData; - _downloadData = NULL; + _downloadData = nullptr; } return result; } @@ -709,7 +709,7 @@ QGCLogEntry* QGCLogModel::get(int index) { if (index < 0 || index >= _logEntries.count()) { - return NULL; + return nullptr; } return _logEntries[index]; } diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponent.h b/src/AutoPilotPlugins/APM/APMAirframeComponent.h index 1f24bd5ffc935047bcf307311d2b3c99a28d1df4..cdf41165ef509365eda1f275136c4917f35cdae2 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponent.h +++ b/src/AutoPilotPlugins/APM/APMAirframeComponent.h @@ -18,7 +18,7 @@ class APMAirframeComponent : public VehicleComponent Q_OBJECT public: - APMAirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMAirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override; diff --git a/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc b/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc index 318dfed265c3925408eb446b122467cbb060fa10..7dab87766fe14d9bbb07509474f28d22c10b6dc0 100644 --- a/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc @@ -38,19 +38,19 @@ APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent) : AutoPilotPlugin (vehicle, parent) , _incorrectParameterVersion(false) - , _airframeComponent (NULL) - , _cameraComponent (NULL) - , _lightsComponent (NULL) - , _subFrameComponent (NULL) - , _flightModesComponent (NULL) - , _powerComponent (NULL) - , _motorComponent (NULL) - , _radioComponent (NULL) - , _safetyComponent (NULL) - , _sensorsComponent (NULL) - , _tuningComponent (NULL) - , _esp8266Component (NULL) - , _heliComponent (NULL) + , _airframeComponent (nullptr) + , _cameraComponent (nullptr) + , _lightsComponent (nullptr) + , _subFrameComponent (nullptr) + , _flightModesComponent (nullptr) + , _powerComponent (nullptr) + , _motorComponent (nullptr) + , _radioComponent (nullptr) + , _safetyComponent (nullptr) + , _sensorsComponent (nullptr) + , _tuningComponent (nullptr) + , _esp8266Component (nullptr) + , _heliComponent (nullptr) { #if !defined(NO_SERIAL_LINK) && !defined(__android__) connect(vehicle->parameterManager(), &ParameterManager::parametersReadyChanged, this, &APMAutoPilotPlugin::_checkForBadCubeBlack); diff --git a/src/AutoPilotPlugins/APM/APMCameraComponent.h b/src/AutoPilotPlugins/APM/APMCameraComponent.h index 1a326f684170b7c4ab042961b90400e650cf442f..635d970f7ce481f15cebc78205d316ed868308b5 100644 --- a/src/AutoPilotPlugins/APM/APMCameraComponent.h +++ b/src/AutoPilotPlugins/APM/APMCameraComponent.h @@ -18,7 +18,7 @@ class APMCameraComponent : public VehicleComponent Q_OBJECT public: - APMCameraComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMCameraComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/APM/APMCompassCal.cc b/src/AutoPilotPlugins/APM/APMCompassCal.cc index d07d148fdd4c1e57cead35fa68c43bb01bd07585..727859b5710fb1499f9a0b43fa11b3739dd94326 100644 --- a/src/AutoPilotPlugins/APM/APMCompassCal.cc +++ b/src/AutoPilotPlugins/APM/APMCompassCal.cc @@ -73,9 +73,9 @@ CalWorkerThread::calibrate_return CalWorkerThread::calibrate(void) for (size_t cur_mag=0; cur_mag(malloc(sizeof(float) * calibration_points_maxcount)); worker_data.y[cur_mag] = reinterpret_cast(malloc(sizeof(float) * calibration_points_maxcount)); worker_data.z[cur_mag] = reinterpret_cast(malloc(sizeof(float) * calibration_points_maxcount)); - if (worker_data.x[cur_mag] == NULL || worker_data.y[cur_mag] == NULL || worker_data.z[cur_mag] == NULL) { + if (worker_data.x[cur_mag] == nullptr || worker_data.y[cur_mag] == nullptr || worker_data.z[cur_mag] == nullptr) { _emitVehicleTextMessage(QStringLiteral("[cal] ERROR: out of memory")); result = calibrate_return_error; } @@ -576,8 +576,8 @@ int CalWorkerThread::sphere_fit_least_squares(const float x[], const float y[], } APMCompassCal::APMCompassCal(void) - : _vehicle(NULL) - , _calWorkerThread(NULL) + : _vehicle(nullptr) + , _calWorkerThread(nullptr) { } diff --git a/src/AutoPilotPlugins/APM/APMCompassCal.h b/src/AutoPilotPlugins/APM/APMCompassCal.h index 1a512de6ad07d24738172c58fc29c700970cf553..aabc6bebe6fd4a4c9a1e104ed4e7e5edf39c7229 100644 --- a/src/AutoPilotPlugins/APM/APMCompassCal.h +++ b/src/AutoPilotPlugins/APM/APMCompassCal.h @@ -26,7 +26,7 @@ class CalWorkerThread : public QThread Q_OBJECT public: - CalWorkerThread(Vehicle* vehicle, QObject* parent = NULL); + CalWorkerThread(Vehicle* vehicle, QObject* parent = nullptr); // Cancel currently in progress calibration void cancel(void) { _cancel = true; } diff --git a/src/AutoPilotPlugins/APM/APMFlightModesComponent.h b/src/AutoPilotPlugins/APM/APMFlightModesComponent.h index 1511b371c6bf9fda9d7ad67f032a298e87a3e774..73b3a3a0993c0644f3fefd4f237d9a919ceeb389 100644 --- a/src/AutoPilotPlugins/APM/APMFlightModesComponent.h +++ b/src/AutoPilotPlugins/APM/APMFlightModesComponent.h @@ -18,7 +18,7 @@ class APMFlightModesComponent : public VehicleComponent Q_OBJECT public: - APMFlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMFlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/APM/APMHeliComponent.h b/src/AutoPilotPlugins/APM/APMHeliComponent.h index cac462523bb80156bbf6e369c4a8e650fb79a4c5..aa4dd16f64ff24ec876e8535eafc6c58d3edd142 100644 --- a/src/AutoPilotPlugins/APM/APMHeliComponent.h +++ b/src/AutoPilotPlugins/APM/APMHeliComponent.h @@ -16,7 +16,7 @@ class APMHeliComponent : public VehicleComponent Q_OBJECT public: - APMHeliComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMHeliComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override; diff --git a/src/AutoPilotPlugins/APM/APMLightsComponent.h b/src/AutoPilotPlugins/APM/APMLightsComponent.h index 2b71b4ae43e38bbcbce3fc713532718fac42e8ef..129e2b7f4e9c6cd8bf79b9e923ef50d915cc4f55 100644 --- a/src/AutoPilotPlugins/APM/APMLightsComponent.h +++ b/src/AutoPilotPlugins/APM/APMLightsComponent.h @@ -18,7 +18,7 @@ class APMLightsComponent : public VehicleComponent Q_OBJECT public: - APMLightsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMLightsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/APM/APMMotorComponent.h b/src/AutoPilotPlugins/APM/APMMotorComponent.h index 20e4c49191765c96fe24408e9906eab8062843a0..bed9f974f2844e79e9e6f4ca74a95ffb9e83bb07 100644 --- a/src/AutoPilotPlugins/APM/APMMotorComponent.h +++ b/src/AutoPilotPlugins/APM/APMMotorComponent.h @@ -18,7 +18,7 @@ class APMMotorComponent : public MotorComponent Q_OBJECT public: - APMMotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMMotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); QUrl setupSource(void) const final; diff --git a/src/AutoPilotPlugins/APM/APMPowerComponent.h b/src/AutoPilotPlugins/APM/APMPowerComponent.h index 7dbfe5d7bd48b8d206f782381d5493e51fa80bc7..249638e578c3e1bab6c1e12bc6283961324745b7 100644 --- a/src/AutoPilotPlugins/APM/APMPowerComponent.h +++ b/src/AutoPilotPlugins/APM/APMPowerComponent.h @@ -18,7 +18,7 @@ class APMPowerComponent : public VehicleComponent Q_OBJECT public: - APMPowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMPowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Overrides from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override { return QStringList(); } diff --git a/src/AutoPilotPlugins/APM/APMRadioComponent.h b/src/AutoPilotPlugins/APM/APMRadioComponent.h index 2e704a25aae49111c37c9a0d302fd26a07ad70a8..9c4ab6775aac2b0ecfab880bfb4972d557491771 100644 --- a/src/AutoPilotPlugins/APM/APMRadioComponent.h +++ b/src/AutoPilotPlugins/APM/APMRadioComponent.h @@ -19,7 +19,7 @@ class APMRadioComponent : public VehicleComponent Q_OBJECT public: - APMRadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMRadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponent.h b/src/AutoPilotPlugins/APM/APMSafetyComponent.h index f63e70e9e6cfa58dee0d8a53a3612931ee2eac7d..5ce49a38535a74465b720c8a9e4021d391ff44dd 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponent.h +++ b/src/AutoPilotPlugins/APM/APMSafetyComponent.h @@ -18,7 +18,7 @@ class APMSafetyComponent : public VehicleComponent Q_OBJECT public: - APMSafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMSafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override; diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponent.h b/src/AutoPilotPlugins/APM/APMSensorsComponent.h index 451c12c4b52e85db6b8d48c42c2dd650649220c9..5a8bd0b34c51925f7e95619edae4be5a82a543f5 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponent.h +++ b/src/AutoPilotPlugins/APM/APMSensorsComponent.h @@ -18,7 +18,7 @@ class APMSensorsComponent : public VehicleComponent Q_OBJECT public: - APMSensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMSensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); bool compassSetupNeeded(void) const; bool accelSetupNeeded(void) const; diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc b/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc index 14d54704aed17aa4a9c2bea791df56193c1daa3c..45397fcd018119ed9e5f4e6c2809805242fb4893 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentController.cc @@ -24,11 +24,11 @@ QGC_LOGGING_CATEGORY(APMSensorsComponentControllerVerboseLog, "APMSensorsCompone const char* APMSensorsComponentController::_compassCalFitnessParam = "COMPASS_CAL_FIT"; APMSensorsComponentController::APMSensorsComponentController(void) - : _sensorsComponent(NULL) - , _statusLog(NULL) - , _progressBar(NULL) - , _nextButton(NULL) - , _cancelButton(NULL) + : _sensorsComponent(nullptr) + , _statusLog(nullptr) + , _progressBar(nullptr) + , _nextButton(nullptr) + , _cancelButton(nullptr) , _showOrientationCalArea(false) , _calTypeInProgress(CalTypeNone) , _orientationCalDownSideDone(false) diff --git a/src/AutoPilotPlugins/APM/APMSubFrameComponent.h b/src/AutoPilotPlugins/APM/APMSubFrameComponent.h index e635e5724501ef2ecb4128c9621580069aeb17b1..1520718ffa3b60162b1f1af00e41c6df2d445b0b 100644 --- a/src/AutoPilotPlugins/APM/APMSubFrameComponent.h +++ b/src/AutoPilotPlugins/APM/APMSubFrameComponent.h @@ -18,7 +18,7 @@ class APMSubFrameComponent : public VehicleComponent Q_OBJECT public: - APMSubFrameComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + APMSubFrameComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/AutoPilotPlugin.h b/src/AutoPilotPlugins/AutoPilotPlugin.h index 39fd1f78686c330d9a5c260fdc3a8bc881ce52b8..ac2645e0d17ba0118cf3606b26804364e2abb94e 100644 --- a/src/AutoPilotPlugins/AutoPilotPlugin.h +++ b/src/AutoPilotPlugins/AutoPilotPlugin.h @@ -59,7 +59,7 @@ signals: protected: /// All access to AutoPilotPugin objects is through getInstanceForAutoPilotPlugin - AutoPilotPlugin(QObject* parent = NULL) : QObject(parent) { } + AutoPilotPlugin(QObject* parent = nullptr) : QObject(parent) { } Vehicle* _vehicle; FirmwarePlugin* _firmwarePlugin; diff --git a/src/AutoPilotPlugins/Common/ESP8266Component.h b/src/AutoPilotPlugins/Common/ESP8266Component.h index 05e98fe10b3a8e0303e970fe70ad0a74b2e9cc0a..468445177bdb2761796e8dbba6847d71191b3832 100644 --- a/src/AutoPilotPlugins/Common/ESP8266Component.h +++ b/src/AutoPilotPlugins/Common/ESP8266Component.h @@ -17,7 +17,7 @@ class ESP8266Component : public VehicleComponent { Q_OBJECT public: - ESP8266Component (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + ESP8266Component (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList() const; diff --git a/src/AutoPilotPlugins/Common/MotorComponent.h b/src/AutoPilotPlugins/Common/MotorComponent.h index fc3ee48e25c51876da67ac71075098fb038f0d73..1e8f3658983018092801a69ce1e037db5e2c49fc 100644 --- a/src/AutoPilotPlugins/Common/MotorComponent.h +++ b/src/AutoPilotPlugins/Common/MotorComponent.h @@ -19,7 +19,7 @@ class MotorComponent : public VehicleComponent Q_OBJECT public: - MotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + MotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/Common/SyslinkComponent.h b/src/AutoPilotPlugins/Common/SyslinkComponent.h index 8569b1abe87f3e67c7c610cbbc7f7dab4a505cc3..5df0a25517d9949b0b014c7798696661476e7099 100644 --- a/src/AutoPilotPlugins/Common/SyslinkComponent.h +++ b/src/AutoPilotPlugins/Common/SyslinkComponent.h @@ -17,7 +17,7 @@ class SyslinkComponent : public VehicleComponent { Q_OBJECT public: - SyslinkComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + SyslinkComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList() const; diff --git a/src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h b/src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h index 4fa435230a487c7de1bdfbad94ce90a797713759..23e57ace9125d8be4037e394e564a26483c39eae 100644 --- a/src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h +++ b/src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h @@ -23,7 +23,7 @@ class GenericAutoPilotPlugin : public AutoPilotPlugin Q_OBJECT public: - GenericAutoPilotPlugin(Vehicle* vehicle, QObject* parent = NULL); + GenericAutoPilotPlugin(Vehicle* vehicle, QObject* parent = nullptr); // Overrides from AutoPilotPlugin const QVariantList& vehicleComponents(void) final; diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.h b/src/AutoPilotPlugins/PX4/AirframeComponent.h index 273249c1ec383bd5ea7a9bf7523c57e2307fd1ee..ade7cb0cc274ce34ecae70b9cb89679511676f68 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponent.h +++ b/src/AutoPilotPlugins/PX4/AirframeComponent.h @@ -22,7 +22,7 @@ class AirframeComponent : public VehicleComponent Q_OBJECT public: - AirframeComponent(Vehicle* vehicles, AutoPilotPlugin* autopilot, QObject* parent = NULL); + AirframeComponent(Vehicle* vehicles, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent virtual QStringList setupCompleteChangedTriggerList(void) const; diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentController.h b/src/AutoPilotPlugins/PX4/AirframeComponentController.h index 36a1e5162d85d6c7eed1e2db2be311c10b69bf93..f116697de4b164901e5ed091014419b7b57c1df8 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponentController.h +++ b/src/AutoPilotPlugins/PX4/AirframeComponentController.h @@ -71,7 +71,7 @@ class Airframe : public QObject Q_OBJECT public: - Airframe(const QString& name, int autostartId, QObject* parent = NULL); + Airframe(const QString& name, int autostartId, QObject* parent = nullptr); ~Airframe(); Q_PROPERTY(QString text MEMBER _name CONSTANT) @@ -87,7 +87,7 @@ class AirframeType : public QObject Q_OBJECT public: - AirframeType(const QString& name, const QString& imageResource, QObject* parent = NULL); + AirframeType(const QString& name, const QString& imageResource, QObject* parent = nullptr); ~AirframeType(); Q_PROPERTY(QString name MEMBER _name CONSTANT) diff --git a/src/AutoPilotPlugins/PX4/CameraComponent.h b/src/AutoPilotPlugins/PX4/CameraComponent.h index c5c5ecff138d2b0f978e73ec7132486f1f7125cf..fe5c73aabc99aac1b0ffe5bcd30ec173324e39b2 100644 --- a/src/AutoPilotPlugins/PX4/CameraComponent.h +++ b/src/AutoPilotPlugins/PX4/CameraComponent.h @@ -23,7 +23,7 @@ class CameraComponent : public VehicleComponent Q_OBJECT public: - CameraComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + CameraComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList (void) const; diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.h b/src/AutoPilotPlugins/PX4/FlightModesComponent.h index 868fe5eab1423551f446c1127152b8fb9e3ed2fa..ecacc724d606e4ceebc8996f5b32e960fb012b30 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponent.h +++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.h @@ -22,7 +22,7 @@ class FlightModesComponent : public VehicleComponent Q_OBJECT public: - FlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + FlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent virtual QStringList setupCompleteChangedTriggerList(void) const; diff --git a/src/AutoPilotPlugins/PX4/PX4AirframeLoader.h b/src/AutoPilotPlugins/PX4/PX4AirframeLoader.h index a5883e66b4be88311dc55c262efc6019d8fc551b..4d47f66b4e28e34fc62d73f8dc90f844b482a9f5 100644 --- a/src/AutoPilotPlugins/PX4/PX4AirframeLoader.h +++ b/src/AutoPilotPlugins/PX4/PX4AirframeLoader.h @@ -34,7 +34,7 @@ class PX4AirframeLoader : QObject public: /// @param uas Uas which this set of facts is associated with - PX4AirframeLoader(AutoPilotPlugin* autpilot,UASInterface* uas, QObject* parent = NULL); + PX4AirframeLoader(AutoPilotPlugin* autpilot,UASInterface* uas, QObject* parent = nullptr); static void loadAirframeMetaData(void); diff --git a/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc b/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc index adfe990e19d024a6616be66a1ea87ddb5aa960c1..6eaf44465f53be3c08c49bb9aa735a38f078d609 100644 --- a/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc @@ -30,16 +30,16 @@ PX4AutoPilotPlugin::PX4AutoPilotPlugin(Vehicle* vehicle, QObject* parent) : AutoPilotPlugin(vehicle, parent) , _incorrectParameterVersion(false) - , _airframeComponent(NULL) - , _radioComponent(NULL) - , _esp8266Component(NULL) - , _flightModesComponent(NULL) - , _sensorsComponent(NULL) - , _safetyComponent(NULL) - , _powerComponent(NULL) - , _motorComponent(NULL) - , _tuningComponent(NULL) - , _syslinkComponent(NULL) + , _airframeComponent(nullptr) + , _radioComponent(nullptr) + , _esp8266Component(nullptr) + , _flightModesComponent(nullptr) + , _sensorsComponent(nullptr) + , _safetyComponent(nullptr) + , _powerComponent(nullptr) + , _motorComponent(nullptr) + , _tuningComponent(nullptr) + , _syslinkComponent(nullptr) { if (!vehicle) { qWarning() << "Internal error"; diff --git a/src/AutoPilotPlugins/PX4/PX4RadioComponent.h b/src/AutoPilotPlugins/PX4/PX4RadioComponent.h index 035bff7f6033b1038dd2302ed70faf509a135a6e..cfbc4f1afbd95fd5dae452d1ab0a266816d70c1c 100644 --- a/src/AutoPilotPlugins/PX4/PX4RadioComponent.h +++ b/src/AutoPilotPlugins/PX4/PX4RadioComponent.h @@ -18,7 +18,7 @@ class PX4RadioComponent : public VehicleComponent Q_OBJECT public: - PX4RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + PX4RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent virtual QStringList setupCompleteChangedTriggerList(void) const; diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponent.h b/src/AutoPilotPlugins/PX4/PX4TuningComponent.h index 5fe989dde16416afabbf069094485b301fb7f1f0..036247e5407dff879bf8cb7a1a8ed4b694dae04b 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponent.h +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponent.h @@ -18,7 +18,7 @@ class PX4TuningComponent : public VehicleComponent Q_OBJECT public: - PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const final; diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.h b/src/AutoPilotPlugins/PX4/PowerComponent.h index 6ea78976da9a023ef4b83f282e6b3d269c608b6c..0b0e7ffac2a892e939054e71f52fb0983d288bd7 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponent.h +++ b/src/AutoPilotPlugins/PX4/PowerComponent.h @@ -22,7 +22,7 @@ class PowerComponent : public VehicleComponent Q_OBJECT public: - PowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + PowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Overrides from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override; diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.h b/src/AutoPilotPlugins/PX4/SafetyComponent.h index 32bd47bedc53abe084d18cfc5a96dcccf8aa2199..c3ecdf2dd9ef3818c657f593dbff8222cfd5ca3c 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponent.h +++ b/src/AutoPilotPlugins/PX4/SafetyComponent.h @@ -23,7 +23,7 @@ class SafetyComponent : public VehicleComponent Q_OBJECT public: - SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override; diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.h b/src/AutoPilotPlugins/PX4/SensorsComponent.h index 13baae45d977dcf60b804fd06aa46a0349809c88..1b6577b7dc8fe86b3b9ed012cb315a4a426c576c 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponent.h +++ b/src/AutoPilotPlugins/PX4/SensorsComponent.h @@ -22,7 +22,7 @@ class SensorsComponent : public VehicleComponent Q_OBJECT public: - SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); // Virtuals from VehicleComponent QStringList setupCompleteChangedTriggerList(void) const override; diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentController.cc b/src/AutoPilotPlugins/PX4/SensorsComponentController.cc index b13372e8d15969fdc95788095c2d7f15cf89a967..592943e56aad5f60fda12d40e36b496ec4785bae 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentController.cc +++ b/src/AutoPilotPlugins/PX4/SensorsComponentController.cc @@ -19,15 +19,15 @@ QGC_LOGGING_CATEGORY(SensorsComponentControllerLog, "SensorsComponentControllerLog") SensorsComponentController::SensorsComponentController(void) - : _statusLog (NULL) - , _progressBar (NULL) - , _compassButton (NULL) - , _gyroButton (NULL) - , _accelButton (NULL) - , _airspeedButton (NULL) - , _levelButton (NULL) - , _cancelButton (NULL) - , _setOrientationsButton (NULL) + : _statusLog (nullptr) + , _progressBar (nullptr) + , _compassButton (nullptr) + , _gyroButton (nullptr) + , _accelButton (nullptr) + , _airspeedButton (nullptr) + , _levelButton (nullptr) + , _cancelButton (nullptr) + , _setOrientationsButton (nullptr) , _showOrientationCalArea (false) , _gyroCalInProgress (false) , _magCalInProgress (false) diff --git a/src/FactSystem/FactGroup.cc b/src/FactSystem/FactGroup.cc index 55aedaf9869c6f4bc047fc5954ef7414c5918139..18daa57e5597de561b020ea43bb9fcb18fcae623 100644 --- a/src/FactSystem/FactGroup.cc +++ b/src/FactSystem/FactGroup.cc @@ -53,19 +53,19 @@ void FactGroup::_setupTimer() Fact* FactGroup::getFact(const QString& name) { - Fact* fact = NULL; + Fact* fact = nullptr; if (name.contains(".")) { QStringList parts = name.split("."); if (parts.count() != 2) { qWarning() << "Only single level of hierarchy supported"; - return NULL; + return nullptr; } FactGroup * factGroup = getFactGroup(parts[0]); if (!factGroup) { qWarning() << "Unknown FactGroup" << parts[0]; - return NULL; + return nullptr; } return factGroup->getFact(parts[1]); @@ -83,7 +83,7 @@ Fact* FactGroup::getFact(const QString& name) FactGroup* FactGroup::getFactGroup(const QString& name) { - FactGroup* factGroup = NULL; + FactGroup* factGroup = nullptr; if (_nameToFactGroupMap.contains(name)) { factGroup = _nameToFactGroupMap[name]; diff --git a/src/FactSystem/FactGroup.h b/src/FactSystem/FactGroup.h index 9e8320fca0cfcc977f8f70f23e23aac04a58ba6b..3c7f09c6587d47f8df7cf0b36ab45de69d191f1b 100644 --- a/src/FactSystem/FactGroup.h +++ b/src/FactSystem/FactGroup.h @@ -26,8 +26,8 @@ class FactGroup : public QObject Q_OBJECT public: - FactGroup(int updateRateMsecs, const QString& metaDataFile, QObject* parent = NULL); - FactGroup(int updateRateMsecs, QObject* parent = NULL); + FactGroup(int updateRateMsecs, const QString& metaDataFile, QObject* parent = nullptr); + FactGroup(int updateRateMsecs, QObject* parent = nullptr); Q_PROPERTY(QStringList factNames READ factNames CONSTANT) Q_PROPERTY(QStringList factGroupNames READ factGroupNames CONSTANT) diff --git a/src/FactSystem/FactMetaData.cc b/src/FactSystem/FactMetaData.cc index 777a650a46822cf4d29d88bdd777ec383aa78fd4..4316a9473387ddebd6d22d5cd5b358fc8994aa9b 100644 --- a/src/FactSystem/FactMetaData.cc +++ b/src/FactSystem/FactMetaData.cc @@ -933,7 +933,7 @@ const FactMetaData::AppSettingsTranslation_s* FactMetaData::_findAppSettingsDist return pAppSettingsTranslation; } } - return NULL; + return nullptr; } const FactMetaData::AppSettingsTranslation_s* FactMetaData::_findAppSettingsAreaUnitsTranslation(const QString& rawUnits) @@ -953,7 +953,7 @@ const FactMetaData::AppSettingsTranslation_s* FactMetaData::_findAppSettingsArea } } - return NULL; + return nullptr; } QVariant FactMetaData::metersToAppSettingsDistanceUnits(const QVariant& meters) diff --git a/src/FactSystem/FactSystemTestBase.cc b/src/FactSystem/FactSystemTestBase.cc index 8a75ab331f40e2f0c90d0569222da30c26efa0ca..ce6ca4d0a11c5cd11a8dc2cf98ab83563ad72e12 100644 --- a/src/FactSystem/FactSystemTestBase.cc +++ b/src/FactSystem/FactSystemTestBase.cc @@ -48,7 +48,7 @@ void FactSystemTestBase::_parameter_default_component_id_test(void) { QVERIFY(_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, "RC_MAP_THROTTLE")); Fact* fact = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, "RC_MAP_THROTTLE"); - QVERIFY(fact != NULL); + QVERIFY(fact != nullptr); QVariant factValue = fact->rawValue(); QCOMPARE(factValue.isValid(), true); @@ -59,7 +59,7 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void) { QVERIFY(_vehicle->parameterManager()->parameterExists(MAV_COMP_ID_AUTOPILOT1, "RC_MAP_THROTTLE")); Fact* fact = _vehicle->parameterManager()->getParameter(MAV_COMP_ID_AUTOPILOT1, "RC_MAP_THROTTLE"); - QVERIFY(fact != NULL); + QVERIFY(fact != nullptr); QVariant factValue = fact->rawValue(); QCOMPARE(factValue.isValid(), true); QCOMPARE(factValue.toInt(), 3); diff --git a/src/FactSystem/FactValueSliderListModel.h b/src/FactSystem/FactValueSliderListModel.h index 21914b563c676a5d9b3b3d3e511ce282c5794f11..6dd50f4ae53ffd7d0c3a90f41fe8c74a7bf3888c 100644 --- a/src/FactSystem/FactValueSliderListModel.h +++ b/src/FactSystem/FactValueSliderListModel.h @@ -19,7 +19,7 @@ class FactValueSliderListModel : public QAbstractListModel Q_OBJECT public: - FactValueSliderListModel(Fact& fact, QObject* parent = NULL); + FactValueSliderListModel(Fact& fact, QObject* parent = nullptr); ~FactValueSliderListModel(); /// The initial value of the Fact at the meta data specified decimal place precision diff --git a/src/FactSystem/ParameterManager.cc b/src/FactSystem/ParameterManager.cc index b71dfedbf21b812103666de01aaf927784b85ac9..322d87e001ebda247166fe2fb56908999fca0c24 100644 --- a/src/FactSystem/ParameterManager.cc +++ b/src/FactSystem/ParameterManager.cc @@ -35,7 +35,7 @@ const char* ParameterManager::_jsonParamValueKey = "value"; ParameterManager::ParameterManager(Vehicle* vehicle) : QObject (vehicle) , _vehicle (vehicle) - , _mavlink (NULL) + , _mavlink (nullptr) , _loadProgress (0.0) , _parametersReady (false) , _missingParameters (false) @@ -45,7 +45,7 @@ ParameterManager::ParameterManager(Vehicle* vehicle) , _metaDataAddedToFacts (false) , _logReplay (vehicle->priorityLink() && vehicle->priorityLink()->isLogReplay()) , _parameterSetMajorVersion (-1) - , _parameterMetaData (NULL) + , _parameterMetaData (nullptr) , _prevWaitingReadParamIndexCount (0) , _prevWaitingReadParamNameCount (0) , _prevWaitingWriteParamNameCount (0) @@ -330,7 +330,7 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString _dataMutex.unlock(); - Fact* fact = NULL; + Fact* fact = nullptr; if (_mapParameterName2Variant[componentId].contains(parameterName)) { fact = _mapParameterName2Variant[componentId][parameterName].value(); } @@ -1052,7 +1052,7 @@ void ParameterManager::_clearMetaData(void) { if (_parameterMetaData) { _parameterMetaData->deleteLater(); - _parameterMetaData = NULL; + _parameterMetaData = nullptr; } } @@ -1288,7 +1288,7 @@ void ParameterManager::cacheMetaDataFile(const QString& metaDataFile, MAV_AUTOPI // Find the cache hit closest to this new file int cacheMajorVersion, cacheMinorVersion; - QString cacheHit = ParameterManager::parameterMetaDataFile(NULL, firmwareType, newMajorVersion, cacheMajorVersion, cacheMinorVersion); + QString cacheHit = ParameterManager::parameterMetaDataFile(nullptr, firmwareType, newMajorVersion, cacheMajorVersion, cacheMinorVersion); qCDebug(ParameterManagerLog) << "ParameterManager::cacheMetaDataFile cacheHit file:firmware:major;minor" << cacheHit << cacheMajorVersion << cacheMinorVersion; bool cacheNewFile = false; diff --git a/src/FirmwarePlugin/APM/APMFirmwarePlugin.h b/src/FirmwarePlugin/APM/APMFirmwarePlugin.h index c5867d0a3957dd1bb2bc78af2ded05ca0aeab6ad..fef3418d7060973b284b74734f70ede1d2acba75 100644 --- a/src/FirmwarePlugin/APM/APMFirmwarePlugin.h +++ b/src/FirmwarePlugin/APM/APMFirmwarePlugin.h @@ -148,7 +148,7 @@ class APMFirmwarePluginInstanceData : public QObject Q_OBJECT public: - APMFirmwarePluginInstanceData(QObject* parent = NULL); + APMFirmwarePluginInstanceData(QObject* parent = nullptr); bool textSeverityAdjustmentNeeded; }; diff --git a/src/FirmwarePlugin/APM/APMFirmwarePluginFactory.cc b/src/FirmwarePlugin/APM/APMFirmwarePluginFactory.cc index 7acfc92ab6e2e95e453907d684ba2fa2132f87a6..c791b5971929de3113b421ab9a838e7e3cf29a9a 100644 --- a/src/FirmwarePlugin/APM/APMFirmwarePluginFactory.cc +++ b/src/FirmwarePlugin/APM/APMFirmwarePluginFactory.cc @@ -16,10 +16,10 @@ APMFirmwarePluginFactory APMFirmwarePluginFactory; APMFirmwarePluginFactory::APMFirmwarePluginFactory(void) - : _arduCopterPluginInstance(NULL) - , _arduPlanePluginInstance(NULL) - , _arduRoverPluginInstance(NULL) - , _arduSubPluginInstance(NULL) + : _arduCopterPluginInstance(nullptr) + , _arduPlanePluginInstance(nullptr) + , _arduRoverPluginInstance(nullptr) + , _arduSubPluginInstance(nullptr) { } @@ -74,5 +74,5 @@ FirmwarePlugin* APMFirmwarePluginFactory::firmwarePluginForAutopilot(MAV_AUTOPIL } } - return NULL; + return nullptr; } diff --git a/src/FirmwarePlugin/APM/APMParameterMetaData.cc b/src/FirmwarePlugin/APM/APMParameterMetaData.cc index 47cd0f304801d68fc2d611fae38d951969e5544e..1fd7f18c28e5609615e12cb9c14bc7d393b3daa3 100644 --- a/src/FirmwarePlugin/APM/APMParameterMetaData.cc +++ b/src/FirmwarePlugin/APM/APMParameterMetaData.cc @@ -157,7 +157,7 @@ void APMParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData bool badMetaData = true; QStack xmlState; - APMFactMetaDataRaw* rawMetaData = NULL; + APMFactMetaDataRaw* rawMetaData = nullptr; xmlState.push(XmlStateNone); @@ -285,7 +285,7 @@ void APMParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData // Done loading this parameter // Reset for next parameter qCDebug(APMParameterMetaDataVerboseLog) << "done loading parameter"; - rawMetaData = NULL; + rawMetaData = nullptr; badMetaData = false; xmlState.pop(); } else if (elementName == "parameters") { @@ -422,7 +422,7 @@ bool APMParameterMetaData::parseParameterAttributes(QXmlStreamReader& xml, APMFa void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType) { const QString mavTypeString = mavTypeToString(vehicleType); - APMFactMetaDataRaw* rawMetaData = NULL; + APMFactMetaDataRaw* rawMetaData = nullptr; // check if we have metadata for fact, use generic otherwise if (_vehicleTypeToParametersMap[mavTypeString].contains(fact->name())) { diff --git a/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h b/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h index 7f6426b07037fd0e7965d7de9c4daa778e24aade..26696cdbc2115ab83c4c77338178f461ec295132 100644 --- a/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h +++ b/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h @@ -33,7 +33,7 @@ class APMSubmarineFactGroup : public FactGroup Q_OBJECT public: - APMSubmarineFactGroup(QObject* parent = NULL); + APMSubmarineFactGroup(QObject* parent = nullptr); Q_PROPERTY(Fact* camTilt READ camTilt CONSTANT) Q_PROPERTY(Fact* tetherTurns READ tetherTurns CONSTANT) diff --git a/src/FirmwarePlugin/CameraMetaData.h b/src/FirmwarePlugin/CameraMetaData.h index 2c146f1a33f998562567b55c3b3e562fffde7046..1e6de08cb0b3e1827abd38b3b42f8719f1187650 100644 --- a/src/FirmwarePlugin/CameraMetaData.h +++ b/src/FirmwarePlugin/CameraMetaData.h @@ -26,7 +26,7 @@ public: bool landscape, bool fixedOrientation, double minTriggerInterval, - QObject* parent = NULL); + QObject* parent = nullptr); Q_PROPERTY(QString name READ name CONSTANT) ///< Camera name Q_PROPERTY(double sensorWidth READ sensorWidth CONSTANT) ///< Sensor size in millimeters diff --git a/src/FirmwarePlugin/FirmwarePluginManager.cc b/src/FirmwarePlugin/FirmwarePluginManager.cc index 68d7e7ae1190549250b835c18d9cb04157d3131a..4627848babf3ebbd908067eebb69dcd76b628351 100644 --- a/src/FirmwarePlugin/FirmwarePluginManager.cc +++ b/src/FirmwarePlugin/FirmwarePluginManager.cc @@ -89,5 +89,5 @@ FirmwarePluginFactory* FirmwarePluginManager::_findPluginFactory(MAV_AUTOPILOT f } } - return NULL; + return nullptr; } diff --git a/src/GPS/GPSManager.cc b/src/GPS/GPSManager.cc index 4eea19b8e08e476d02598f3b6b0751d75e871f40..c4b350cdbf98c3c7a425e34e14cfd349a5744477 100644 --- a/src/GPS/GPSManager.cc +++ b/src/GPS/GPSManager.cc @@ -84,8 +84,8 @@ void GPSManager::disconnectGPS(void) if (_rtcmMavlink) { delete(_rtcmMavlink); } - _gpsProvider = NULL; - _rtcmMavlink = NULL; + _gpsProvider = nullptr; + _rtcmMavlink = nullptr; } diff --git a/src/MissionManager/CameraCalc.h b/src/MissionManager/CameraCalc.h index 95eeb1195c0de0d9703c9ce6816bc8c001fead7b..01b96b89f19a40e905f661f80fba0e48a5de0dc0 100644 --- a/src/MissionManager/CameraCalc.h +++ b/src/MissionManager/CameraCalc.h @@ -19,7 +19,7 @@ class CameraCalc : public CameraSpec Q_OBJECT public: - CameraCalc(Vehicle* vehicle, const QString& settingsGroup, QObject* parent = NULL); + CameraCalc(Vehicle* vehicle, const QString& settingsGroup, QObject* parent = nullptr); Q_PROPERTY(QString customCameraName READ customCameraName CONSTANT) ///< Camera name for custom camera setting Q_PROPERTY(QString manualCameraName READ manualCameraName CONSTANT) ///< Camera name for manual camera setting diff --git a/src/MissionManager/CameraCalcTest.cc b/src/MissionManager/CameraCalcTest.cc index 10571ce12462488110065a867ebcb0ffcea489b2..c0628acad853951f31dc885d7ea40ef364312cb1 100644 --- a/src/MissionManager/CameraCalcTest.cc +++ b/src/MissionManager/CameraCalcTest.cc @@ -11,7 +11,7 @@ #include "QGCApplication.h" CameraCalcTest::CameraCalcTest(void) - : _offlineVehicle(NULL) + : _offlineVehicle(nullptr) { } diff --git a/src/MissionManager/CameraSection.cc b/src/MissionManager/CameraSection.cc index 89ddc77fe9e0d9abb4056ee8258c14c9fd2dc618..e605a7b215f0e29286aa7574ef54d22a4fa1d249 100644 --- a/src/MissionManager/CameraSection.cc +++ b/src/MissionManager/CameraSection.cc @@ -147,7 +147,7 @@ void CameraSection::appendSectionItems(QList& items, QObject* miss } if (_cameraActionFact.rawValue().toInt() != CameraActionNone) { - MissionItem* item = NULL; + MissionItem* item = nullptr; switch (_cameraActionFact.rawValue().toInt()) { case TakePhotosIntervalTime: diff --git a/src/MissionManager/CameraSection.h b/src/MissionManager/CameraSection.h index 49f230896261307710a14a00fffdaaa25aedec4a..be84dcc990f06f73ac88d38f289cd214b510f9cc 100644 --- a/src/MissionManager/CameraSection.h +++ b/src/MissionManager/CameraSection.h @@ -21,7 +21,7 @@ class CameraSection : public Section Q_OBJECT public: - CameraSection(Vehicle* vehicle, QObject* parent = NULL); + CameraSection(Vehicle* vehicle, QObject* parent = nullptr); // These enum values must match the json meta data diff --git a/src/MissionManager/CameraSectionTest.cc b/src/MissionManager/CameraSectionTest.cc index 18eef23d29d2be8aac2a42fde82ad0aede88277c..476f1a13758fefa00baa5cc2a87f37944bbec02c 100644 --- a/src/MissionManager/CameraSectionTest.cc +++ b/src/MissionManager/CameraSectionTest.cc @@ -13,16 +13,16 @@ #include "MissionCommandUIInfo.h" CameraSectionTest::CameraSectionTest(void) - : _spyCamera (NULL) - , _spySection (NULL) - , _cameraSection (NULL) - , _validGimbalItem (NULL) - , _validDistanceItem (NULL) - , _validTimeItem (NULL) - , _validStartVideoItem (NULL) - , _validCameraPhotoModeItem (NULL) - , _validCameraVideoModeItem (NULL) - , _validCameraSurveyPhotoModeItem (NULL) + : _spyCamera (nullptr) + , _spySection (nullptr) + , _cameraSection (nullptr) + , _validGimbalItem (nullptr) + , _validDistanceItem (nullptr) + , _validTimeItem (nullptr) + , _validStartVideoItem (nullptr) + , _validCameraPhotoModeItem (nullptr) + , _validCameraVideoModeItem (nullptr) + , _validCameraSurveyPhotoModeItem (nullptr) { } @@ -143,7 +143,7 @@ void CameraSectionTest::cleanup(void) void CameraSectionTest::_createSpy(CameraSection* cameraSection, MultiSignalSpy** cameraSpy) { - *cameraSpy = NULL; + *cameraSpy = nullptr; MultiSignalSpy* spy = new MultiSignalSpy(); QCOMPARE(spy->init(cameraSection, rgCameraSignals, cCameraSignals), true); *cameraSpy = spy; @@ -618,7 +618,7 @@ void CameraSectionTest::_testScanForGimbalSection(void) // Gimbal command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validGimbalItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validGimbalItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam2(10); // roll is not supported visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); @@ -708,7 +708,7 @@ void CameraSectionTest::_testScanForCameraModeSection(void) */ // Mode command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validCameraPhotoModeItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validCameraPhotoModeItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam3(1); // Param3 should be NaN visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); @@ -747,7 +747,7 @@ void CameraSectionTest::_testScanForPhotoIntervalTimeSection(void) // Image start command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validTimeItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validTimeItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam3(10); // must be 0 for unlimited visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); @@ -788,7 +788,7 @@ void CameraSectionTest::_testScanForPhotoIntervalDistanceSection(void) // Trigger distance command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validDistanceItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validDistanceItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam1(-1); // must be >= 0 visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); @@ -873,7 +873,7 @@ void CameraSectionTest::_testScanForStartVideoSection(void) // Start Video command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validStartVideoItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validStartVideoItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam1(10); // Reserved (must be 0) visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); @@ -909,7 +909,7 @@ void CameraSectionTest::_testScanForStopVideoSection(void) // Trigger distance command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validStopVideoItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validStopVideoItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam1(10); // must be 0 visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); @@ -949,8 +949,8 @@ void CameraSectionTest::_testScanForStopPhotoSection(void) // Out of order commands - SimpleMissionItem validStopDistanceItem(_offlineVehicle, false /* flyView */, NULL); - SimpleMissionItem validStopTimeItem(_offlineVehicle, false /* flyView */, NULL); + SimpleMissionItem validStopDistanceItem(_offlineVehicle, false /* flyView */, nullptr); + SimpleMissionItem validStopTimeItem(_offlineVehicle, false /* flyView */, nullptr); validStopDistanceItem.missionItem() = _validStopDistanceItem->missionItem(); validStopTimeItem.missionItem() = _validStopTimeItem->missionItem(); visualItems.append(&validStopTimeItem); @@ -990,7 +990,7 @@ void CameraSectionTest::_testScanForTakePhotoSection(void) // Take Photo command but incorrect settings - SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validTimeItem->missionItem(), NULL); + SimpleMissionItem invalidSimpleItem(_offlineVehicle, false /* flyView */, _validTimeItem->missionItem(), nullptr); invalidSimpleItem.missionItem().setParam3(10); // must be 1 for single photo visualItems.append(&invalidSimpleItem); QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false); diff --git a/src/MissionManager/CameraSpec.h b/src/MissionManager/CameraSpec.h index bf32047d0dfe46a1b19f99fc7b4a71196043a757..261c8827811e6f384d9d6544f7fc8cb6548f2484 100644 --- a/src/MissionManager/CameraSpec.h +++ b/src/MissionManager/CameraSpec.h @@ -16,7 +16,7 @@ class CameraSpec : public QObject Q_OBJECT public: - CameraSpec(const QString& settingsGroup, QObject* parent = NULL); + CameraSpec(const QString& settingsGroup, QObject* parent = nullptr); const CameraSpec& operator=(const CameraSpec& other); diff --git a/src/MissionManager/CorridorScanComplexItem.cc b/src/MissionManager/CorridorScanComplexItem.cc index f253f8d8e74efc46c3bc127edb25e3435e39202c..0ae723c17c9b1ea67cae624236d6f0a6d8092f7e 100644 --- a/src/MissionManager/CorridorScanComplexItem.cc +++ b/src/MissionManager/CorridorScanComplexItem.cc @@ -335,7 +335,7 @@ void CorridorScanComplexItem::_rebuildTransectsPhase1(void) if (_loadedMissionItemsParent) { _loadedMissionItems.clear(); _loadedMissionItemsParent->deleteLater(); - _loadedMissionItemsParent = NULL; + _loadedMissionItemsParent = nullptr; } _transects.clear(); diff --git a/src/MissionManager/CorridorScanComplexItemTest.cc b/src/MissionManager/CorridorScanComplexItemTest.cc index 3086fb97972f1548b7356670a7cb7ce9c2db7afe..75f330ac4e9f53f72caccc4364cafaa441a51bce 100644 --- a/src/MissionManager/CorridorScanComplexItemTest.cc +++ b/src/MissionManager/CorridorScanComplexItemTest.cc @@ -11,7 +11,7 @@ #include "QGCApplication.h" CorridorScanComplexItemTest::CorridorScanComplexItemTest(void) - : _offlineVehicle(NULL) + : _offlineVehicle(nullptr) { _linePoints << QGeoCoordinate(47.633550640000003, -122.08982199) << QGeoCoordinate(47.634129020000003, -122.08887249) diff --git a/src/MissionManager/MissionCommandList.h b/src/MissionManager/MissionCommandList.h index 319020002311e3b50400e6eb2679326ff1cb6c96..862d5dd6a9c23653abb7bb09d35059b6c11782b8 100644 --- a/src/MissionManager/MissionCommandList.h +++ b/src/MissionManager/MissionCommandList.h @@ -30,7 +30,7 @@ class MissionCommandList : public QObject public: /// @param jsonFilename Json file which contains commands /// @param baseCommandList true: bottomost level of mission command hierarchy (partial not allowed), false: mid-level of command hierarchy - MissionCommandList(const QString& jsonFilename, bool baseCommandList, QObject* parent = NULL); + MissionCommandList(const QString& jsonFilename, bool baseCommandList, QObject* parent = nullptr); /// Returns list of categories in this list QStringList& categories(void) { return _categories; } diff --git a/src/MissionManager/MissionCommandTreeTest.cc b/src/MissionManager/MissionCommandTreeTest.cc index 4a414fc874e938acfed5574d70dab3e5b6b68542..89a86f559525a4f90ca6ec6dfc41a20e01c4262e 100644 --- a/src/MissionManager/MissionCommandTreeTest.cc +++ b/src/MissionManager/MissionCommandTreeTest.cc @@ -59,7 +59,7 @@ void MissionCommandTreeTest::_checkFullInfoMap(const MissionCommandUIInfo* uiInf // Verifies that values match settings for base tree void MissionCommandTreeTest::_checkBaseValues(const MissionCommandUIInfo* uiInfo, int command) { - QVERIFY(uiInfo != NULL); + QVERIFY(uiInfo != nullptr); _checkFullInfoMap(uiInfo); QCOMPARE(uiInfo->command(), (MAV_CMD)command); QCOMPARE(uiInfo->rawName(), _rawName(command)); @@ -116,7 +116,7 @@ void MissionCommandTreeTest::_checkOverrideValues(const MissionCommandUIInfo* ui bool showUI; QString overrideString = QString("override fw %1").arg(command); - QVERIFY(uiInfo != NULL); + QVERIFY(uiInfo != nullptr); _checkFullInfoMap(uiInfo); QCOMPARE(uiInfo->command(), (MAV_CMD)command); QCOMPARE(uiInfo->rawName(), _rawName(command)); @@ -143,11 +143,11 @@ void MissionCommandTreeTest::testJsonLoad(void) // Test loading from the bad command list MissionCommandList* commandList = _commandTree->_staticCommandTree[MAV_AUTOPILOT_GENERIC][MAV_TYPE_GENERIC]; - QVERIFY(commandList != NULL); + QVERIFY(commandList != nullptr); // Command 1 should have all values defaulted, no params MissionCommandUIInfo* uiInfo = commandList->getUIInfo((MAV_CMD)1); - QVERIFY(uiInfo != NULL); + QVERIFY(uiInfo != nullptr); _checkFullInfoMap(uiInfo); QCOMPARE(uiInfo->command(), (MAV_CMD)1); QCOMPARE(uiInfo->rawName(), _rawName(1)); @@ -158,13 +158,13 @@ void MissionCommandTreeTest::testJsonLoad(void) QCOMPARE(uiInfo->isStandaloneCoordinate(), false); QCOMPARE(uiInfo->specifiesCoordinate(), false); for (int i=1; i<=7; i++) { - QVERIFY(uiInfo->getParamInfo(i, showUI) == NULL); + QVERIFY(uiInfo->getParamInfo(i, showUI) == nullptr); QCOMPARE(showUI, false); } // Command 2 should all values defaulted for param 1 uiInfo = commandList->getUIInfo((MAV_CMD)2); - QVERIFY(uiInfo != NULL); + QVERIFY(uiInfo != nullptr); const MissionCmdParamInfo* paramInfo = uiInfo->getParamInfo(1, showUI); QVERIFY(paramInfo); QCOMPARE(showUI, true); @@ -176,7 +176,7 @@ void MissionCommandTreeTest::testJsonLoad(void) QCOMPARE(paramInfo->param(), 1); QVERIFY(paramInfo->units().isEmpty()); for (int i=2; i<=7; i++) { - QVERIFY(uiInfo->getParamInfo(i, showUI) == NULL); + QVERIFY(uiInfo->getParamInfo(i, showUI) == nullptr); QCOMPARE(showUI, false); } @@ -214,7 +214,7 @@ void MissionCommandTreeTest::testAllTrees(void) } qDebug() << firmwareType << vehicleType; Vehicle* vehicle = new Vehicle(firmwareType, vehicleType, qgcApp()->toolbox()->firmwarePluginManager()); - QVERIFY(qgcApp()->toolbox()->missionCommandTree()->getUIInfo(vehicle, MAV_CMD_NAV_WAYPOINT) != NULL); + QVERIFY(qgcApp()->toolbox()->missionCommandTree()->getUIInfo(vehicle, MAV_CMD_NAV_WAYPOINT) != nullptr); delete vehicle; } } diff --git a/src/MissionManager/MissionCommandUIInfo.h b/src/MissionManager/MissionCommandUIInfo.h index f3c50a714bb57eb51f7c8393be53116d37094c24..8eca1dfd22f00be3fc9884c0c46494bffee7f40d 100644 --- a/src/MissionManager/MissionCommandUIInfo.h +++ b/src/MissionManager/MissionCommandUIInfo.h @@ -42,9 +42,9 @@ class MissionCmdParamInfo : public QObject { Q_OBJECT public: - MissionCmdParamInfo(QObject* parent = NULL); + MissionCmdParamInfo(QObject* parent = nullptr); - MissionCmdParamInfo(const MissionCmdParamInfo& other, QObject* parent = NULL); + MissionCmdParamInfo(const MissionCmdParamInfo& other, QObject* parent = nullptr); const MissionCmdParamInfo& operator=(const MissionCmdParamInfo& other); Q_PROPERTY(int decimalPlaces READ decimalPlaces CONSTANT) @@ -105,9 +105,9 @@ class MissionCommandUIInfo : public QObject { Q_OBJECT public: - MissionCommandUIInfo(QObject* parent = NULL); + MissionCommandUIInfo(QObject* parent = nullptr); - MissionCommandUIInfo(const MissionCommandUIInfo& other, QObject* parent = NULL); + MissionCommandUIInfo(const MissionCommandUIInfo& other, QObject* parent = nullptr); const MissionCommandUIInfo& operator=(const MissionCommandUIInfo& other); Q_PROPERTY(QString category READ category CONSTANT) diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index bd086f31db7e6307cfaad701bf2d27f64262586d..5c5f065e78cb7904f23946aa4ba854f22fafcb72 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -1663,7 +1663,7 @@ void MissionController::_initVisualItem(VisualMissionItem* visualItem) void MissionController::_deinitVisualItem(VisualMissionItem* visualItem) { // Disconnect all signals - disconnect(visualItem, 0, 0, 0); + disconnect(visualItem, nullptr, nullptr, nullptr); } void MissionController::_itemCommandChanged(void) @@ -1677,8 +1677,8 @@ void MissionController::managerVehicleChanged(Vehicle* managerVehicle) if (_managerVehicle) { _missionManager->disconnect(this); _managerVehicle->disconnect(this); - _managerVehicle = NULL; - _missionManager = NULL; + _managerVehicle = nullptr; + _missionManager = nullptr; } _managerVehicle = managerVehicle; @@ -2056,7 +2056,7 @@ VisualMissionItem* MissionController::currentPlanViewItem(void) const void MissionController::setCurrentPlanViewIndex(int sequenceNumber, bool force) { if(_visualItems && (force || sequenceNumber != _currentPlanViewIndex)) { - _currentPlanViewItem = NULL; + _currentPlanViewItem = nullptr; _currentPlanViewIndex = -1; for (int i = 0; i < _visualItems->count(); i++) { VisualMissionItem* pVI = qobject_cast(_visualItems->get(i)); diff --git a/src/MissionManager/MissionController.h b/src/MissionManager/MissionController.h index 6fa6e19efba2e9ec37dbe9ade2db2c656d7a3709..abe5ac741ee43935d119d8be1e32edaa868c715b 100644 --- a/src/MissionManager/MissionController.h +++ b/src/MissionManager/MissionController.h @@ -40,7 +40,7 @@ class MissionController : public PlanElementController Q_OBJECT public: - MissionController(PlanMasterController* masterController, QObject* parent = NULL); + MissionController(PlanMasterController* masterController, QObject* parent = nullptr); ~MissionController(); typedef struct _MissionFlightStatus_t { diff --git a/src/MissionManager/MissionControllerManagerTest.cc b/src/MissionManager/MissionControllerManagerTest.cc index 22669624f64975d06918a33bde72759aeb127863..cdb6ef60fec27711410412482fcc5b559365f885 100644 --- a/src/MissionManager/MissionControllerManagerTest.cc +++ b/src/MissionManager/MissionControllerManagerTest.cc @@ -21,7 +21,7 @@ MissionControllerManagerTest::MissionControllerManagerTest(void) void MissionControllerManagerTest::cleanup(void) { delete _multiSpyMissionManager; - _multiSpyMissionManager = NULL; + _multiSpyMissionManager = nullptr; UnitTest::cleanup(); } diff --git a/src/MissionManager/MissionControllerTest.cc b/src/MissionManager/MissionControllerTest.cc index b6b4793c986c890b73e172f3929b61459b9d0609..29d3f2c9c75ca5731933e1eb108ab9893991b797 100644 --- a/src/MissionManager/MissionControllerTest.cc +++ b/src/MissionManager/MissionControllerTest.cc @@ -18,9 +18,9 @@ #include "AppSettings.h" MissionControllerTest::MissionControllerTest(void) - : _multiSpyMissionController(NULL) - , _multiSpyMissionItem(NULL) - , _missionController(NULL) + : _multiSpyMissionController(nullptr) + , _multiSpyMissionItem(nullptr) + , _missionController(nullptr) { } @@ -28,13 +28,13 @@ MissionControllerTest::MissionControllerTest(void) void MissionControllerTest::cleanup(void) { delete _masterController; - _masterController = NULL; + _masterController = nullptr; delete _multiSpyMissionController; - _multiSpyMissionController = NULL; + _multiSpyMissionController = nullptr; delete _multiSpyMissionItem; - _multiSpyMissionItem = NULL; + _multiSpyMissionItem = nullptr; MissionControllerManagerTest::cleanup(); } diff --git a/src/MissionManager/MissionItem.h b/src/MissionManager/MissionItem.h index fb8cab6d98f18251f3954f377776b34c4c6944be..5e44bfa40e857df910a62790a1cba39bba860234 100644 --- a/src/MissionManager/MissionItem.h +++ b/src/MissionManager/MissionItem.h @@ -38,7 +38,7 @@ class MissionItem : public QObject Q_OBJECT public: - MissionItem(QObject* parent = NULL); + MissionItem(QObject* parent = nullptr); MissionItem(int sequenceNumber, MAV_CMD command, @@ -52,9 +52,9 @@ public: double param7, bool autoContinue, bool isCurrentItem, - QObject* parent = NULL); + QObject* parent = nullptr); - MissionItem(const MissionItem& other, QObject* parent = NULL); + MissionItem(const MissionItem& other, QObject* parent = nullptr); ~MissionItem(); diff --git a/src/MissionManager/MissionItemTest.cc b/src/MissionManager/MissionItemTest.cc index cac8d3bb5b645baedace6e44a127274b972d2001..e211f328ef3b9932c21e69ecdabaca619ae70c0f 100644 --- a/src/MissionManager/MissionItemTest.cc +++ b/src/MissionManager/MissionItemTest.cc @@ -28,7 +28,7 @@ const size_t MissionItemTest::_cTestCases = sizeof(_rgTestCases)/sizeof(_rgTestC #endif MissionItemTest::MissionItemTest(void) - : _offlineVehicle(NULL) + : _offlineVehicle(nullptr) { } @@ -282,7 +282,7 @@ void MissionItemTest::_testSimpleLoadFromStream(void) { // We specifically test SimpleMissionItem loading as well since it has additional // signalling which can affect values. - SimpleMissionItem simpleMissionItem(_offlineVehicle, false /* flyView */, NULL); + SimpleMissionItem simpleMissionItem(_offlineVehicle, false /* flyView */, nullptr); QString testString("10\t0\t3\t80\t10\t20\t30\t40\t-10\t-20\t-30\t1\r\n"); QTextStream testStream(&testString, QIODevice::ReadOnly); @@ -452,7 +452,7 @@ void MissionItemTest::_testSimpleLoadFromJson(void) // We specifically test SimpleMissionItem loading as well since it has additional // signalling which can affect values. - SimpleMissionItem simpleMissionItem(_offlineVehicle, false /* flyView */, NULL); + SimpleMissionItem simpleMissionItem(_offlineVehicle, false /* flyView */, nullptr); QString errorString; QJsonArray coordinateArray; QJsonObject jsonObject; diff --git a/src/MissionManager/MissionManagerTest.cc b/src/MissionManager/MissionManagerTest.cc index f354ee39480dd31e96bb05334938b221e99dcb1b..f94dc11445fa8553999a9c0d0fd1788835b8aa21 100644 --- a/src/MissionManager/MissionManagerTest.cc +++ b/src/MissionManager/MissionManagerTest.cc @@ -35,7 +35,7 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f QList missionItems; // Editor has a home position item on the front, so we do the same - MissionItem* homeItem = new MissionItem(NULL /* Vehicle */, this); + MissionItem* homeItem = new MissionItem(nullptr /* Vehicle */, this); homeItem->setCommand(MAV_CMD_NAV_WAYPOINT); homeItem->setParam5(47.3769); homeItem->setParam6(8.549444); diff --git a/src/MissionManager/MissionSettingsItem.cc b/src/MissionManager/MissionSettingsItem.cc index 912e67fc5737efac2db58528aeff4f49376ff7f8..e816d9de645f813b971770ab845e2d8a15ef285a 100644 --- a/src/MissionManager/MissionSettingsItem.cc +++ b/src/MissionManager/MissionSettingsItem.cc @@ -40,7 +40,7 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, bool flyView, QObject _editorQml = "qrc:/qml/MissionSettingsEditor.qml"; if (_metaDataMap.isEmpty()) { - _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/MissionSettings.FactMetaData.json"), NULL /* metaDataParent */); + _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/MissionSettings.FactMetaData.json"), nullptr /* metaDataParent */); } _plannedHomePositionAltitudeFact.setMetaData (_metaDataMap[_plannedHomePositionAltitudeName]); @@ -163,7 +163,7 @@ void MissionSettingsItem::appendMissionItems(QList& items, QObject bool MissionSettingsItem::addMissionEndAction(QList& items, int seqNum, QObject* missionItemParent) { - MissionItem* item = NULL; + MissionItem* item = nullptr; // IMPORTANT NOTE: If anything changes here you must also change MissionSettingsItem::scanForMissionSettings diff --git a/src/MissionManager/MissionSettingsTest.cc b/src/MissionManager/MissionSettingsTest.cc index 4688d5afbd2daf6cc7f7450df960aacb815a0ec0..28b2a710ba4d8f269117d3f25db110e5779332c2 100644 --- a/src/MissionManager/MissionSettingsTest.cc +++ b/src/MissionManager/MissionSettingsTest.cc @@ -13,7 +13,7 @@ #include "SettingsManager.h" MissionSettingsTest::MissionSettingsTest(void) - : _settingsItem(NULL) + : _settingsItem(nullptr) { } diff --git a/src/MissionManager/PlanElementController.h b/src/MissionManager/PlanElementController.h index 078f218a2f0b81a091a902a44ac74329fd99cf84..3d93ecbd366887c106691b7a7b9035566b6b8fa0 100644 --- a/src/MissionManager/PlanElementController.h +++ b/src/MissionManager/PlanElementController.h @@ -24,7 +24,7 @@ class PlanElementController : public QObject Q_OBJECT public: - PlanElementController(PlanMasterController* masterController, QObject* parent = NULL); + PlanElementController(PlanMasterController* masterController, QObject* parent = nullptr); ~PlanElementController(); Q_PROPERTY(bool supported READ supported NOTIFY supportedChanged) ///< true: Element is supported by Vehicle diff --git a/src/MissionManager/PlanManager.cc b/src/MissionManager/PlanManager.cc index 833c2f262f128028bbbe5dea2b8b344e2f2a34fe..f137124e62b1c87630f43c87a96bd1daba887271 100644 --- a/src/MissionManager/PlanManager.cc +++ b/src/MissionManager/PlanManager.cc @@ -24,8 +24,8 @@ QGC_LOGGING_CATEGORY(PlanManagerLog, "PlanManagerLog") PlanManager::PlanManager(Vehicle* vehicle, MAV_MISSION_TYPE planType) : _vehicle (vehicle) , _planType (planType) - , _dedicatedLink (NULL) - , _ackTimeoutTimer (NULL) + , _dedicatedLink (nullptr) + , _ackTimeoutTimer (nullptr) , _expectedAck (AckNone) , _transactionInProgress (TransactionNone) , _resumeMission (false) diff --git a/src/MissionManager/PlanMasterController.h b/src/MissionManager/PlanMasterController.h index 344465a1ae64cd35fff8892ce0b3535f451a8ee8..fed93869e61c0911a1b0dab2219e1b341683eefa 100644 --- a/src/MissionManager/PlanMasterController.h +++ b/src/MissionManager/PlanMasterController.h @@ -26,7 +26,7 @@ class PlanMasterController : public QObject Q_OBJECT public: - PlanMasterController(QObject* parent = NULL); + PlanMasterController(QObject* parent = nullptr); ~PlanMasterController(); Q_PROPERTY(MissionController* missionController READ missionController CONSTANT) diff --git a/src/MissionManager/PlanMasterControllerTest.cc b/src/MissionManager/PlanMasterControllerTest.cc index eae62cb08b992f1f1ec1ec5030fdae606f7384f6..64ee593fcdfb7fb58079482da4d106b8522c5064 100644 --- a/src/MissionManager/PlanMasterControllerTest.cc +++ b/src/MissionManager/PlanMasterControllerTest.cc @@ -17,7 +17,7 @@ #include "AppSettings.h" PlanMasterControllerTest::PlanMasterControllerTest(void) - : _masterController(NULL) + : _masterController(nullptr) { } @@ -33,7 +33,7 @@ void PlanMasterControllerTest::init(void) void PlanMasterControllerTest::cleanup(void) { delete _masterController; - _masterController = NULL; + _masterController = nullptr; UnitTest::cleanup(); } diff --git a/src/MissionManager/QGCFenceCircle.h b/src/MissionManager/QGCFenceCircle.h index d42a8f356556c730718dcb96d334d0f40db85e35..6454e51e70a97ec1ca7520b8e5860d2416ea2234 100644 --- a/src/MissionManager/QGCFenceCircle.h +++ b/src/MissionManager/QGCFenceCircle.h @@ -17,9 +17,9 @@ class QGCFenceCircle : public QGCMapCircle Q_OBJECT public: - QGCFenceCircle(QObject* parent = NULL); - QGCFenceCircle(const QGeoCoordinate& center, double radius, bool inclusion, QObject* parent = NULL); - QGCFenceCircle(const QGCFenceCircle& other, QObject* parent = NULL); + QGCFenceCircle(QObject* parent = nullptr); + QGCFenceCircle(const QGeoCoordinate& center, double radius, bool inclusion, QObject* parent = nullptr); + QGCFenceCircle(const QGCFenceCircle& other, QObject* parent = nullptr); const QGCFenceCircle& operator=(const QGCFenceCircle& other); diff --git a/src/MissionManager/QGCFencePolygon.h b/src/MissionManager/QGCFencePolygon.h index fb79ca4837a22b3cdb2fede6b5791afd0d930838..7279cbf8bc2cab1a2311344257d03aea24a6c2f7 100644 --- a/src/MissionManager/QGCFencePolygon.h +++ b/src/MissionManager/QGCFencePolygon.h @@ -17,8 +17,8 @@ class QGCFencePolygon : public QGCMapPolygon Q_OBJECT public: - QGCFencePolygon(bool inclusion, QObject* parent = NULL); - QGCFencePolygon(const QGCFencePolygon& other, QObject* parent = NULL); + QGCFencePolygon(bool inclusion, QObject* parent = nullptr); + QGCFencePolygon(const QGCFencePolygon& other, QObject* parent = nullptr); const QGCFencePolygon& operator=(const QGCFencePolygon& other); diff --git a/src/MissionManager/QGCMapPolyline.h b/src/MissionManager/QGCMapPolyline.h index 08389a0416eda69e18996b0e2515e129206dc272..78254c7df368cbd047e417b164c49fb0306355d8 100644 --- a/src/MissionManager/QGCMapPolyline.h +++ b/src/MissionManager/QGCMapPolyline.h @@ -20,8 +20,8 @@ class QGCMapPolyline : public QObject Q_OBJECT public: - QGCMapPolyline(QObject* parent = NULL); - QGCMapPolyline(const QGCMapPolyline& other, QObject* parent = NULL); + QGCMapPolyline(QObject* parent = nullptr); + QGCMapPolyline(const QGCMapPolyline& other, QObject* parent = nullptr); const QGCMapPolyline& operator=(const QGCMapPolyline& other); diff --git a/src/MissionManager/RallyPoint.cc b/src/MissionManager/RallyPoint.cc index 753ad3ec3ca188a2ad8578228869f520f59cb23c..51847e3b1d8e41342c04efa331f00f5fc2f1567d 100644 --- a/src/MissionManager/RallyPoint.cc +++ b/src/MissionManager/RallyPoint.cc @@ -64,7 +64,7 @@ RallyPoint::~RallyPoint() void RallyPoint::_factSetup(void) { if (_metaDataMap.isEmpty()) { - _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/RallyPoint.FactMetaData.json"), NULL /* metaDataParent */); + _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/RallyPoint.FactMetaData.json"), nullptr /* metaDataParent */); } _longitudeFact.setMetaData(_metaDataMap[_longitudeFactName]); diff --git a/src/MissionManager/RallyPoint.h b/src/MissionManager/RallyPoint.h index 9133716597fbd830eb695e57bede6a2a65b52750..5868118232797b84f796591e7cf071b038e5c23d 100644 --- a/src/MissionManager/RallyPoint.h +++ b/src/MissionManager/RallyPoint.h @@ -22,8 +22,8 @@ class RallyPoint : public QObject Q_OBJECT public: - RallyPoint(const QGeoCoordinate& coordinate, QObject* parent = NULL); - RallyPoint(const RallyPoint& other, QObject* parent = NULL); + RallyPoint(const QGeoCoordinate& coordinate, QObject* parent = nullptr); + RallyPoint(const RallyPoint& other, QObject* parent = nullptr); ~RallyPoint(); diff --git a/src/MissionManager/RallyPointController.cc b/src/MissionManager/RallyPointController.cc index 506024f433b8a89c43d5a77424c186eb01d4c4dd..732d080b718d3055a21c63ae5be88fe527480b7c 100644 --- a/src/MissionManager/RallyPointController.cc +++ b/src/MissionManager/RallyPointController.cc @@ -37,7 +37,7 @@ RallyPointController::RallyPointController(PlanMasterController* masterControlle : PlanElementController(masterController, parent) , _rallyPointManager(_managerVehicle->rallyPointManager()) , _dirty(false) - , _currentRallyPoint(NULL) + , _currentRallyPoint(nullptr) , _itemsRequested(false) { connect(&_points, &QmlObjectListModel::countChanged, this, &RallyPointController::_updateContainsItems); @@ -55,8 +55,8 @@ void RallyPointController::managerVehicleChanged(Vehicle* managerVehicle) if (_managerVehicle) { _rallyPointManager->disconnect(this); _managerVehicle->disconnect(this); - _managerVehicle = NULL; - _rallyPointManager = NULL; + _managerVehicle = nullptr; + _rallyPointManager = nullptr; } _managerVehicle = managerVehicle; @@ -138,7 +138,7 @@ void RallyPointController::removeAll(void) { _points.clearAndDeleteContents(); setDirty(true); - setCurrentRallyPoint(NULL); + setCurrentRallyPoint(nullptr); } void RallyPointController::removeAllFromVehicle(void) @@ -268,7 +268,7 @@ void RallyPointController::removePoint(QObject* rallyPoint) newIndex = qMax(newIndex, 0); setCurrentRallyPoint(_points[newIndex]); } else { - setCurrentRallyPoint(NULL); + setCurrentRallyPoint(nullptr); } } @@ -282,7 +282,7 @@ void RallyPointController::setCurrentRallyPoint(QObject* rallyPoint) void RallyPointController::_setFirstPointCurrent(void) { - setCurrentRallyPoint(_points.count() ? _points[0] : NULL); + setCurrentRallyPoint(_points.count() ? _points[0] : nullptr); } bool RallyPointController::containsItems(void) const diff --git a/src/MissionManager/RallyPointController.h b/src/MissionManager/RallyPointController.h index 95d1f0f13b672c517b70d479730f6429fa071506..7543642edce71ae5f4cbae859debffd4eca478f5 100644 --- a/src/MissionManager/RallyPointController.h +++ b/src/MissionManager/RallyPointController.h @@ -26,7 +26,7 @@ class RallyPointController : public PlanElementController Q_OBJECT public: - RallyPointController(PlanMasterController* masterController, QObject* parent = NULL); + RallyPointController(PlanMasterController* masterController, QObject* parent = nullptr); ~RallyPointController(); Q_PROPERTY(QmlObjectListModel* points READ points CONSTANT) diff --git a/src/MissionManager/Section.h b/src/MissionManager/Section.h index 638f22be6c761f19769986ac052e708f6b648aee..9e033c57c5a2899f67ab4c5a823e627757b70017 100644 --- a/src/MissionManager/Section.h +++ b/src/MissionManager/Section.h @@ -21,7 +21,7 @@ class Section : public QObject Q_OBJECT public: - Section(Vehicle* vehicle, QObject* parent = NULL) + Section(Vehicle* vehicle, QObject* parent = nullptr) : QObject(parent) , _vehicle(vehicle) { diff --git a/src/MissionManager/SectionTest.cc b/src/MissionManager/SectionTest.cc index a959712a22095f59a7a6dfbed0b606ab2fbd7cac..1c8a467579ea9dae72b95048fa3ef992bf419ca5 100644 --- a/src/MissionManager/SectionTest.cc +++ b/src/MissionManager/SectionTest.cc @@ -11,7 +11,7 @@ #include "SurveyComplexItem.h" SectionTest::SectionTest(void) - : _simpleItem(NULL) + : _simpleItem(nullptr) { } @@ -48,7 +48,7 @@ void SectionTest::cleanup(void) void SectionTest::_createSpy(Section* section, MultiSignalSpy** sectionSpy) { - *sectionSpy = NULL; + *sectionSpy = nullptr; MultiSignalSpy* spy = new MultiSignalSpy(); QCOMPARE(spy->init(section, rgSectionSignals, cSectionSignals), true); *sectionSpy = spy; diff --git a/src/MissionManager/SpeedSection.cc b/src/MissionManager/SpeedSection.cc index 90e49b5b2368442ecbf5b47d3f305114dd9667ea..a30f17da3b0103951e80f146478af108d192ce84 100644 --- a/src/MissionManager/SpeedSection.cc +++ b/src/MissionManager/SpeedSection.cc @@ -24,7 +24,7 @@ SpeedSection::SpeedSection(Vehicle* vehicle, QObject* parent) , _flightSpeedFact (0, _flightSpeedName, FactMetaData::valueTypeDouble) { if (_metaDataMap.isEmpty()) { - _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/SpeedSection.FactMetaData.json"), NULL /* metaDataParent */); + _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/SpeedSection.FactMetaData.json"), nullptr /* metaDataParent */); } double flightSpeed = 0; diff --git a/src/MissionManager/SpeedSection.h b/src/MissionManager/SpeedSection.h index ad0c66fde1763ec118ddaa6d52633a8e0ce4722d..31177325f7538a882bd8de7b4b14684cf10224c7 100644 --- a/src/MissionManager/SpeedSection.h +++ b/src/MissionManager/SpeedSection.h @@ -18,7 +18,7 @@ class SpeedSection : public Section Q_OBJECT public: - SpeedSection(Vehicle* vehicle, QObject* parent = NULL); + SpeedSection(Vehicle* vehicle, QObject* parent = nullptr); Q_PROPERTY(bool specifyFlightSpeed READ specifyFlightSpeed WRITE setSpecifyFlightSpeed NOTIFY specifyFlightSpeedChanged) Q_PROPERTY(Fact* flightSpeed READ flightSpeed CONSTANT) diff --git a/src/MissionManager/SpeedSectionTest.cc b/src/MissionManager/SpeedSectionTest.cc index a52442c2761a6f2e069d3987d4439af2f34563f7..94425a078c97d7e54fe415567532c26eb9cc3413 100644 --- a/src/MissionManager/SpeedSectionTest.cc +++ b/src/MissionManager/SpeedSectionTest.cc @@ -10,9 +10,9 @@ #include "SpeedSectionTest.h" SpeedSectionTest::SpeedSectionTest(void) - : _spySpeed(NULL) - , _spySection(NULL) - , _speedSection(NULL) + : _spySpeed(nullptr) + , _spySection(nullptr) + , _speedSection(nullptr) { } @@ -39,7 +39,7 @@ void SpeedSectionTest::cleanup(void) void SpeedSectionTest::_createSpy(SpeedSection* speedSection, MultiSignalSpy** speedSpy) { - *speedSpy = NULL; + *speedSpy = nullptr; MultiSignalSpy* spy = new MultiSignalSpy(); QCOMPARE(spy->init(speedSection, rgSpeedSignals, cSpeedSignals), true); *speedSpy = spy; @@ -193,7 +193,7 @@ void SpeedSectionTest::_testScanForSection(void) double flightSpeed = 10.123456; MissionItem validSpeedItem(0, MAV_CMD_DO_CHANGE_SPEED, MAV_FRAME_MISSION, _offlineVehicle->multiRotor() ? 1 : 0, flightSpeed, -1, 0, 0, 0, 0, true, false); - SimpleMissionItem simpleItem(_offlineVehicle, false /* flyView */, validSpeedItem, NULL); + SimpleMissionItem simpleItem(_offlineVehicle, false /* flyView */, validSpeedItem, nullptr); MissionItem& simpleMissionItem = simpleItem.missionItem(); visualItems.append(&simpleItem); scanIndex = 0; @@ -264,7 +264,7 @@ void SpeedSectionTest::_testScanForSection(void) // Valid item in wrong position MissionItem waypointMissionItem(0, MAV_CMD_NAV_WAYPOINT, MAV_FRAME_GLOBAL_RELATIVE_ALT, 0, 0, 0, 0, 0, 0, 0, true, false); - SimpleMissionItem simpleWaypointItem(_offlineVehicle, false /* flyView */, waypointMissionItem, NULL); + SimpleMissionItem simpleWaypointItem(_offlineVehicle, false /* flyView */, waypointMissionItem, nullptr); simpleMissionItem = validSpeedItem; visualItems.append(&simpleWaypointItem); visualItems.append(&simpleMissionItem); diff --git a/src/MissionManager/SurveyComplexItemTest.cc b/src/MissionManager/SurveyComplexItemTest.cc index 0666bda98cc7d358eec1de52ebebf4334197bee3..6a258137963e8f9f444ddef4c3724d0229014866 100644 --- a/src/MissionManager/SurveyComplexItemTest.cc +++ b/src/MissionManager/SurveyComplexItemTest.cc @@ -11,7 +11,7 @@ #include "QGCApplication.h" SurveyComplexItemTest::SurveyComplexItemTest(void) - : _offlineVehicle(NULL) + : _offlineVehicle(nullptr) { _polyPoints << QGeoCoordinate(47.633550640000003, -122.08982199) << QGeoCoordinate(47.634129020000003, -122.08887249) << QGeoCoordinate(47.633619320000001, -122.08811074) << QGeoCoordinate(47.633189139999999, -122.08900124); diff --git a/src/MissionManager/TransectStyleComplexItemTest.cc b/src/MissionManager/TransectStyleComplexItemTest.cc index e2ccd5bd3b289de391971c109faa667ece710660..08ee329cd4550ea39e05a37c5452f0de709128e3 100644 --- a/src/MissionManager/TransectStyleComplexItemTest.cc +++ b/src/MissionManager/TransectStyleComplexItemTest.cc @@ -11,7 +11,7 @@ #include "QGCApplication.h" TransectStyleComplexItemTest::TransectStyleComplexItemTest(void) - : _offlineVehicle(NULL) + : _offlineVehicle(nullptr) { _polygonVertices << QGeoCoordinate(47.633550640000003, -122.08982199) << QGeoCoordinate(47.634129020000003, -122.08887249) diff --git a/src/MissionManager/TransectStyleComplexItemTest.h b/src/MissionManager/TransectStyleComplexItemTest.h index b85cb478658c559d63aa29663c91a09ecd0df411..2f62e28ffe69d7d97f9b0983d975b9387c7f9f42 100644 --- a/src/MissionManager/TransectStyleComplexItemTest.h +++ b/src/MissionManager/TransectStyleComplexItemTest.h @@ -83,7 +83,7 @@ class TransectStyleItem : public TransectStyleComplexItem Q_OBJECT public: - TransectStyleItem(Vehicle* vehicle, QObject* parent = NULL); + TransectStyleItem(Vehicle* vehicle, QObject* parent = nullptr); // Overrides from ComplexMissionItem QString mapVisualQML (void) const final { return QString(); } diff --git a/src/MissionManager/VisualMissionItemTest.cc b/src/MissionManager/VisualMissionItemTest.cc index 8a6e235ceaeacb6499c174b5b05895ae938aff3a..beb9cae0dea74d43e596b27bf14dd9b868df4a76 100644 --- a/src/MissionManager/VisualMissionItemTest.cc +++ b/src/MissionManager/VisualMissionItemTest.cc @@ -12,7 +12,7 @@ #include "QGCApplication.h" VisualMissionItemTest::VisualMissionItemTest(void) - : _offlineVehicle(NULL) + : _offlineVehicle(nullptr) { } @@ -60,7 +60,7 @@ void VisualMissionItemTest::cleanup(void) void VisualMissionItemTest::_createSpy(SimpleMissionItem* simpleItem, MultiSignalSpy** visualSpy) { - *visualSpy = NULL; + *visualSpy = nullptr; MultiSignalSpy* spy = new MultiSignalSpy(); QCOMPARE(spy->init(simpleItem, rgVisualItemSignals, cVisualItemSignals), true); *visualSpy = spy; diff --git a/src/PositionManager/PositionManager.cpp b/src/PositionManager/PositionManager.cpp index 5de73d0f6e715a455e19de612c91dfbc486469e6..99620d2050f1995d759358f136d63739cb6b1b53 100644 --- a/src/PositionManager/PositionManager.cpp +++ b/src/PositionManager/PositionManager.cpp @@ -15,10 +15,10 @@ QGCPositionManager::QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox) : QGCTool (app, toolbox) , _updateInterval (0) , _gcsHeading (NAN) - , _currentSource (NULL) - , _defaultSource (NULL) - , _nmeaSource (NULL) - , _simulatedSource (NULL) + , _currentSource (nullptr) + , _defaultSource (nullptr) + , _nmeaSource (nullptr) + , _simulatedSource (nullptr) { } diff --git a/src/PositionManager/SimulatedPosition.cc b/src/PositionManager/SimulatedPosition.cc index 8a345a49f3549c39aff26977caebdded89d53cc8..da8157b217c7b64c6c73b5addbc7c81327e7a91d 100644 --- a/src/PositionManager/SimulatedPosition.cc +++ b/src/PositionManager/SimulatedPosition.cc @@ -16,7 +16,7 @@ SimulatedPosition::simulated_motion_s SimulatedPosition::_simulated_motion[5] = {{0,250},{0,0},{0, -250},{-250, 0},{0,0}}; SimulatedPosition::SimulatedPosition() - : QGeoPositionInfoSource(NULL), + : QGeoPositionInfoSource(nullptr), lat_int(47.3977420*1e7), lon_int(8.5455941*1e7), _step_cnt(0), diff --git a/src/QGCComboBox.h b/src/QGCComboBox.h index 43f2b415bc554e1d25bf6751a0f92ed5f2ef6745..9949ba41a96a8ef3079022f14b91675c122722ad 100644 --- a/src/QGCComboBox.h +++ b/src/QGCComboBox.h @@ -23,7 +23,7 @@ class QGCComboBox : public QComboBox { Q_OBJECT public: - QGCComboBox(QWidget* parent = NULL); + QGCComboBox(QWidget* parent = nullptr); /// @brief Sets the current index on the combo. Signals activated, as well as currentIndexChanged. void simulateUserSetCurrentIndex(int index); diff --git a/src/QGCFileDownload.h b/src/QGCFileDownload.h index 4b14f8717906e19d02e24a652fe2dbcacb0f5f39..a4a637fd78ac2c79985200da874e87673d2bd4d2 100644 --- a/src/QGCFileDownload.h +++ b/src/QGCFileDownload.h @@ -18,7 +18,7 @@ class QGCFileDownload : public QNetworkAccessManager Q_OBJECT public: - QGCFileDownload(QObject* parent = NULL); + QGCFileDownload(QObject* parent = nullptr); /// Download the specified remote file. /// @param remoteFile File to download. Can be http address or file system path. diff --git a/src/QGCLoggingCategory.cc b/src/QGCLoggingCategory.cc index c39126f02145bea0749cc6e7bef9f01246014631..15b8c7f329f3b1b703ea566dba4c29399391d79e 100644 --- a/src/QGCLoggingCategory.cc +++ b/src/QGCLoggingCategory.cc @@ -25,7 +25,7 @@ QGC_LOGGING_CATEGORY(GeotaggingLog, "GeotaggingLog") QGC_LOGGING_CATEGORY(RTKGPSLog, "RTKGPSLog") QGC_LOGGING_CATEGORY(GuidedActionsControllerLog, "GuidedActionsControllerLog") -QGCLoggingCategoryRegister* _instance = NULL; +QGCLoggingCategoryRegister* _instance = nullptr; const char* QGCLoggingCategoryRegister::_filterRulesSettingsGroup = "LoggingFilters"; QGCLoggingCategoryRegister* QGCLoggingCategoryRegister::instance(void) diff --git a/src/QGCMapPalette.h b/src/QGCMapPalette.h index 7896c6746ab879fe1920b083e91e2ea15a3f6a6e..25a1bd90f59514895df06004e4650094ab87e936 100644 --- a/src/QGCMapPalette.h +++ b/src/QGCMapPalette.h @@ -47,7 +47,7 @@ class QGCMapPalette : public QObject Q_PROPERTY(QColor thumbJoystick READ thumbJoystick NOTIFY paletteChanged) public: - QGCMapPalette(QObject* parent = NULL); + QGCMapPalette(QObject* parent = nullptr); /// Text color QColor text(void) const { return _text[_lightColors ? 0 : 1]; } diff --git a/src/QGCQGeoCoordinate.h b/src/QGCQGeoCoordinate.h index f02f26d1797400459b417c59e2b13f3d6393a2e1..1e9bc3aadc137a2413fa9c29f02106df8db33ebb 100644 --- a/src/QGCQGeoCoordinate.h +++ b/src/QGCQGeoCoordinate.h @@ -18,7 +18,7 @@ class QGCQGeoCoordinate : public QObject Q_OBJECT public: - QGCQGeoCoordinate(const QGeoCoordinate& coord, QObject* parent = NULL); + QGCQGeoCoordinate(const QGeoCoordinate& coord, QObject* parent = nullptr); Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged) Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) diff --git a/src/QGCTemporaryFile.h b/src/QGCTemporaryFile.h index 670e824e64352647514f8d28e2ed1a135aa20112..c46b6bbcc3df630c2b233343de1f596958f59bd6 100644 --- a/src/QGCTemporaryFile.h +++ b/src/QGCTemporaryFile.h @@ -28,7 +28,7 @@ public: // QStandardPaths::TempLocation directory. // @param template Template for file name following QTemporaryFile rules. Template should NOT include // directory path, only file name. - QGCTemporaryFile(const QString& fileTemplate, QObject* parent = NULL); + QGCTemporaryFile(const QString& fileTemplate, QObject* parent = nullptr); /// @brief Opens the file in ReadWrite mode. /// @returns false - open failed diff --git a/src/QmlControls/CoordinateVector.h b/src/QmlControls/CoordinateVector.h index 35561b53a4940d89ca89af5dc03098aa92ab9641..026430c24b04e6cd2c6ceae2b26eb211ab392552 100644 --- a/src/QmlControls/CoordinateVector.h +++ b/src/QmlControls/CoordinateVector.h @@ -19,8 +19,8 @@ class CoordinateVector : public QObject Q_OBJECT public: - CoordinateVector(QObject* parent = NULL); - CoordinateVector(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2, QObject* parent = NULL); + CoordinateVector(QObject* parent = nullptr); + CoordinateVector(const QGeoCoordinate& coordinate1, const QGeoCoordinate& coordinate2, QObject* parent = nullptr); Q_PROPERTY(QGeoCoordinate coordinate1 MEMBER _coordinate1 NOTIFY coordinate1Changed) Q_PROPERTY(QGeoCoordinate coordinate2 MEMBER _coordinate2 NOTIFY coordinate2Changed) diff --git a/src/QmlControls/EditPositionDialogController.cc b/src/QmlControls/EditPositionDialogController.cc index 9a1f604f2d197e6216ede49b6b77b07874b9b6a4..25ff490fe8d5882c489a6aa6440f7bc7f719aee6 100644 --- a/src/QmlControls/EditPositionDialogController.cc +++ b/src/QmlControls/EditPositionDialogController.cc @@ -29,7 +29,7 @@ EditPositionDialogController::EditPositionDialogController(void) , _northingFact (0, _northingFactName, FactMetaData::valueTypeDouble) { if (_metaDataMap.isEmpty()) { - _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/EditPositionDialog.FactMetaData.json"), NULL /* QObject parent */); + _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/EditPositionDialog.FactMetaData.json"), nullptr /* QObject parent */); } _latitudeFact.setMetaData (_metaDataMap[_latitudeFactName]); diff --git a/src/QtLocationPlugin/QGCMapTileSet.cpp b/src/QtLocationPlugin/QGCMapTileSet.cpp index d9d0145cf7eb2cdc1e5de7ef81782776b824cc3e..e9c4520920a1619efbf51095b93801e6bab81eea 100644 --- a/src/QtLocationPlugin/QGCMapTileSet.cpp +++ b/src/QtLocationPlugin/QGCMapTileSet.cpp @@ -48,11 +48,11 @@ QGCCachedTileSet::QGCCachedTileSet(const QString& name) , _downloading(false) , _id(0) , _type(UrlFactory::Invalid) - , _networkManager(NULL) + , _networkManager(nullptr) , _errorCount(0) , _noMoreTiles(false) , _batchRequested(false) - , _manager(NULL) + , _manager(nullptr) , _selected(false) { diff --git a/src/QtLocationPlugin/QGCMapUrlEngine.cpp b/src/QtLocationPlugin/QGCMapUrlEngine.cpp index 9d2b786e416230b81391bf5f93d8f4c7071b91a7..56e622b8ee4f16c2054621ee6b538573fd1b552a 100644 --- a/src/QtLocationPlugin/QGCMapUrlEngine.cpp +++ b/src/QtLocationPlugin/QGCMapUrlEngine.cpp @@ -42,7 +42,7 @@ UrlFactory::UrlFactory() : _timeout(5 * 1000) #ifndef QGC_NO_GOOGLE_MAPS , _googleVersionRetrieved(false) - , _googleReply(NULL) + , _googleReply(nullptr) #endif { QStringList langs = QLocale::system().uiLanguages(); @@ -512,7 +512,7 @@ UrlFactory::_networkReplyError(QNetworkReply::NetworkError error) if(_googleReply) { _googleReply->deleteLater(); - _googleReply = NULL; + _googleReply = nullptr; } } #endif @@ -521,7 +521,7 @@ UrlFactory::_networkReplyError(QNetworkReply::NetworkError error) void UrlFactory::_replyDestroyed() { - _googleReply = NULL; + _googleReply = nullptr; } #endif @@ -563,7 +563,7 @@ UrlFactory::_googleVersionCompleted() _versionGoogleTerrain = QString("t@%1,r@%2").arg(gc[1]).arg(gc[2]); } _googleReply->deleteLater(); - _googleReply = NULL; + _googleReply = nullptr; } #endif diff --git a/src/QtLocationPlugin/QGCTileCacheWorker.cpp b/src/QtLocationPlugin/QGCTileCacheWorker.cpp index 3df209644ea846a7b3a9d5fd765c7a7b2409a0a9..307ce051b8e2676429a0be15cec837fd3521f799 100644 --- a/src/QtLocationPlugin/QGCTileCacheWorker.cpp +++ b/src/QtLocationPlugin/QGCTileCacheWorker.cpp @@ -675,7 +675,7 @@ QGCCacheWorker::_importSets(QGCMapTask* mtask) //-- Close and delete old database if(_db) { delete _db; - _db = NULL; + _db = nullptr; QSqlDatabase::removeDatabase(kSession); } QFile file(_databasePath); @@ -989,7 +989,7 @@ QGCCacheWorker::_init() _failed = true; } delete _db; - _db = NULL; + _db = nullptr; QSqlDatabase::removeDatabase(kSession); } else { qCritical() << "Could not find suitable cache directory."; diff --git a/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp b/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp index 49438e14574c552da4f37c8c692fbe1544d6ddf8..e62779e4bcba8cd0a9b37683b87970000d0da262 100644 --- a/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp +++ b/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp @@ -82,7 +82,7 @@ QGeoServiceProviderFactoryQGC::createRoutingManagerEngine( const QVariantMap &, QGeoServiceProvider::Error *, QString *) const { // Not implemented for QGC - return NULL; + return nullptr; } //----------------------------------------------------------------------------- @@ -91,5 +91,5 @@ QGeoServiceProviderFactoryQGC::createPlaceManagerEngine( const QVariantMap &, QGeoServiceProvider::Error *, QString *) const { // Not implemented for QGC - return NULL; + return nullptr; } diff --git a/src/Terrain/TerrainQuery.h b/src/Terrain/TerrainQuery.h index 1073fae180c62982fd8d0c443c5a0d88e7dbf9c4..8216123320a77324f105569459616ac10275fdec 100644 --- a/src/Terrain/TerrainQuery.h +++ b/src/Terrain/TerrainQuery.h @@ -60,7 +60,7 @@ class TerrainAirMapQuery : public TerrainQueryInterface { Q_OBJECT public: - TerrainAirMapQuery(QObject* parent = NULL); + TerrainAirMapQuery(QObject* parent = nullptr); // Overrides from TerrainQueryInterface void requestCoordinateHeights (const QList& coordinates) final; @@ -95,7 +95,7 @@ class TerrainOfflineAirMapQuery : public TerrainQueryInterface { Q_OBJECT public: - TerrainOfflineAirMapQuery(QObject* parent = NULL); + TerrainOfflineAirMapQuery(QObject* parent = nullptr); // Overrides from TerrainQueryInterface void requestCoordinateHeights(const QList& coordinates) final; @@ -200,7 +200,7 @@ class TerrainAtCoordinateQuery : public QObject { Q_OBJECT public: - TerrainAtCoordinateQuery(QObject* parent = NULL); + TerrainAtCoordinateQuery(QObject* parent = nullptr); /// Async terrain query for a list of lon,lat coordinates. When the query is done, the terrainData() signal /// is emitted. @@ -219,7 +219,7 @@ class TerrainPathQuery : public QObject Q_OBJECT public: - TerrainPathQuery(QObject* parent = NULL); + TerrainPathQuery(QObject* parent = nullptr); /// Async terrain query for terrain heights between two lat/lon coordinates. When the query is done, the terrainData() signal /// is emitted. @@ -250,7 +250,7 @@ class TerrainPolyPathQuery : public QObject Q_OBJECT public: - TerrainPolyPathQuery(QObject* parent = NULL); + TerrainPolyPathQuery(QObject* parent = nullptr); /// Async terrain query for terrain heights for the paths between each specified QGeoCoordinate. /// When the query is done, the terrainData() signal is emitted. @@ -278,7 +278,7 @@ class TerrainCarpetQuery : public QObject Q_OBJECT public: - TerrainCarpetQuery(QObject* parent = NULL); + TerrainCarpetQuery(QObject* parent = nullptr); /// Async terrain query for terrain information bounded by the specifed corners. /// When the query is done, the terrainData() signal is emitted. diff --git a/src/TerrainTile.cc b/src/TerrainTile.cc index 55f485a23695becdeaaf987c534c9504a71ad8d4..1b2af80f9af536535d707f0555715284b77e2c56 100644 --- a/src/TerrainTile.cc +++ b/src/TerrainTile.cc @@ -24,7 +24,7 @@ TerrainTile::TerrainTile() : _minElevation(-1.0) , _maxElevation(-1.0) , _avgElevation(-1.0) - , _data(NULL) + , _data(nullptr) , _gridSizeLat(-1) , _gridSizeLon(-1) , _isValid(false) @@ -39,7 +39,7 @@ TerrainTile::~TerrainTile() delete _data[i]; } delete _data; - _data = NULL; + _data = nullptr; } } @@ -48,7 +48,7 @@ TerrainTile::TerrainTile(QByteArray byteArray) : _minElevation(-1.0) , _maxElevation(-1.0) , _avgElevation(-1.0) - , _data(NULL) + , _data(nullptr) , _gridSizeLat(-1) , _gridSizeLon(-1) , _isValid(false) diff --git a/src/Vehicle/ADSBVehicle.h b/src/Vehicle/ADSBVehicle.h index 3ae09da44893a6549985e7cfda3639aa0eb3118a..5982aa49b60234b2f4be05898e1f2b9ddf050a70 100644 --- a/src/Vehicle/ADSBVehicle.h +++ b/src/Vehicle/ADSBVehicle.h @@ -20,9 +20,9 @@ class ADSBVehicle : public QObject Q_OBJECT public: - ADSBVehicle(mavlink_adsb_vehicle_t& adsbVehicle, QObject* parent = NULL); + ADSBVehicle(mavlink_adsb_vehicle_t& adsbVehicle, QObject* parent = nullptr); - ADSBVehicle(const QGeoCoordinate& location, float heading, bool alert = false, QObject* parent = NULL); + ADSBVehicle(const QGeoCoordinate& location, float heading, bool alert = false, QObject* parent = nullptr); Q_PROPERTY(int icaoAddress READ icaoAddress CONSTANT) Q_PROPERTY(QString callsign READ callsign NOTIFY callsignChanged) diff --git a/src/Vehicle/GPSRTKFactGroup.h b/src/Vehicle/GPSRTKFactGroup.h index 4ec89d4abcaacf3b37743bf58df29418ba0c45c3..1780a41de9871c1a3e5d00da847c365582213ec4 100644 --- a/src/Vehicle/GPSRTKFactGroup.h +++ b/src/Vehicle/GPSRTKFactGroup.h @@ -17,7 +17,7 @@ class GPSRTKFactGroup : public FactGroup Q_OBJECT public: - GPSRTKFactGroup(QObject* parent = NULL); + GPSRTKFactGroup(QObject* parent = nullptr); Q_PROPERTY(Fact* connected READ connected CONSTANT) Q_PROPERTY(Fact* currentDuration READ currentDuration CONSTANT) diff --git a/src/Vehicle/MAVLinkLogManager.h b/src/Vehicle/MAVLinkLogManager.h index ba47065f64ba0c7825957b048a8d5937d3c7c398..9e057ea7b2a5ca952287c73a55f8ce48df925288 100644 --- a/src/Vehicle/MAVLinkLogManager.h +++ b/src/Vehicle/MAVLinkLogManager.h @@ -140,7 +140,7 @@ public: bool enableAutoStart () { return _enableAutoStart; } bool uploading (); bool logRunning () { return _logRunning; } - bool canStartLog () { return _vehicle != NULL && !_logginDenied; } + bool canStartLog () { return _vehicle != nullptr && !_logginDenied; } bool deleteAfterUpload () { return _deleteAfterUpload; } bool publicLog () { return _publicLog; } int windSpeed () { return _windSpeed; } diff --git a/src/Vehicle/MultiVehicleManager.cc b/src/Vehicle/MultiVehicleManager.cc index 38e46531c17269f9c02b256913227dcabc02536f..7eb94b5ecd3b3b60a19c4571c4cc7ef5b1c415da 100644 --- a/src/Vehicle/MultiVehicleManager.cc +++ b/src/Vehicle/MultiVehicleManager.cc @@ -33,11 +33,11 @@ MultiVehicleManager::MultiVehicleManager(QGCApplication* app, QGCToolbox* toolbo : QGCTool(app, toolbox) , _activeVehicleAvailable(false) , _parameterReadyVehicleAvailable(false) - , _activeVehicle(NULL) - , _offlineEditingVehicle(NULL) - , _firmwarePluginManager(NULL) - , _joystickManager(NULL) - , _mavlinkProtocol(NULL) + , _activeVehicle(nullptr) + , _offlineEditingVehicle(nullptr) + , _firmwarePluginManager(nullptr) + , _joystickManager(nullptr) + , _mavlinkProtocol(nullptr) , _gcsHeartbeatEnabled(true) { QSettings settings; @@ -236,7 +236,7 @@ void MultiVehicleManager::_deleteVehiclePhase2(void) /// Qml has been notified of vehicle about to go away and should be disconnected from it by now. /// This means we can now clear the active vehicle property and delete the Vehicle for real. - Vehicle* newActiveVehicle = NULL; + Vehicle* newActiveVehicle = nullptr; if (_vehicles.count()) { newActiveVehicle = qobject_cast(_vehicles[0]); } @@ -338,7 +338,7 @@ Vehicle* MultiVehicleManager::getVehicleById(int vehicleId) } } - return NULL; + return nullptr; } void MultiVehicleManager::setGcsHeartbeatEnabled(bool gcsHeartBeatEnabled) diff --git a/src/Vehicle/MultiVehicleManager.h b/src/Vehicle/MultiVehicleManager.h index 697d30d005e71c0faccf1f43f9fbb4dc61a57672..d2f0d29991ceaf48b7d8333ff75ea3142087f6ea 100644 --- a/src/Vehicle/MultiVehicleManager.h +++ b/src/Vehicle/MultiVehicleManager.h @@ -51,7 +51,7 @@ public: Q_INVOKABLE Vehicle* getVehicleById(int vehicleId); - UAS* activeUas(void) { return _activeVehicle ? _activeVehicle->uas() : NULL; } + UAS* activeUas(void) { return _activeVehicle ? _activeVehicle->uas() : nullptr; } // Property accessors diff --git a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc index 5da788997b8859c9094b14c630adcbe3b012c36b..3cf05ae8ddea25e396f89ed7064d1e131c780a0a 100644 --- a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc +++ b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc @@ -23,9 +23,9 @@ PX4FirmwareUpgradeThreadWorker::PX4FirmwareUpgradeThreadWorker(PX4FirmwareUpgradeThreadController* controller) : _controller(controller), - _bootloader(NULL), - _bootloaderPort(NULL), - _timerRetry(NULL), + _bootloader(nullptr), + _bootloaderPort(nullptr), + _timerRetry(nullptr), _foundBoard(false), _findBoardFirstAttempt(true) { @@ -52,14 +52,14 @@ void PX4FirmwareUpgradeThreadWorker::_init(void) { // We create the timers here so that they are on the right thread - Q_ASSERT(_timerRetry == NULL); + Q_ASSERT(_timerRetry == nullptr); _timerRetry = new QTimer(this); Q_CHECK_PTR(_timerRetry); _timerRetry->setSingleShot(true); _timerRetry->setInterval(_retryTimeout); connect(_timerRetry, &QTimer::timeout, this, &PX4FirmwareUpgradeThreadWorker::_findBoardOnce); - Q_ASSERT(_bootloader == NULL); + Q_ASSERT(_bootloader == nullptr); _bootloader = new Bootloader(this); connect(_bootloader, &Bootloader::updateProgress, this, &PX4FirmwareUpgradeThreadWorker::_updateProgress); } @@ -69,7 +69,7 @@ void PX4FirmwareUpgradeThreadWorker::_cancel(void) if (_bootloaderPort) { _bootloaderPort->close(); _bootloaderPort->deleteLater(); - _bootloaderPort = NULL; + _bootloaderPort = nullptr; } } @@ -233,7 +233,7 @@ bool PX4FirmwareUpgradeThreadWorker::_findBootloader(const QGCSerialPortInfo& po emit error(_bootloader->errorString()); } _bootloaderPort->deleteLater(); - _bootloaderPort = NULL; + _bootloaderPort = nullptr; return false; } @@ -254,7 +254,7 @@ bool PX4FirmwareUpgradeThreadWorker::_findBootloader(const QGCSerialPortInfo& po _bootloaderPort->close(); _bootloaderPort->deleteLater(); - _bootloaderPort = NULL; + _bootloaderPort = nullptr; qCDebug(FirmwareUpgradeLog) << "Bootloader error:" << _bootloader->errorString(); if (errorOnNotFound) { emit error(_bootloader->errorString()); @@ -270,7 +270,7 @@ void PX4FirmwareUpgradeThreadWorker::_reboot(void) _bootloader->reboot(_bootloaderPort); } _bootloaderPort->deleteLater(); - _bootloaderPort = NULL; + _bootloaderPort = nullptr; } } @@ -286,7 +286,7 @@ void PX4FirmwareUpgradeThreadWorker::_flash(void) emit status("Program complete"); } else { _bootloaderPort->deleteLater(); - _bootloaderPort = NULL; + _bootloaderPort = nullptr; qCDebug(FirmwareUpgradeLog) << "Program failed:" << _bootloader->errorString(); emit error(_bootloader->errorString()); return; diff --git a/src/VehicleSetup/PX4FirmwareUpgradeThread.h b/src/VehicleSetup/PX4FirmwareUpgradeThread.h index 2d398e710c6293e5efa4e294eeb38a725e71bffe..f419ad9b92f232c2b0996c0314e374390c43c8f2 100644 --- a/src/VehicleSetup/PX4FirmwareUpgradeThread.h +++ b/src/VehicleSetup/PX4FirmwareUpgradeThread.h @@ -88,7 +88,7 @@ class PX4FirmwareUpgradeThreadController : public QObject Q_OBJECT public: - PX4FirmwareUpgradeThreadController(QObject* parent = NULL); + PX4FirmwareUpgradeThreadController(QObject* parent = nullptr); ~PX4FirmwareUpgradeThreadController(void); /// @brief Begins the process of searching for a supported board connected to any serial port. This will diff --git a/src/VehicleSetup/VehicleComponent.h b/src/VehicleSetup/VehicleComponent.h index 9b6488ed0bf025929360d3d3136910d3ac1a454e..829ac31b1de2f996f328a57ebbcd61ed4d0da698 100644 --- a/src/VehicleSetup/VehicleComponent.h +++ b/src/VehicleSetup/VehicleComponent.h @@ -40,7 +40,7 @@ class VehicleComponent : public QObject Q_PROPERTY(bool allowSetupWhileFlying READ allowSetupWhileFlying CONSTANT) public: - VehicleComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); + VehicleComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr); ~VehicleComponent(); virtual QString name(void) const = 0; diff --git a/src/VideoStreaming/VideoItem.cc b/src/VideoStreaming/VideoItem.cc index 8a872c6545beb09cece89c11c2dd99cd97be46ed..0a5679a8daa37ea7decd9bc83e059a40cc53712f 100644 --- a/src/VideoStreaming/VideoItem.cc +++ b/src/VideoStreaming/VideoItem.cc @@ -57,7 +57,7 @@ VideoSurface *VideoItem::surface() const #if defined(QGC_GST_STREAMING) return _data->surface.data(); #else - return NULL; + return nullptr; #endif } @@ -92,15 +92,15 @@ QSGGeometry* VideoItem::_createDefaultGeometry(QRectF& rectBound) QSGNode* VideoItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData*) { QRectF r = boundingRect(); - QSGNode* newNode = 0; + QSGNode* newNode = nullptr; if (_data->surfaceDirty) { delete oldNode; - oldNode = 0; + oldNode = nullptr; _data->surfaceDirty = false; } - if (!_data->surface || _data->surface.data()->_data->videoSink == NULL) { + if (!_data->surface || _data->surface.data()->_data->videoSink == nullptr) { if (!oldNode) { QSGFlatColorMaterial *material = new QSGFlatColorMaterial; material->setColor(Qt::black); diff --git a/src/VideoStreaming/VideoSurface.cc b/src/VideoStreaming/VideoSurface.cc index 0ec705b5e21a6c4d84aa3eedb5f6987f8262aa73..3bddbbb6a558768363799f87d40e07b91ae8b381 100644 --- a/src/VideoStreaming/VideoSurface.cc +++ b/src/VideoStreaming/VideoSurface.cc @@ -35,7 +35,7 @@ VideoSurface::VideoSurface(QObject *parent) VideoSurface::~VideoSurface() { #if defined(QGC_GST_STREAMING) - if (!_refed && _data->videoSink != NULL) { + if (!_refed && _data->videoSink != nullptr) { gst_element_set_state(_data->videoSink, GST_STATE_NULL); } delete _data; @@ -45,12 +45,12 @@ VideoSurface::~VideoSurface() #if defined(QGC_GST_STREAMING) GstElement* VideoSurface::videoSink() { - if (_data->videoSink == NULL) { - if ((_data->videoSink = gst_element_factory_make("qtquick2videosink", NULL)) == NULL) { + if (_data->videoSink == nullptr) { + if ((_data->videoSink = gst_element_factory_make("qtquick2videosink", nullptr)) == nullptr) { qCritical("Failed to create qtquick2videosink. Make sure it is installed correctly"); - return NULL; + return nullptr; } - g_object_set(G_OBJECT(_data->videoSink), "sync", gboolean(false), NULL); + g_object_set(G_OBJECT(_data->videoSink), "sync", gboolean(false), nullptr); g_signal_connect(_data->videoSink, "update", G_CALLBACK(onUpdateThunk), (void* )this); _refed = true; } @@ -59,7 +59,7 @@ GstElement* VideoSurface::videoSink() void VideoSurface::onUpdate() { - _lastFrame = time(0); + _lastFrame = time(nullptr); Q_FOREACH(QQuickItem *item, _data->items) { item->update(); } diff --git a/src/VideoStreaming/VideoSurface_p.h b/src/VideoStreaming/VideoSurface_p.h index 0d401089f07ad992c2de9cd8205340fc53fab7f0..1bb128405d37202ceca4ed67253d7a10c4221074 100644 --- a/src/VideoStreaming/VideoSurface_p.h +++ b/src/VideoStreaming/VideoSurface_p.h @@ -23,7 +23,7 @@ class VideoSurfacePrivate { public: VideoSurfacePrivate() - : videoSink(NULL) + : videoSink(nullptr) { } QSet items; diff --git a/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp b/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp index ee927536c2686c7d2956452d34288379d4694a34..65db69e15635b8b526035f673e206ce3a6994f4b 100644 --- a/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp +++ b/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp @@ -37,7 +37,7 @@ BaseDelegate::BaseDelegate(GstElement * sink, QObject * parent) , m_forceAspectRatio(false) , m_formatDirty(true) , m_isActive(false) - , m_buffer(NULL) + , m_buffer(nullptr) , m_sink(sink) { } @@ -187,7 +187,7 @@ bool BaseDelegate::event(QEvent *event) { GST_LOG_OBJECT(m_sink, "Received deactivate event"); - gst_buffer_replace (&m_buffer, NULL); + gst_buffer_replace (&m_buffer, nullptr); update(); return true; diff --git a/src/VideoStreaming/gstqtvideosink/delegates/qtvideosinkdelegate.cpp b/src/VideoStreaming/gstqtvideosink/delegates/qtvideosinkdelegate.cpp index fd46d2a6f59b4512ff88241fe8a399c03ccbfac4..1d1cbf12630429dbef8e1f09f7f5fa2696407994 100644 --- a/src/VideoStreaming/gstqtvideosink/delegates/qtvideosinkdelegate.cpp +++ b/src/VideoStreaming/gstqtvideosink/delegates/qtvideosinkdelegate.cpp @@ -225,7 +225,7 @@ void QtVideoSinkDelegate::changePainter(const BufferFormat & format) } GST_ELEMENT_ERROR(m_sink, RESOURCE, FAILED, - ("Failed to create a painter for the given format"), (NULL)); + ("Failed to create a painter for the given format"), (nullptr)); } void QtVideoSinkDelegate::destroyPainter() diff --git a/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp b/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp index 8f8318cf79e38e3b6e2106b71297a633794926c6..8188bf86dd171b631be29f473cf30cea1762bd47 100644 --- a/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp +++ b/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp @@ -33,7 +33,7 @@ QWidgetVideoSinkDelegate::QWidgetVideoSinkDelegate(GstElement * sink, QObject * QWidgetVideoSinkDelegate::~QWidgetVideoSinkDelegate() { - setWidget(NULL); + setWidget(nullptr); } QWidget *QWidgetVideoSinkDelegate::widget() const @@ -50,7 +50,7 @@ void QWidgetVideoSinkDelegate::setWidget(QWidget *widget) m_widget.data()->setAttribute(Qt::WA_OpaquePaintEvent, m_opaquePaintEventAttribute); m_widget.data()->update(); - m_widget = NULL; + m_widget = nullptr; } if (widget) { diff --git a/src/VideoStreaming/gstqtvideosink/gstqtglvideosink.cpp b/src/VideoStreaming/gstqtvideosink/gstqtglvideosink.cpp index c92cca8de4761d5284be2e3ea30f2122220be6cf..27c9ca7e55d9e97676d66ce407a7987a2d9f28cd 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtglvideosink.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtglvideosink.cpp @@ -97,7 +97,7 @@ void GstQtGLVideoSink::class_init(gpointer g_class, gpointer class_data) g_signal_new("paint", G_TYPE_FROM_CLASS(g_class), static_cast(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), G_STRUCT_OFFSET(GstQtGLVideoSinkClass, paint), - NULL, NULL, + nullptr, nullptr, qRealIsDouble() ? g_cclosure_user_marshal_VOID__POINTER_DOUBLE_DOUBLE_DOUBLE_DOUBLE : g_cclosure_user_marshal_VOID__POINTER_FLOAT_FLOAT_FLOAT_FLOAT, @@ -114,7 +114,7 @@ void GstQtGLVideoSink::class_init(gpointer g_class, gpointer class_data) s_signals[UPDATE_SIGNAL] = g_signal_new("update", G_TYPE_FROM_CLASS(g_class), G_SIGNAL_RUN_LAST, - 0, NULL, NULL, + 0, nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); diff --git a/src/VideoStreaming/gstqtvideosink/gstqtglvideosinkbase.cpp b/src/VideoStreaming/gstqtvideosink/gstqtglvideosinkbase.cpp index ee9605e38a7e968804c84bc89501b10151fe5cd9..7b895cd3a7f13ff93bcc5231962f56ed225fce8b 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtglvideosinkbase.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtglvideosinkbase.cpp @@ -32,7 +32,7 @@ const char * const GstQtGLVideoSinkBase::s_colorbalance_labels[] = { "contrast", "brightness", "hue", "saturation" }; -GstQtVideoSinkBaseClass *GstQtGLVideoSinkBase::s_parent_class = 0; +GstQtVideoSinkBaseClass *GstQtGLVideoSinkBase::s_parent_class = nullptr; //------------------------------ @@ -41,7 +41,7 @@ DEFINE_TYPE_WITH_CODE(GstQtGLVideoSinkBase, GST_TYPE_QT_VIDEO_SINK_BASE, init_in void GstQtGLVideoSinkBase::init_interfaces(GType type) { static const GInterfaceInfo colorbalance_info = { - (GInterfaceInitFunc) &GstQtGLVideoSinkBase::colorbalance_init, NULL, NULL + (GInterfaceInitFunc) &GstQtGLVideoSinkBase::colorbalance_init, nullptr, nullptr }; g_type_add_interface_static(type, GST_TYPE_COLOR_BALANCE, &colorbalance_info); @@ -52,7 +52,7 @@ void GstQtGLVideoSinkBase::init_interfaces(GType type) void GstQtGLVideoSinkBase::base_init(gpointer g_class) { GstElementClass *element_class = GST_ELEMENT_CLASS(g_class); - element_class->padtemplates = NULL; //get rid of the pad template of the base class + element_class->padtemplates = nullptr; //get rid of the pad template of the base class static GstStaticPadTemplate sink_pad_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -98,10 +98,10 @@ void GstQtGLVideoSinkBase::init(GTypeInstance *instance, gpointer g_class) GstQtGLVideoSinkBase *self = GST_QT_GL_VIDEO_SINK_BASE(instance); GstColorBalanceChannel *channel; - self->m_channels_list = NULL; + self->m_channels_list = nullptr; for (int i=0; i < LABEL_LAST; i++) { - channel = GST_COLOR_BALANCE_CHANNEL(g_object_new(GST_TYPE_COLOR_BALANCE_CHANNEL, NULL)); + channel = GST_COLOR_BALANCE_CHANNEL(g_object_new(GST_TYPE_COLOR_BALANCE_CHANNEL, nullptr)); channel->label = g_strdup(s_colorbalance_labels[i]); channel->min_value = -100; channel->max_value = 100; diff --git a/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp b/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp index fb07d1c95e5bbe1631fad9e5de23c07696474b50..1375fd66ef9dc7ab8ed1531cc6cd25af2ae82414 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp @@ -91,10 +91,10 @@ gst_qt_quick2_video_sink_init (GstQtQuick2VideoSink *self) // colorbalance GstColorBalanceChannel *channel; - self->priv->channels_list = NULL; + self->priv->channels_list = nullptr; for (int i=0; i < LABEL_LAST; i++) { - channel = GST_COLOR_BALANCE_CHANNEL(g_object_new(GST_TYPE_COLOR_BALANCE_CHANNEL, NULL)); + channel = GST_COLOR_BALANCE_CHANNEL(g_object_new(GST_TYPE_COLOR_BALANCE_CHANNEL, nullptr)); channel->label = g_strdup(s_colorbalance_labels[i]); channel->min_value = -100; channel->max_value = 100; @@ -109,7 +109,7 @@ gst_qt_quick2_video_sink_finalize (GObject *gobject) GstQtQuick2VideoSink *self = GST_QT_QUICK2_VIDEO_SINK (gobject); delete self->priv->delegate; - self->priv->delegate = 0; + self->priv->delegate = nullptr; while (self->priv->channels_list) { GstColorBalanceChannel *channel = @@ -422,7 +422,7 @@ gst_qt_quick2_video_sink_class_init (GstQtQuick2VideoSinkClass *klass) g_signal_new("update-node", G_TYPE_FROM_CLASS(klass), static_cast(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), G_STRUCT_OFFSET(GstQtQuick2VideoSinkClass, update_node), - NULL, NULL, + nullptr, nullptr, qRealIsDouble() ? g_cclosure_user_marshal_POINTER__POINTER_DOUBLE_DOUBLE_DOUBLE_DOUBLE : g_cclosure_user_marshal_POINTER__POINTER_FLOAT_FLOAT_FLOAT_FLOAT, @@ -438,7 +438,7 @@ gst_qt_quick2_video_sink_class_init (GstQtQuick2VideoSinkClass *klass) s_signals[SIGNAL_UPDATE] = g_signal_new("update", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - 0, NULL, NULL, + 0, nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); diff --git a/src/VideoStreaming/gstqtvideosink/gstqtvideosink.cpp b/src/VideoStreaming/gstqtvideosink/gstqtvideosink.cpp index edb5a6db9941297f1d6569c06550392a7ac293ee..0d242a42fffe80d864fdc8a4f6d8d8808dd2dae4 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtvideosink.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtvideosink.cpp @@ -77,7 +77,7 @@ void GstQtVideoSink::class_init(gpointer g_class, gpointer class_data) g_signal_new("paint", G_TYPE_FROM_CLASS(g_class), static_cast(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), G_STRUCT_OFFSET(GstQtVideoSinkClass, paint), - NULL, NULL, + nullptr, nullptr, qRealIsDouble() ? g_cclosure_user_marshal_VOID__POINTER_DOUBLE_DOUBLE_DOUBLE_DOUBLE : g_cclosure_user_marshal_VOID__POINTER_FLOAT_FLOAT_FLOAT_FLOAT, @@ -94,7 +94,7 @@ void GstQtVideoSink::class_init(gpointer g_class, gpointer class_data) s_signals[UPDATE_SIGNAL] = g_signal_new("update", G_TYPE_FROM_CLASS(g_class), G_SIGNAL_RUN_LAST, - 0, NULL, NULL, + 0, nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } diff --git a/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp b/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp index 12dc844e6a7ed6ae714e76e3407289fe85c2309a..a5286e92147b10d4613a823d6d4cf06c26418a15 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp @@ -33,7 +33,7 @@ # define CAPS_FORMATS "{ BGRA, BGRx, RGB, RGB16 }" #endif -GstVideoSinkClass *GstQtVideoSinkBase::s_parent_class = NULL; +GstVideoSinkClass *GstQtVideoSinkBase::s_parent_class = nullptr; DEFINE_TYPE(GstQtVideoSinkBase, GST_TYPE_VIDEO_SINK) diff --git a/src/VideoStreaming/gstqtvideosink/painters/videomaterial.cpp b/src/VideoStreaming/gstqtvideosink/painters/videomaterial.cpp index 67daa4fc440694409d587924becfcac2c735cda8..2a00b287ab3e1ce68c23462d5e6825c7fe33c189 100644 --- a/src/VideoStreaming/gstqtvideosink/painters/videomaterial.cpp +++ b/src/VideoStreaming/gstqtvideosink/painters/videomaterial.cpp @@ -191,7 +191,7 @@ public: VideoMaterial *VideoMaterial::create(const BufferFormat & format) { - VideoMaterial *material = NULL; + VideoMaterial *material = nullptr; switch (format.videoFormat()) { // BGRx @@ -264,7 +264,7 @@ VideoMaterial::~VideoMaterial() funcs->glDeleteTextures(m_textureCount, m_textureIds); } } - gst_buffer_replace(&m_frame, NULL); + gst_buffer_replace(&m_frame, nullptr); } int VideoMaterial::compare(const QSGMaterial *other) const @@ -426,7 +426,7 @@ void VideoMaterial::bind() if (!funcs) return; - GstBuffer *frame = NULL; + GstBuffer *frame = nullptr; m_frameMutex.lock(); if (m_frame) diff --git a/src/api/QmlComponentInfo.h b/src/api/QmlComponentInfo.h index a0d354e3a853eae20e7e78f8e4e5b126d033bcc1..d6be38f553c6a0bfccef63546a15153e91042e9a 100644 --- a/src/api/QmlComponentInfo.h +++ b/src/api/QmlComponentInfo.h @@ -18,7 +18,7 @@ class QmlComponentInfo : public QObject Q_OBJECT public: - QmlComponentInfo(QString title, QUrl url, QUrl icon = QUrl(), QObject* parent = NULL); + QmlComponentInfo(QString title, QUrl url, QUrl icon = QUrl(), QObject* parent = nullptr); Q_PROPERTY(QString title READ title CONSTANT) ///< Title for page Q_PROPERTY(QUrl url READ url CONSTANT) ///< Qml source code diff --git a/src/comm/BluetoothLink.h b/src/comm/BluetoothLink.h index 484c372045094cf0ed35a2cf5ab423a47c51119a..302120a491d45b70e9215216d56849c427a72560 100644 --- a/src/comm/BluetoothLink.h +++ b/src/comm/BluetoothLink.h @@ -91,7 +91,7 @@ public: QString devName () { return _device.name; } QString address (); QStringList nameList () { return _nameList; } - bool scanning () { return _deviceDiscover != NULL; } + bool scanning () { return _deviceDiscover != nullptr; } BluetoothData device () { return _device; } diff --git a/src/comm/LinkConfiguration.cc b/src/comm/LinkConfiguration.cc index dc2cbd56736c6f958375801eab7cfb4985e4fee6..287c2affdec35a105b9a6c79ed9a610a6fc59af9 100644 --- a/src/comm/LinkConfiguration.cc +++ b/src/comm/LinkConfiguration.cc @@ -55,7 +55,7 @@ LinkConfiguration::LinkConfiguration(LinkConfiguration* copy) void LinkConfiguration::copyFrom(LinkConfiguration* source) { - Q_ASSERT(source != NULL); + Q_ASSERT(source != nullptr); _link = source->link(); _name = source->name(); _dynamic = source->isDynamic(); diff --git a/src/comm/LinkInterface.h b/src/comm/LinkInterface.h index 36c01fb72f6edefb2c9d6a2074428959bc28cb61..e04ecc4ffd776fd03e6524f5fbfa1c84df1720af 100644 --- a/src/comm/LinkInterface.h +++ b/src/comm/LinkInterface.h @@ -39,7 +39,7 @@ class LinkInterface : public QThread public: virtual ~LinkInterface() { stopMavlinkMessagesTimer(); - _config->setLink(NULL); + _config->setLink(nullptr); } Q_PROPERTY(bool active READ active NOTIFY activeChanged) diff --git a/src/comm/MockLink.cc b/src/comm/MockLink.cc index cc2a5070c6fddea9efc8d60a7b61ce06670c762d..51aaf868967bdec22ecfe2af85a298c2426a960e 100644 --- a/src/comm/MockLink.cc +++ b/src/comm/MockLink.cc @@ -70,7 +70,7 @@ MockLink::MockLink(SharedLinkConfigurationPointer& config) , _vehicleLatitude (_defaultVehicleLatitude + ((_vehicleSystemId - 128) * 0.0001)) // Slight offset for each vehicle , _vehicleLongitude (_defaultVehicleLongitude + ((_vehicleSystemId - 128) * 0.0001)) , _vehicleAltitude (_defaultVehicleAltitude) - , _fileServer (NULL) + , _fileServer (nullptr) , _sendStatusText (false) , _apmSendHomePositionOnEmptyList (false) , _failureMode (MockConfiguration::FailNone) diff --git a/src/comm/MockLinkMissionItemHandler.cc b/src/comm/MockLinkMissionItemHandler.cc index 179826898889e039d3e2bdb8da0354138d43b3a6..cc97b9be82645a61f324c9180ab211b476f9c73f 100644 --- a/src/comm/MockLinkMissionItemHandler.cc +++ b/src/comm/MockLinkMissionItemHandler.cc @@ -17,7 +17,7 @@ QGC_LOGGING_CATEGORY(MockLinkMissionItemHandlerLog, "MockLinkMissionItemHandlerL MockLinkMissionItemHandler::MockLinkMissionItemHandler(MockLink* mockLink, MAVLinkProtocol* mavlinkProtocol) : _mockLink(mockLink) - , _missionItemResponseTimer(NULL) + , _missionItemResponseTimer(nullptr) , _failureMode(FailNone) , _sendHomePositionOnEmptyList(false) , _mavlinkProtocol(mavlinkProtocol) diff --git a/src/comm/QGCJSBSimLink.cc b/src/comm/QGCJSBSimLink.cc index 9aee351380f8f0f967567ff289f221e37a233c13..0f4dbc5a4e2f3d32dd1185a5b8e188d41e60cf01 100644 --- a/src/comm/QGCJSBSimLink.cc +++ b/src/comm/QGCJSBSimLink.cc @@ -30,8 +30,8 @@ QGCJSBSimLink::QGCJSBSimLink(Vehicle* vehicle, QString startupArguments, QString remoteHost, QHostAddress host, quint16 port) : _vehicle(vehicle) - , socket(NULL) - , process(NULL) + , socket(nullptr) + , process(nullptr) , startupArguments(startupArguments) { // We're doing it wrong - because the Qt folks got the API wrong: @@ -337,13 +337,13 @@ bool QGCJSBSimLink::disconnectSimulation() { process->close(); delete process; - process = NULL; + process = nullptr; } if (socket) { socket->close(); delete socket; - socket = NULL; + socket = nullptr; } connectState = false; diff --git a/src/comm/QGCXPlaneLink.cc b/src/comm/QGCXPlaneLink.cc index ed887923685d434001fb18edec126202bb939c54..fe3037e30d1edfa9f98fcb5f0c92feaa9ea8143f 100644 --- a/src/comm/QGCXPlaneLink.cc +++ b/src/comm/QGCXPlaneLink.cc @@ -35,9 +35,9 @@ QGCXPlaneLink::QGCXPlaneLink(Vehicle* vehicle, QString remoteHost, QHostAddress _vehicle(vehicle), remoteHost(QHostAddress("127.0.0.1")), remotePort(49000), - socket(NULL), - process(NULL), - terraSync(NULL), + socket(nullptr), + process(nullptr), + terraSync(nullptr), barometerOffsetkPa(-8.0f), airframeID(QGCXPlaneLink::AIRFRAME_UNKNOWN), xPlaneConnected(false), @@ -75,7 +75,7 @@ QGCXPlaneLink::~QGCXPlaneLink() if (socket) { socket->close(); socket->deleteLater(); - socket = NULL; + socket = nullptr; } } @@ -180,7 +180,7 @@ void QGCXPlaneLink::run() emit statusMessage("Binding socket failed!"); socket->deleteLater(); - socket = NULL; + socket = nullptr; return; } @@ -260,7 +260,7 @@ void QGCXPlaneLink::run() socket->close(); socket->deleteLater(); - socket = NULL; + socket = nullptr; emit simulationDisconnected(); emit simulationConnected(false); diff --git a/src/comm/SerialLink.cc b/src/comm/SerialLink.cc index 819bbcb20b395a178799f885c96140ace3a0cb2c..46e5bfeaf2498636e2fa0d10c729a14655fa4abf 100644 --- a/src/comm/SerialLink.cc +++ b/src/comm/SerialLink.cc @@ -32,7 +32,7 @@ static QStringList kSupportedBaudRates; SerialLink::SerialLink(SharedLinkConfigurationPointer& config, bool isPX4Flow) : LinkInterface(config, isPX4Flow) - , _port(NULL) + , _port(nullptr) , _bytesRead(0) , _stopp(false) , _reqReset(false) @@ -103,7 +103,7 @@ void SerialLink::_disconnect(void) if (_port) { _port->close(); _port->deleteLater(); - _port = NULL; + _port = nullptr; } #ifdef __android__ @@ -161,7 +161,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString& qgcApp()->processEvents(QEventLoop::ExcludeUserInputEvents); } delete _port; - _port = NULL; + _port = nullptr; } qCDebug(SerialLinkLog) << "SerialLink: hardwareConnect to " << _serialConfig->portName(); @@ -234,7 +234,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString& emit communicationUpdate(getName(), tr("Error opening port: %1").arg(_port->errorString())); _port->close(); delete _port; - _port = NULL; + _port = nullptr; return false; // couldn't open serial port } diff --git a/src/comm/TCPLink.cc b/src/comm/TCPLink.cc index c7c5e1e220b8a9405796215381747ec06b66b233..dddbf76cb64c09340db0d12d2af1ec1a9e44ef82 100644 --- a/src/comm/TCPLink.cc +++ b/src/comm/TCPLink.cc @@ -27,7 +27,7 @@ TCPLink::TCPLink(SharedLinkConfigurationPointer& config) : LinkInterface(config) , _tcpConfig(qobject_cast(config.data())) - , _socket(NULL) + , _socket(nullptr) , _socketIsConnected(false) { Q_ASSERT(_tcpConfig); @@ -123,7 +123,7 @@ void TCPLink::_disconnect(void) _socket->disconnectFromHost(); // Disconnect tcp _socket->waitForDisconnected(); _socket->deleteLater(); // Make sure delete happens on correct thread - _socket = NULL; + _socket = nullptr; emit disconnected(); } } @@ -146,7 +146,7 @@ bool TCPLink::_connect(void) bool TCPLink::_hardwareConnect() { - Q_ASSERT(_socket == NULL); + Q_ASSERT(_socket == nullptr); _socket = new QTcpSocket(); QSignalSpy errorSpy(_socket, static_cast(&QTcpSocket::error)); @@ -165,7 +165,7 @@ bool TCPLink::_hardwareConnect() emit communicationError(tr("Link Error"), tr("Error on link %1. Connection failed").arg(getName())); } delete _socket; - _socket = NULL; + _socket = nullptr; return false; } _socketIsConnected = true; @@ -281,7 +281,7 @@ void TCPConfiguration::copyFrom(LinkConfiguration *source) { LinkConfiguration::copyFrom(source); auto* usource = qobject_cast(source); - Q_ASSERT(usource != NULL); + Q_ASSERT(usource != nullptr); _port = usource->port(); _address = usource->address(); } diff --git a/src/comm/UDPLink.cc b/src/comm/UDPLink.cc index bbc8459e23dc4c87ae1d9159b8da287b6a49b59b..1642b9d92fca1dba7b634d578df163d69db75a0b 100644 --- a/src/comm/UDPLink.cc +++ b/src/comm/UDPLink.cc @@ -80,10 +80,10 @@ static bool contains_target(const QList list, const QHostAddress& ad UDPLink::UDPLink(SharedLinkConfigurationPointer& config) : LinkInterface(config) #if defined(QGC_ZEROCONF_ENABLED) - , _dnssServiceRef(NULL) + , _dnssServiceRef(nullptr) #endif , _running(false) - , _socket(NULL) + , _socket(nullptr) , _udpConfig(qobject_cast(config.data())) , _connectState(false) { @@ -253,7 +253,7 @@ void UDPLink::_disconnect(void) if (_socket) { // Make sure delete happen on correct thread _socket->deleteLater(); - _socket = NULL; + _socket = nullptr; emit disconnected(); } _connectState = false; @@ -281,7 +281,7 @@ bool UDPLink::_hardwareConnect() { if (_socket) { delete _socket; - _socket = NULL; + _socket = nullptr; } QHostAddress host = QHostAddress::AnyIPv4; _socket = new QUdpSocket(this); diff --git a/src/qgcunittest/LinkManagerTest.cc b/src/qgcunittest/LinkManagerTest.cc index 77f4e8b3c5da883e6dca21698ab9da41994ea04b..af396acd832ab4fecd3f9dd6bb9e6904061878be 100644 --- a/src/qgcunittest/LinkManagerTest.cc +++ b/src/qgcunittest/LinkManagerTest.cc @@ -18,8 +18,8 @@ #include "QGCApplication.h" LinkManagerTest::LinkManagerTest(void) : - _linkMgr(NULL), - _multiSpy(NULL) + _linkMgr(nullptr), + _multiSpy(nullptr) { } @@ -27,8 +27,8 @@ void LinkManagerTest::init(void) { UnitTest::init(); - Q_ASSERT(_linkMgr == NULL); - Q_ASSERT(_multiSpy == NULL); + Q_ASSERT(_linkMgr == nullptr); + Q_ASSERT(_multiSpy == nullptr); _linkMgr = qgcApp()->toolbox()->linkManager(); Q_CHECK_PTR(_linkMgr); @@ -47,8 +47,8 @@ void LinkManagerTest::cleanup(void) delete _multiSpy; - _linkMgr = NULL; - _multiSpy = NULL; + _linkMgr = nullptr; + _multiSpy = nullptr; UnitTest::cleanup(); } @@ -91,7 +91,7 @@ void LinkManagerTest::_addSignals_test(void) QList signalArgs = spy->takeFirst(); QCOMPARE(signalArgs.count(), 1); QObject* object = qvariant_cast(signalArgs[0]); - QVERIFY(object != NULL); + QVERIFY(object != nullptr); MockLink* signalLink = qobject_cast(object); QCOMPARE(signalLink, _mockLink); } diff --git a/src/qgcunittest/MultiSignalSpy.cc b/src/qgcunittest/MultiSignalSpy.cc index e7cca3592ad873b443f3ef46fbb57e0986212e46..6ef00474ed03555266e0aa59eb361dab01cf470d 100644 --- a/src/qgcunittest/MultiSignalSpy.cc +++ b/src/qgcunittest/MultiSignalSpy.cc @@ -22,8 +22,8 @@ MultiSignalSpy::MultiSignalSpy(QObject* parent) : QObject(parent), - _signalEmitter(NULL), - _rgSignals(NULL), + _signalEmitter(nullptr), + _rgSignals(nullptr), _cSignals(0) { } @@ -55,10 +55,10 @@ bool MultiSignalSpy::init(QObject* signalEmitter, ///< [in] object whi // Allocate and connect QSignalSpy's _rgSpys = new QSignalSpy*[_cSignals]; - Q_ASSERT(_rgSpys != NULL); + Q_ASSERT(_rgSpys != nullptr); for (size_t i=0; i<_cSignals; i++) { _rgSpys[i] = new QSignalSpy(_signalEmitter, _rgSignals[i]); - if (_rgSpys[i] == NULL) { + if (_rgSpys[i] == nullptr) { qDebug() << "Unabled to allocated QSignalSpy"; return false; } @@ -76,7 +76,7 @@ bool MultiSignalSpy::_checkSignalByMaskWorker(quint32 mask, bool multipleSignals for (size_t i=0; i<_cSignals; i++) { if ((1 << i) & mask) { QSignalSpy* spy = _rgSpys[i]; - Q_ASSERT(spy != NULL); + Q_ASSERT(spy != nullptr); if ((multipleSignalsAllowed && spy->count() == 0) || (!multipleSignalsAllowed && spy->count() != 1)) { qDebug() << "Failed index:" << i; @@ -93,7 +93,7 @@ bool MultiSignalSpy::_checkOnlySignalByMaskWorker(quint32 mask, bool multipleSig { for (size_t i=0; i<_cSignals; i++) { QSignalSpy* spy = _rgSpys[i]; - Q_ASSERT(spy != NULL); + Q_ASSERT(spy != nullptr); if ((1 << i) & mask) { if ((multipleSignalsAllowed && spy->count() == 0) || (!multipleSignalsAllowed && spy->count() != 1)) { @@ -137,7 +137,7 @@ bool MultiSignalSpy::checkNoSignalByMask(quint32 mask) for (size_t i=0; i<_cSignals; i++) { if ((1 << i) & mask) { QSignalSpy* spy = _rgSpys[i]; - Q_ASSERT(spy != NULL); + Q_ASSERT(spy != nullptr); if (spy->count() != 0) { _printSignalState(mask); @@ -159,7 +159,7 @@ bool MultiSignalSpy::checkNoSignals(void) QSignalSpy* MultiSignalSpy::getSpyByIndex(quint32 index) { Q_ASSERT(index < _cSignals); - Q_ASSERT(_rgSpys[index] != NULL); + Q_ASSERT(_rgSpys[index] != nullptr); return _rgSpys[index]; } @@ -168,7 +168,7 @@ QSignalSpy* MultiSignalSpy::getSpyByIndex(quint32 index) void MultiSignalSpy::clearSignalByIndex(quint32 index) { Q_ASSERT(index < _cSignals); - Q_ASSERT(_rgSpys[index] != NULL); + Q_ASSERT(_rgSpys[index] != nullptr); _rgSpys[index]->clear(); } @@ -179,7 +179,7 @@ void MultiSignalSpy::clearSignalsByMask(quint32 mask) for (size_t i=0; i<_cSignals; i++) { if ((1 << i) & mask) { QSignalSpy* spy = _rgSpys[i]; - Q_ASSERT(spy != NULL); + Q_ASSERT(spy != nullptr); spy->clear(); } @@ -242,7 +242,7 @@ void MultiSignalSpy::_printSignalState(quint32 mask) bool expected = (1 << i) & mask; QSignalSpy* spy = _rgSpys[i]; - Q_ASSERT(spy != NULL); + Q_ASSERT(spy != nullptr); qDebug() << "Signal index:" << i << "count:" << spy->count() << "expected:" << expected << _rgSignals[i]; } } diff --git a/src/qgcunittest/MultiSignalSpy.h b/src/qgcunittest/MultiSignalSpy.h index c077c5c77aed035d3b8e64726432077359e1536d..b397e188ecb2cb73bbacaa13445a4d8be49d24e6 100644 --- a/src/qgcunittest/MultiSignalSpy.h +++ b/src/qgcunittest/MultiSignalSpy.h @@ -25,7 +25,7 @@ class MultiSignalSpy : public QObject Q_OBJECT public: - MultiSignalSpy(QObject* parent = NULL); + MultiSignalSpy(QObject* parent = nullptr); ~MultiSignalSpy(); bool init(QObject* signalEmitter, const char** rgSignals, size_t cSignals); diff --git a/src/qgcunittest/TCPLinkTest.cc b/src/qgcunittest/TCPLinkTest.cc index 92b5303c470c8f50cbd67ab1f09401a27e04be85..02d320bf24a480fd17fc68a5675ae0afbb70ffc3 100644 --- a/src/qgcunittest/TCPLinkTest.cc +++ b/src/qgcunittest/TCPLinkTest.cc @@ -17,8 +17,8 @@ #include "TCPLoopBackServer.h" TCPLinkTest::TCPLinkTest(void) - : _link(NULL) - , _multiSpy(NULL) + : _link(nullptr) + , _multiSpy(nullptr) { } diff --git a/src/qgcunittest/TCPLoopBackServer.cc b/src/qgcunittest/TCPLoopBackServer.cc index b7e64e9bc84587d9cd0fd560ce4b0444e4415516..14bf38f221fe87689cd4adfca04d527d629f9920 100644 --- a/src/qgcunittest/TCPLoopBackServer.cc +++ b/src/qgcunittest/TCPLoopBackServer.cc @@ -18,7 +18,7 @@ TCPLoopBackServer::TCPLoopBackServer(QHostAddress hostAddress, quint16 port) : _hostAddress(hostAddress), _port(port), - _tcpSocket(NULL) + _tcpSocket(nullptr) { moveToThread(this); start(HighPriority); diff --git a/src/uas/FileManager.cc b/src/uas/FileManager.cc index a4de1d37c9a0761d8dd854ea26bb798eed9a64a5..06f8866b6084b33a1866f3e197dff8c2c76b5d6e 100644 --- a/src/uas/FileManager.cc +++ b/src/uas/FileManager.cc @@ -24,7 +24,7 @@ FileManager::FileManager(QObject* parent, Vehicle* vehicle) : QObject(parent) , _currentOperation(kCOIdle) , _vehicle(vehicle) - , _dedicatedLink(NULL) + , _dedicatedLink(nullptr) , _activeSession(0) , _missingDownloadedBytes(0) , _downloadingMissingParts(false) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 18b43e4daddc7a851037a27f9b13761f2dff6db1..19f31d74107e7d2064475e9028b7d1c2fedc1702 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -1547,5 +1547,5 @@ void UAS::shutdownVehicle(void) simulation->deleteLater(); } #endif - _vehicle = NULL; + _vehicle = nullptr; } diff --git a/src/uas/UASMessageHandler.cc b/src/uas/UASMessageHandler.cc index 1e2ae51863a7c909cb164a46f555c9e4e97199ac..5167bb8cdb1c3e524c501f93cd78137927cdc73a 100644 --- a/src/uas/UASMessageHandler.cc +++ b/src/uas/UASMessageHandler.cc @@ -41,7 +41,7 @@ bool UASMessage::severityIsError() UASMessageHandler::UASMessageHandler(QGCApplication* app, QGCToolbox* toolbox) : QGCTool(app, toolbox) - , _activeVehicle(NULL) + , _activeVehicle(nullptr) , _activeComponent(-1) , _multiComp(false) , _errorCount(0) @@ -49,7 +49,7 @@ UASMessageHandler::UASMessageHandler(QGCApplication* app, QGCToolbox* toolbox) , _warningCount(0) , _normalCount(0) , _showErrorsInToolbar(false) - , _multiVehicleManager(NULL) + , _multiVehicleManager(nullptr) { } @@ -66,7 +66,7 @@ void UASMessageHandler::setToolbox(QGCToolbox *toolbox) _multiVehicleManager = _toolbox->multiVehicleManager(); connect(_multiVehicleManager, &MultiVehicleManager::activeVehicleChanged, this, &UASMessageHandler::_activeVehicleChanged); - emit textMessageReceived(NULL); + emit textMessageReceived(nullptr); emit textMessageCountChanged(0); } @@ -89,9 +89,9 @@ void UASMessageHandler::_activeVehicleChanged(Vehicle* vehicle) // If we were already attached to an autopilot, disconnect it. if (_activeVehicle) { disconnect(_activeVehicle, &Vehicle::textMessageReceived, this, &UASMessageHandler::handleTextMessage); - _activeVehicle = NULL; + _activeVehicle = nullptr; clearMessages(); - emit textMessageReceived(NULL); + emit textMessageReceived(nullptr); } // And now if there's an autopilot to follow, set up the UI.