Commit f6658d4a authored by murata's avatar murata

FactSystem: Change NULL or 0 to nullptr

parent efb4427b
......@@ -30,13 +30,13 @@ class Fact : public QObject
Q_OBJECT
public:
Fact(QObject* parent = NULL);
Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObject* parent = NULL);
Fact(const Fact& other, QObject* parent = NULL);
Fact(QObject* parent = nullptr);
Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObject* parent = nullptr);
Fact(const Fact& other, QObject* parent = nullptr);
/// Creates a Fact using the name and type from metaData. Also calls QGCCorePlugin::adjustSettingsMetaData allowing
/// custom builds to override the metadata.
Fact(const QString& settingsGroup, FactMetaData* metaData, QObject* parent = NULL);
Fact(const QString& settingsGroup, FactMetaData* metaData, QObject* parent = nullptr);
const Fact& operator=(const Fact& other);
......
......@@ -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];
......
......@@ -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)
......
......@@ -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)
......
......@@ -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);
......
......@@ -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
......
......@@ -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<Fact*>();
}
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment