diff --git a/ground/gcs/src/libs/utils/svgimageprovider.cpp b/ground/gcs/src/libs/utils/svgimageprovider.cpp index 991ac34a4..85e2fc318 100644 --- a/ground/gcs/src/libs/utils/svgimageprovider.cpp +++ b/ground/gcs/src/libs/utils/svgimageprovider.cpp @@ -45,7 +45,7 @@ SvgImageProvider::~SvgImageProvider() QSvgRenderer *SvgImageProvider::loadRenderer(const QString &svgFile) { - QSvgRenderer *renderer = m_renderers.value(svgFile); + QSvgRenderer *renderer = m_renderers.value(svgFile, NULL); if (!renderer) { QFileInfo fi(svgFile); diff --git a/ground/gcs/src/plugins/config/calibration/thermal/thermalcalibration.h b/ground/gcs/src/plugins/config/calibration/thermal/thermalcalibration.h index 04cc6f85b..abfeff18f 100644 --- a/ground/gcs/src/plugins/config/calibration/thermal/thermalcalibration.h +++ b/ground/gcs/src/plugins/config/calibration/thermal/thermalcalibration.h @@ -42,12 +42,12 @@ class ThermalCalibration { static const int BARO_PRESSURE_POLY_DEGREE = 3; // TODO: determine max allowable relative error constexpr static const double BARO_PRESSURE_MAX_REL_ERROR = 1E-6f; - constexpr static const double ACCEL_X_MAX_REL_ERROR = 1E-6f; - constexpr static const double ACCEL_Y_MAX_REL_ERROR = 1E-6f; - constexpr static const double ACCEL_Z_MAX_REL_ERROR = 1E-6f; - constexpr static const double GYRO_X_MAX_REL_ERROR = 1E-6f; - constexpr static const double GYRO_Y_MAX_REL_ERROR = 1E-6f; - constexpr static const double GYRO_Z_MAX_REL_ERROR = 1E-6f; + constexpr static const double ACCEL_X_MAX_REL_ERROR = 1E-6f; + constexpr static const double ACCEL_Y_MAX_REL_ERROR = 1E-6f; + constexpr static const double ACCEL_Z_MAX_REL_ERROR = 1E-6f; + constexpr static const double GYRO_X_MAX_REL_ERROR = 1E-6f; + constexpr static const double GYRO_Y_MAX_REL_ERROR = 1E-6f; + constexpr static const double GYRO_Z_MAX_REL_ERROR = 1E-6f; public: /** diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.h b/ground/gcs/src/plugins/config/configstabilizationwidget.h index ff98880ed..529a81a0b 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.h @@ -63,7 +63,7 @@ private: static const int AUTOMATIC_UPDATE_RATE = 500; static const int EXPO_CURVE_POINTS_COUNT = 100; - constexpr static const double EXPO_CURVE_CONSTANT = 1.00695; + constexpr static const double EXPO_CURVE_CONSTANT = 1.00695; int boardModel; int m_stabSettingsBankCount; diff --git a/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 5382cdc1f..1ffa5bc98 100644 --- a/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -215,7 +215,7 @@ Q_DECLARE_METATYPE(::PageData) SettingsDialog::SettingsDialog(QWidget *parent, c SettingsDialog::~SettingsDialog() { foreach(QString category, m_categoryItemsMap.keys()) { - QList *categoryItemList = m_categoryItemsMap.value(category); + QList *categoryItemList = m_categoryItemsMap.value(category, NULL); delete categoryItemList; } // delete place holders @@ -237,7 +237,7 @@ QTreeWidgetItem *SettingsDialog::addPage(IOptionsPage *page) QString category = page->category(); - QList *categoryItemList = m_categoryItemsMap.value(category); + QList *categoryItemList = m_categoryItemsMap.value(category, NULL); if (!categoryItemList) { categoryItemList = new QList(); m_categoryItemsMap.insert(category, categoryItemList); @@ -346,7 +346,7 @@ void SettingsDialog::deletePage() PageData data = item->data(0, Qt::UserRole).value(); QString category = data.category; - QList *categoryItemList = m_categoryItemsMap.value(category); + QList *categoryItemList = m_categoryItemsMap.value(category, NULL); if (categoryItemList) { categoryItemList->removeOne(item); QTreeWidgetItem *parentItem = item->parent(); @@ -382,7 +382,7 @@ void SettingsDialog::insertPage(IOptionsPage *page) // If this category has no child right now // we need to add the "default child" - QList *categoryItemList = m_categoryItemsMap.value(page->category()); + QList *categoryItemList = m_categoryItemsMap.value(page->category(), NULL); if (categoryItem->childCount() == 1) { QTreeWidgetItem *defaultItem = categoryItemList->at(0); defaultItem->setHidden(false); diff --git a/ground/gcs/src/plugins/coreplugin/mainwindow.cpp b/ground/gcs/src/plugins/coreplugin/mainwindow.cpp index 29844a53d..7fa1be779 100644 --- a/ground/gcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/gcs/src/plugins/coreplugin/mainwindow.cpp @@ -882,7 +882,7 @@ GeneralSettings *MainWindow::generalSettings() const IContext *MainWindow::contextObject(QWidget *widget) { - return m_contextWidgets.value(widget); + return m_contextWidgets.value(widget, NULL); } void MainWindow::addContextObject(IContext *context) @@ -955,7 +955,7 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now) IContext *context = 0; QWidget *p = focusWidget(); while (p) { - context = m_contextWidgets.value(p); + context = m_contextWidgets.value(p, NULL); if (context) { newContext = context; break; diff --git a/ground/gcs/src/plugins/coreplugin/sidebar.cpp b/ground/gcs/src/plugins/coreplugin/sidebar.cpp index c4b7bf717..0661e4aa9 100644 --- a/ground/gcs/src/plugins/coreplugin/sidebar.cpp +++ b/ground/gcs/src/plugins/coreplugin/sidebar.cpp @@ -94,7 +94,7 @@ SideBarItem *SideBar::item(const QString &title) { if (m_itemMap.contains(title)) { m_availableItems.removeAll(title); - return m_itemMap.value(title); + return m_itemMap.value(title, NULL); } return 0; } diff --git a/ground/gcs/src/plugins/uavtalk/telemetry.cpp b/ground/gcs/src/plugins/uavtalk/telemetry.cpp index 909714f2b..78602919f 100644 --- a/ground/gcs/src/plugins/uavtalk/telemetry.cpp +++ b/ground/gcs/src/plugins/uavtalk/telemetry.cpp @@ -607,12 +607,12 @@ ObjectTransactionInfo *Telemetry::findTransaction(UAVObject *obj) quint16 instId = obj->getInstID(); // Lookup the transaction in the transaction map - QMap *objTransactions = transMap.value(objId); + QMap *objTransactions = transMap.value(objId, NULL); if (objTransactions != NULL) { - ObjectTransactionInfo *trans = objTransactions->value(instId); + ObjectTransactionInfo *trans = objTransactions->value(instId, NULL); if (trans == NULL) { // see if there is an ALL_INSTANCES transaction - trans = objTransactions->value(UAVTalk::ALL_INSTANCES); + trans = objTransactions->value(UAVTalk::ALL_INSTANCES, NULL); } return trans; } @@ -624,7 +624,7 @@ void Telemetry::openTransaction(ObjectTransactionInfo *trans) quint32 objId = trans->obj->getObjID(); quint16 instId = trans->allInstances ? UAVTalk::ALL_INSTANCES : trans->obj->getInstID(); - QMap *objTransactions = transMap.value(objId); + QMap *objTransactions = transMap.value(objId, NULL); if (objTransactions == NULL) { objTransactions = new QMap(); transMap.insert(objId, objTransactions); @@ -637,7 +637,7 @@ void Telemetry::closeTransaction(ObjectTransactionInfo *trans) quint32 objId = trans->obj->getObjID(); quint16 instId = trans->allInstances ? UAVTalk::ALL_INSTANCES : trans->obj->getInstID(); - QMap *objTransactions = transMap.value(objId); + QMap *objTransactions = transMap.value(objId, NULL); if (objTransactions != NULL) { objTransactions->remove(instId); // Keep the map even if it is empty @@ -649,9 +649,9 @@ void Telemetry::closeTransaction(ObjectTransactionInfo *trans) void Telemetry::closeAllTransactions() { foreach(quint32 objId, transMap.keys()) { - QMap *objTransactions = transMap.value(objId); + QMap *objTransactions = transMap.value(objId, NULL); foreach(quint32 instId, objTransactions->keys()) { - ObjectTransactionInfo *trans = objTransactions->value(instId); + ObjectTransactionInfo *trans = objTransactions->value(instId, NULL); qWarning() << "Telemetry - closing active transaction for object" << trans->obj->toStringBrief(); objTransactions->remove(instId); diff --git a/ground/gcs/src/plugins/uavtalk/uavtalk.cpp b/ground/gcs/src/plugins/uavtalk/uavtalk.cpp index 08ac75935..6f8afaf35 100644 --- a/ground/gcs/src/plugins/uavtalk/uavtalk.cpp +++ b/ground/gcs/src/plugins/uavtalk/uavtalk.cpp @@ -815,12 +815,12 @@ bool UAVTalk::transmitSingleObject(quint8 type, quint32 objId, quint16 instId, U UAVTalk::Transaction *UAVTalk::findTransaction(quint32 objId, quint16 instId) { // Lookup the transaction in the transaction map - QMap *objTransactions = transMap.value(objId); + QMap *objTransactions = transMap.value(objId, NULL); if (objTransactions != NULL) { - Transaction *trans = objTransactions->value(instId); + Transaction *trans = objTransactions->value(instId, NULL); if (trans == NULL) { // see if there is an ALL_INSTANCES transaction - trans = objTransactions->value(ALL_INSTANCES); + trans = objTransactions->value(ALL_INSTANCES, NULL); } return trans; } @@ -835,7 +835,7 @@ void UAVTalk::openTransaction(quint8 type, quint32 objId, quint16 instId) trans->respObjId = objId; trans->respInstId = instId; - QMap *objTransactions = transMap.value(trans->respObjId); + QMap *objTransactions = transMap.value(trans->respObjId, NULL); if (objTransactions == NULL) { objTransactions = new QMap(); transMap.insert(trans->respObjId, objTransactions); @@ -845,7 +845,7 @@ void UAVTalk::openTransaction(quint8 type, quint32 objId, quint16 instId) void UAVTalk::closeTransaction(Transaction *trans) { - QMap *objTransactions = transMap.value(trans->respObjId); + QMap *objTransactions = transMap.value(trans->respObjId, NULL); if (objTransactions != NULL) { objTransactions->remove(trans->respInstId); // Keep the map even if it is empty @@ -857,9 +857,9 @@ void UAVTalk::closeTransaction(Transaction *trans) void UAVTalk::closeAllTransactions() { foreach(quint32 objId, transMap.keys()) { - QMap *objTransactions = transMap.value(objId); + QMap *objTransactions = transMap.value(objId, NULL); foreach(quint32 instId, objTransactions->keys()) { - Transaction *trans = objTransactions->value(instId); + Transaction *trans = objTransactions->value(instId, NULL); qWarning() << "UAVTalk - closing active transaction for object" << trans->respObjId; objTransactions->remove(instId); diff --git a/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp b/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp index 75111391d..1796f1a1d 100644 --- a/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp +++ b/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp @@ -394,7 +394,7 @@ void generateBaseProperty(Context &ctxt, FieldContext &fieldCtxt) } if (fieldCtxt.hasDeprecatedSetter) { ctxt.setters += generate(ctxt, fieldCtxt, - " /*DEPRECATED*/ void set:fieldName(:fieldType value) { set:fieldName(static_cast<:propType>(value)); }\n"); + " /*DEPRECATED*/ void set:fieldName(:fieldType value) { set:PropName(static_cast<:propType>(value)); }\n"); } if (fieldCtxt.hasDeprecatedNotification) { ctxt.notifications += generate(ctxt, fieldCtxt, @@ -489,7 +489,7 @@ void generateIndexedProperty(Context &ctxt, FieldContext &fieldCtxt) } if (fieldCtxt.hasDeprecatedSetter) { ctxt.setters += generate(ctxt, fieldCtxt, - " /*DEPRECATED*/ void set:fieldName(quint32 index, :fieldType value) { set:fieldName(index, static_cast<:propType>(value)); }\n"); + " /*DEPRECATED*/ void set:fieldName(quint32 index, :fieldType value) { set:PropName(index, static_cast<:propType>(value)); }\n"); } if (fieldCtxt.hasDeprecatedNotification) {