Browse Source

Fix problems which were popping warnings causing QT_FATAL_WARNINGS to not be usable

Android serial port fix
QGC4.4
Don Gagne 3 years ago committed by Don Gagne
parent
commit
5722fad470
  1. BIN
      resources/icons/qgroundcontrol.png
  2. BIN
      resources/notile.png
  3. BIN
      src/FirmwarePlugin/APM/APMBrandImage.png
  4. 2
      src/FlightDisplay/FlyViewVideo.qml
  5. 2
      src/FlightDisplay/FlyViewWidgetLayer.qml
  6. 33
      src/PositionManager/PositionManager.cpp

BIN
resources/icons/qgroundcontrol.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
resources/notile.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/FirmwarePlugin/APM/APMBrandImage.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 24 KiB

2
src/FlightDisplay/FlyViewVideo.qml

@ -61,7 +61,7 @@ Item {
id: cameraLoader id: cameraLoader
anchors.fill: parent anchors.fill: parent
visible: !QGroundControl.videoManager.isGStreamer visible: !QGroundControl.videoManager.isGStreamer
source: visible ? (QGroundControl.videoManager.uvcEnabled ? "qrc:/qml/FlightDisplayViewUVC.qml" : "qrc:/qml/FlightDisplayViewDummy.qml") : "" source: QGroundControl.videoManager.uvcEnabled ? "qrc:/qml/FlightDisplayViewUVC.qml" : "qrc:/qml/FlightDisplayViewDummy.qml"
} }
QGCLabel { QGCLabel {

2
src/FlightDisplay/FlyViewWidgetLayer.qml

@ -62,7 +62,7 @@ Item {
topEdgeRightInset: parentToolInsets.topEdgeRightInset topEdgeRightInset: parentToolInsets.topEdgeRightInset
bottomEdgeLeftInset: parentToolInsets.bottomEdgeLeftInset bottomEdgeLeftInset: parentToolInsets.bottomEdgeLeftInset
bottomEdgeCenterInset: mapScale.centerInset bottomEdgeCenterInset: mapScale.centerInset
bottomEdgeRightInset: telemetryPanel.bottomInset bottomEdgeRightInset: 0
} }
FlyViewMissionCompleteDialog { FlyViewMissionCompleteDialog {

33
src/PositionManager/PositionManager.cpp

@ -11,6 +11,12 @@
#include "QGCApplication.h" #include "QGCApplication.h"
#include "QGCCorePlugin.h" #include "QGCCorePlugin.h"
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
#include <QSerialPortInfo>
#endif
#include <QtPositioning/private/qgeopositioninfosource_p.h>
QGCPositionManager::QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox) QGCPositionManager::QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool (app, toolbox) : QGCTool (app, toolbox)
{ {
@ -39,7 +45,34 @@ void QGCPositionManager::setToolbox(QGCToolbox *toolbox)
if (!_defaultSource) { if (!_defaultSource) {
//-- Otherwise, create a default one //-- Otherwise, create a default one
#if 0
// Calling this can end up falling through a path which tries to instantiate a serialnmea source.
// The Qt code for this will pop a qWarning if there are no serial ports available. This in turn
// causes you to be unable to run with QT_FATAL_WARNINGS=1 to debug stuff.
_defaultSource = QGeoPositionInfoSource::createDefaultSource(this); _defaultSource = QGeoPositionInfoSource::createDefaultSource(this);
#else
// So instead we create our own version of QGeoPositionInfoSource::createDefaultSource which isn't as stupid.
QList<QJsonObject> plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
foreach (const QJsonObject &obj, plugins) {
if (obj.value("Position").isBool() && obj.value("Position").toBool()) {
QString pluginName = obj.value("Keys").toArray()[0].toString();
if (pluginName == "serialnmea") {
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
if (QSerialPortInfo::availablePorts().isEmpty()) {
// This prevents the qWarning from popping
continue;
}
#else
continue;
#endif
}
_defaultSource = QGeoPositionInfoSource::createSource(pluginName, this);
if (_defaultSource) {
break;
}
}
}
#endif
} }
_simulatedSource = new SimulatedPosition(); _simulatedSource = new SimulatedPosition();

Loading…
Cancel
Save