Make it possible to mark a plugin experimental but not disabledByDefault

For plugins that are shipped by Qt Creator, it makes sense to disable
experimental plugins by default. But for separately installed plugins it
is weird that you first have to download and install them, and then also
have to explicitly turn them on.

Use that for AppStatisticsMonitor in the case that it is built and
installed as a separate plugin.

Change-Id: I12e979d2e088dc32380c2e2ae83ed2b7ef9276b0
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2024-06-10 14:40:22 +02:00
parent 9a06e1f65c
commit e9fd7e5c2c
3 changed files with 6 additions and 3 deletions

View File

@@ -844,11 +844,9 @@ Utils::expected_str<void> PluginSpecPrivate::readMetaData(const QJsonObject &dat
value = metaData.value(QLatin1String(PLUGIN_DISABLED_BY_DEFAULT));
if (!value.isUndefined() && !value.isBool())
return reportError(msgValueIsNotABool(PLUGIN_DISABLED_BY_DEFAULT));
enabledByDefault = !value.toBool(false);
enabledByDefault = !value.toBool(experimental || deprecated);
qCDebug(pluginLog) << "enabledByDefault =" << enabledByDefault;
if (experimental || deprecated)
enabledByDefault = false;
enabledBySettings = enabledByDefault;
value = metaData.value(QLatin1String(PLUGIN_SOFTLOADABLE));

View File

@@ -3,6 +3,7 @@
"Version" : "${IDE_VERSION}",
"CompatVersion" : "${IDE_VERSION_COMPAT}",
"Experimental" : true,
"DisabledByDefault" : ${APPSTATISTICSMONITOR_DISABLEDBYDEFAULT},
"Vendor" : "The Qt Company Ltd",
"Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd",
"License" : [ "Commercial Usage",

View File

@@ -13,6 +13,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt6 COMPONENTS Charts QUIET)
set(APPSTATISTICSMONITOR_DISABLEDBYDEFAULT "true")
if (NOT QT_CREATOR_API_DEFINED)
# standalone build
set(DESTINATION DESTINATION .)
@@ -21,6 +23,8 @@ if (NOT QT_CREATOR_API_DEFINED)
qtc_handle_compiler_cache_support()
find_package(QtCreator COMPONENTS Core ProjectExplorer Utils REQUIRED)
set(APPSTATISTICSMONITOR_DISABLEDBYDEFAULT "false")
endif()