From 67cc2001d6f7fc5455a03c320673658902450ae0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beat=20K=C3=BCng?= <beat-kueng@gmx.net>
Date: Mon, 12 Apr 2021 10:56:22 +0200
Subject: [PATCH] Revert "Control COMPONENT_INFORMATION query from app setting"

This reverts commit ec13a2d0ab2b4604e35d83f41378972c37ec0028.

Now ready to be used by default.
---
 src/Settings/App.SettingsGroup.json        | 6 ------
 src/Settings/AppSettings.cc                | 1 -
 src/Settings/AppSettings.h                 | 2 +-
 src/Vehicle/ComponentInformationManager.cc | 5 -----
 src/ui/preferences/GeneralSettings.qml     | 8 --------
 5 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/src/Settings/App.SettingsGroup.json b/src/Settings/App.SettingsGroup.json
index e947af4..605446a 100644
--- a/src/Settings/App.SettingsGroup.json
+++ b/src/Settings/App.SettingsGroup.json
@@ -317,12 +317,6 @@
     "longDesc":  "Host name to forward mavlink to. i.e: localhost:14445",
     "type":             "string",
     "default":     "localhost:14445"
-},
-{
-    "name":         "useComponentInformationQuery",
-    "shortDesc":    "Use COMPONENT_INFORMATION query (beta)",
-    "type":         "bool",
-    "default":      false
 }
 ]
 }
diff --git a/src/Settings/AppSettings.cc b/src/Settings/AppSettings.cc
index 4a5915b..ec101e9 100644
--- a/src/Settings/AppSettings.cc
+++ b/src/Settings/AppSettings.cc
@@ -137,7 +137,6 @@ DECLARE_SETTINGSFACT(AppSettings, saveCsvTelemetry)
 DECLARE_SETTINGSFACT(AppSettings, firstRunPromptIdsShown)
 DECLARE_SETTINGSFACT(AppSettings, forwardMavlink)
 DECLARE_SETTINGSFACT(AppSettings, forwardMavlinkHostName)
-DECLARE_SETTINGSFACT(AppSettings, useComponentInformationQuery)
 
 DECLARE_SETTINGSFACT_NO_FUNC(AppSettings, indoorPalette)
 {
diff --git a/src/Settings/AppSettings.h b/src/Settings/AppSettings.h
index 8e22822..dcce3fd 100644
--- a/src/Settings/AppSettings.h
+++ b/src/Settings/AppSettings.h
@@ -64,7 +64,7 @@ public:
     DEFINE_SETTINGFACT(firstRunPromptIdsShown)
     DEFINE_SETTINGFACT(forwardMavlink)
     DEFINE_SETTINGFACT(forwardMavlinkHostName)
-    DEFINE_SETTINGFACT(useComponentInformationQuery)
+
 
     // Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side
     DEFINE_SETTINGFACT(apmStartMavlinkStreams)
diff --git a/src/Vehicle/ComponentInformationManager.cc b/src/Vehicle/ComponentInformationManager.cc
index 1cf221c..dbc7369 100644
--- a/src/Vehicle/ComponentInformationManager.cc
+++ b/src/Vehicle/ComponentInformationManager.cc
@@ -16,8 +16,6 @@
 #include "CompInfoParam.h"
 #include "QGCFileDownload.h"
 #include "QGCApplication.h"
-#include "SettingsManager.h"
-#include "AppSettings.h"
 
 #include <QStandardPaths>
 #include <QJsonDocument>
@@ -233,9 +231,6 @@ void RequestMetaDataTypeStateMachine::_stateRequestCompInfo(StateMachine* stateM
     if (weakLink.expired()) {
         qCDebug(ComponentInformationManagerLog) << QStringLiteral("_stateRequestCompInfo Skipping component information %1 request due to no primary link").arg(requestMachine->typeToString());
         stateMachine->advance();
-    } else if (!qgcApp()->toolbox()->settingsManager()->appSettings()->useComponentInformationQuery()->rawValue().toBool()) {
-        qCDebug(ComponentInformationManagerLog) << QStringLiteral("_stateRequestCompInfo Skipping component information %1 request due to application setting").arg(requestMachine->typeToString());
-        stateMachine->advance();
     } else {
         SharedLinkInterfacePtr sharedLink = weakLink.lock();
         if (sharedLink->linkConfiguration()->isHighLatency() || sharedLink->isPX4Flow() || sharedLink->isLogReplay()) {
diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml
index df660a9..c59d397 100644
--- a/src/ui/preferences/GeneralSettings.qml
+++ b/src/ui/preferences/GeneralSettings.qml
@@ -645,14 +645,6 @@ Rectangle {
                                         }
                                     }
                                 }
-
-                                FactCheckBox {
-                                    text:       _fact.shortDescription
-                                    fact:       _fact
-                                    visible:    _fact.visible
-
-                                    property Fact _fact: QGroundControl.settingsManager.appSettings.useComponentInformationQuery
-                                }
                             }
                         }