Reduce usage of app_version header

Most information is available via Q(Core|Gui)Application.
Add an AppInfo structure for the things that are not.

This avoids that the information ends up duplicated and
hardcoded in the plugins, which is not needed or desired.

Change-Id: I4d565e75c42a7b8facafa90c27096ea49359215d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2023-06-21 15:12:46 +02:00
parent 27302694ab
commit dff9e1463b
96 changed files with 375 additions and 384 deletions

View File

@@ -40,8 +40,6 @@
#include <qtsupport/qtcppkitinfo.h>
#include <qtsupport/qtkitinformation.h>
#include <app/app_version.h>
#include <utils/algorithm.h>
#include <utils/checkablemessagebox.h>
#include <utils/fileutils.h>

View File

@@ -10,8 +10,6 @@
#include "cmaketool.h"
#include "cmaketoolmanager.h"
#include <app/app_version.h>
#include <coreplugin/icore.h>
#include <ios/iosconstants.h>
@@ -41,6 +39,7 @@
#include <QDialog>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QGuiApplication>
#include <QLineEdit>
#include <QPlainTextEdit>
#include <QPointer>
@@ -739,8 +738,8 @@ Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const
}
if (!tool->hasFileApi()) {
addWarning(Tr::tr("The selected CMake binary does not support file-api. "
"%1 will not be able to parse CMake projects.")
.arg(Core::Constants::IDE_DISPLAY_NAME));
"%1 will not be able to parse CMake projects.")
.arg(QGuiApplication::applicationDisplayName()));
}
}

View File

@@ -12,7 +12,6 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "TextEditor" }
Depends { name: "QtSupport" }
Depends { name: "app_version_header" }
files: [
"builddirparameters.cpp",

View File

@@ -9,12 +9,11 @@
#include <coreplugin/icore.h>
#include <app/app_version.h>
#include <utils/algorithm.h>
#include <utils/environment.h>
#include <QDebug>
#include <QGuiApplication>
using namespace Utils;
@@ -132,7 +131,7 @@ mergeTools(std::vector<std::unique_ptr<CMakeTool>> &sdkTools,
CMakeToolSettingsAccessor::CMakeToolSettingsAccessor()
{
setDocType("QtCreatorCMakeTools");
setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME);
setApplicationDisplayName(QGuiApplication::applicationDisplayName());
setBaseFilePath(Core::ICore::userResourcePath(CMAKE_TOOL_FILENAME));
addVersionUpgrader(std::make_unique<CMakeToolSettingsUpgraderV0>());

View File

@@ -5,13 +5,13 @@
#include "cmakeprojectmanagertr.h"
#include <app/app_version.h>
#include <coreplugin/messagemanager.h>
#include <projectexplorer/rawprojectpart.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <QGuiApplication>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
@@ -42,10 +42,9 @@ static FilePath cmakeReplyDirectory(const FilePath &buildDirectory)
static void reportFileApiSetupFailure()
{
Core::MessageManager::writeFlashing(
Tr::tr("Failed to set up CMake file API support. %1 cannot "
"extract project information.")
.arg(Core::Constants::IDE_DISPLAY_NAME));
Core::MessageManager::writeFlashing(Tr::tr("Failed to set up CMake file API support. %1 cannot "
"extract project information.")
.arg(QGuiApplication::applicationDisplayName()));
}
static std::pair<int, int> cmakeVersion(const QJsonObject &obj)