Unverified Commit 0548caca authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #7859 from DonLakeFlyer/ReportMissing

Remove duplicates from missing parameter reporting
parents cfa151aa b0712e91
......@@ -687,7 +687,11 @@ bool QGCApplication::_checkTelemetrySavePath(bool useMessageBox)
void QGCApplication::reportMissingParameter(int componentId, const QString& name)
{
_missingParams += QString("%1:%2").arg(componentId).arg(name);
QPair<int, QString> missingParam(componentId, name);
if (!_missingParams.contains(missingParam)) {
_missingParams.append(missingParam);
}
_missingParamsDelayedDisplayTimer.start();
}
......@@ -696,12 +700,14 @@ void QGCApplication::_missingParamsDisplay(void)
{
if (_missingParams.count()) {
QString params;
foreach (const QString &name, _missingParams) {
for (QPair<int, QString>& missingParam: _missingParams) {
QString param = QStringLiteral("%1:%2").arg(missingParam.first).arg(missingParam.second);
if (params.isEmpty()) {
params += name;
params += param;
} else {
params += QString(", %1").arg(name);
params += QStringLiteral(", %1").arg(param);
}
}
_missingParams.clear();
......
......@@ -174,10 +174,10 @@ private:
void _exitWithError (QString errorMessage);
bool _runningUnitTests; ///< true: running unit tests, false: normal app
static const int _missingParamsDelayedDisplayTimerTimeout = 1000; ///< Timeout to wait for next missing fact to come in before display
QTimer _missingParamsDelayedDisplayTimer; ///< Timer use to delay missing fact display
QStringList _missingParams; ///< List of missing facts to be displayed
bool _runningUnitTests; ///< true: running unit tests, false: normal app
static const int _missingParamsDelayedDisplayTimerTimeout = 1000; ///< Timeout to wait for next missing fact to come in before display
QTimer _missingParamsDelayedDisplayTimer; ///< Timer use to delay missing fact display
QList<QPair<int,QString>> _missingParams; ///< List of missing parameter component id:name
QQmlApplicationEngine* _qmlAppEngine = nullptr;
bool _logOutput = false; ///< true: Log Qt debug output to file
......
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