diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-06-21 15:12:46 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-06-26 06:57:46 +0000 |
commit | dff9e1463bfebe803af0c696222b6eeb04857c26 (patch) | |
tree | 71a130bb73c65d88c0e87fdd06d0f06495c6670c /src/plugins | |
parent | 27302694ab794d8437b6feac4095ad34fa43ed24 (diff) |
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>
Diffstat (limited to 'src/plugins')
88 files changed, 310 insertions, 374 deletions
diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index c6d1611636..b187ed428f 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -15,7 +15,6 @@ Project { Depends { name: "QtSupport" } Depends { name: "TextEditor" } Depends { name: "Utils" } - Depends { name: "app_version_header" } files: [ "android_global.h", "androidtr.h", diff --git a/src/plugins/android/androidpotentialkit.cpp b/src/plugins/android/androidpotentialkit.cpp index 4d95f485d0..0529df10e1 100644 --- a/src/plugins/android/androidpotentialkit.cpp +++ b/src/plugins/android/androidpotentialkit.cpp @@ -6,8 +6,6 @@ #include "androidpotentialkit.h" #include "androidtr.h" -#include <app/app_version.h> - #include <coreplugin/coreicons.h> #include <coreplugin/icore.h> @@ -22,10 +20,10 @@ #include <utils/utilsicons.h> #include <QGridLayout> +#include <QGuiApplication> #include <QLabel> #include <QPushButton> - namespace Android::Internal { class AndroidPotentialKitWidget : public Utils::DetailsWidget @@ -83,7 +81,7 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent) auto label = new QLabel; label->setText(Tr::tr("%1 needs additional settings to enable Android support." " You can configure those settings in the Options dialog.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); label->setWordWrap(true); layout->addWidget(label, 0, 0, 1, 2); diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp index 45f991ca74..157f6f5afc 100644 --- a/src/plugins/android/androidrunconfiguration.cpp +++ b/src/plugins/android/androidrunconfiguration.cpp @@ -7,8 +7,6 @@ #include "androidtoolchain.h" #include "androidtr.h" -#include <app/app_version.h> - #include <projectexplorer/buildsystem.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/project.h> diff --git a/src/plugins/android/androidsdkmanagerwidget.cpp b/src/plugins/android/androidsdkmanagerwidget.cpp index 8627e0c64e..d228cd4602 100644 --- a/src/plugins/android/androidsdkmanagerwidget.cpp +++ b/src/plugins/android/androidsdkmanagerwidget.cpp @@ -7,8 +7,6 @@ #include "androidsdkmodel.h" #include "androidtr.h" -#include <app/app_version.h> - #include <utils/async.h> #include <utils/layoutbuilder.h> #include <utils/outputformatter.h> @@ -18,6 +16,7 @@ #include <QAbstractButton> #include <QDialogButtonBox> #include <QGridLayout> +#include <QGuiApplication> #include <QLabel> #include <QLineEdit> #include <QLoggingCategory> @@ -282,8 +281,8 @@ void AndroidSdkManagerWidget::installEssentials() Tr::tr("Android SDK Changes"), Tr::tr("%1 cannot find the following essential packages: \"%2\".\n" "Install them manually after the current operation is done.\n") - .arg(Core::Constants::IDE_DISPLAY_NAME) - .arg(m_sdkModel->missingEssentials().join("\", \""))); + .arg(QGuiApplication::applicationDisplayName(), + m_sdkModel->missingEssentials().join("\", \""))); } onApplyButton(Tr::tr("Android SDK installation is missing necessary packages. " "Do you want to install the missing packages?")); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 6c5edc0ec9..1ab8012d41 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -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> diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 54add7395f..d461f110c3 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -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())); } } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs index 3597a94871..a7ec261228 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs @@ -12,7 +12,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } files: [ "builddirparameters.cpp", diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 05969b492e..4b7a31e248 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -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>()); diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.cpp b/src/plugins/cmakeprojectmanager/fileapiparser.cpp index e4dca5c9b2..c64b921ede 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.cpp +++ b/src/plugins/cmakeprojectmanager/fileapiparser.cpp @@ -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) diff --git a/src/plugins/coco/CMakeLists.txt b/src/plugins/coco/CMakeLists.txt index 43f4fd7c4a..20e5132fff 100644 --- a/src/plugins/coco/CMakeLists.txt +++ b/src/plugins/coco/CMakeLists.txt @@ -1,5 +1,4 @@ add_qtc_plugin(Coco - PUBLIC_DEPENDS app_version PLUGIN_DEPENDS Core LanguageClient SOURCES cocolanguageclient.cpp cocolanguageclient.h diff --git a/src/plugins/coco/coco.qbs b/src/plugins/coco/coco.qbs index 3a771f2717..70a072c319 100644 --- a/src/plugins/coco/coco.qbs +++ b/src/plugins/coco/coco.qbs @@ -7,8 +7,6 @@ QtcPlugin { Depends { name: "LanguageClient" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } - Depends { name: "Qt"; submodules: ["widgets"] } files: [ diff --git a/src/plugins/coco/cocolanguageclient.cpp b/src/plugins/coco/cocolanguageclient.cpp index 56f3d20ee2..83089cb751 100644 --- a/src/plugins/coco/cocolanguageclient.cpp +++ b/src/plugins/coco/cocolanguageclient.cpp @@ -3,7 +3,6 @@ #include "cocolanguageclient.h" -#include <app/app_version.h> #include <coreplugin/editormanager/editormanager.h> #include <languageclient/diagnosticmanager.h> #include <languageclient/languageclienthoverhandler.h> @@ -17,6 +16,7 @@ #include <texteditor/textmark.h> #include <utils/utilsicons.h> +#include <QGuiApplication> #include <QTextEdit> using namespace LanguageClient; @@ -52,7 +52,7 @@ CocoLanguageClient::CocoLanguageClient(const FilePath &coco, const FilePath &csm ClientInfo info; info.setName("CocoQtCreator"); - info.setVersion(Core::Constants::IDE_VERSION_DISPLAY); + info.setVersion(QGuiApplication::applicationDisplayName()); setClientInfo(info); initClientCapabilities(); diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index b262d0d768..36c13206ee 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -5,7 +5,7 @@ configure_file(core_logo.qrc.cmakein core_logo_cmake.qrc) add_qtc_plugin(Core DEPENDS Qt::PrintSupport Qt::Qml Qt::Sql Qt::Gui Qt::GuiPrivate - PUBLIC_DEPENDS Aggregation ExtensionSystem Utils app_version + PUBLIC_DEPENDS Aggregation ExtensionSystem Utils SOURCES ${CMAKE_CURRENT_BINARY_DIR}/core_logo_cmake.qrc actionmanager/actioncontainer.cpp diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp index 7b69e3da91..f4abce0eaa 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp +++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp @@ -6,7 +6,6 @@ #include <coreplugin/dialogs/shortcutsettings.h> #include <coreplugin/icore.h> -#include <app/app_version.h> #include <utils/qtcassert.h> #include <utils/fileutils.h> diff --git a/src/plugins/coreplugin/corejsextensions.cpp b/src/plugins/coreplugin/corejsextensions.cpp index 52438f2d4a..cbbb71246e 100644 --- a/src/plugins/coreplugin/corejsextensions.cpp +++ b/src/plugins/coreplugin/corejsextensions.cpp @@ -3,8 +3,7 @@ #include "corejsextensions.h" -#include <app/app_version.h> - +#include <utils/appinfo.h> #include <utils/fileutils.h> #include <utils/mimeutils.h> #include <utils/qtcassert.h> @@ -27,7 +26,7 @@ QString UtilsJsExtension::qtVersion() const QString UtilsJsExtension::qtCreatorVersion() const { - return QLatin1String(Constants::IDE_VERSION_DISPLAY); + return appInfo().displayVersion; } QString UtilsJsExtension::toNativeSeparators(const QString &in) const diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 2d825dd3ae..2e07d1c4cd 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -23,7 +23,6 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/fileutils.h> -#include <app/app_version.h> #include <extensionsystem/pluginerroroverview.h> #include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginspec.h> @@ -43,6 +42,7 @@ #include <QDateTime> #include <QDebug> #include <QDir> +#include <QGuiApplication> #include <QJsonObject> #include <QLabel> #include <QMenu> @@ -191,18 +191,25 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) expander->registerVariable("Config:LastFileDialogDirectory", Tr::tr("The directory last visited in a file dialog."), [] { return DocumentManager::fileDialogLastVisitedDirectory().toString(); }); expander->registerVariable("HostOs:isWindows", - Tr::tr("Is %1 running on Windows?").arg(Constants::IDE_DISPLAY_NAME), - [] { return QVariant(Utils::HostOsInfo::isWindowsHost()).toString(); }); + Tr::tr("Is %1 running on Windows?") + .arg(QGuiApplication::applicationDisplayName()), + [] { + return QVariant(Utils::HostOsInfo::isWindowsHost()).toString(); + }); expander->registerVariable("HostOs:isOSX", - Tr::tr("Is %1 running on OS X?").arg(Constants::IDE_DISPLAY_NAME), + Tr::tr("Is %1 running on OS X?") + .arg(QGuiApplication::applicationDisplayName()), [] { return QVariant(Utils::HostOsInfo::isMacHost()).toString(); }); expander->registerVariable("HostOs:isLinux", - Tr::tr("Is %1 running on Linux?").arg(Constants::IDE_DISPLAY_NAME), + Tr::tr("Is %1 running on Linux?") + .arg(QGuiApplication::applicationDisplayName()), [] { return QVariant(Utils::HostOsInfo::isLinuxHost()).toString(); }); expander->registerVariable("HostOs:isUnix", Tr::tr("Is %1 running on any unix-based platform?") - .arg(Constants::IDE_DISPLAY_NAME), - [] { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); }); + .arg(QGuiApplication::applicationDisplayName()), + [] { + return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); + }); expander->registerVariable("HostOs:PathListSeparator", Tr::tr("The path list separator for the platform."), [] { return QString(Utils::HostOsInfo::pathListSeparator()); }); @@ -211,7 +218,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) [] { return QString(Utils::HostOsInfo::withExecutableSuffix("")); }); expander->registerVariable("IDE:ResourcePath", Tr::tr("The directory where %1 finds its pre-installed resources.") - .arg(Constants::IDE_DISPLAY_NAME), + .arg(QGuiApplication::applicationDisplayName()), [] { return ICore::resourcePath().toString(); }); expander->registerPrefix("CurrentDate:", Tr::tr("The current date (QDate formatstring)."), [](const QString &fmt) { return QDate::currentDate().toString(fmt); }); @@ -396,9 +403,9 @@ void CorePlugin::checkSettings() const QFileInfo fi(userSettings->fileName()); if (fi.exists() && !fi.isWritable()) { const QString errorMsg = Tr::tr("The settings file \"%1\" is not writable.\n" - "You will not be able to store any %2 settings.") - .arg(QDir::toNativeSeparators(userSettings->fileName()), - QLatin1String(Core::Constants::IDE_DISPLAY_NAME)); + "You will not be able to store any %2 settings.") + .arg(QDir::toNativeSeparators(userSettings->fileName()), + QGuiApplication::applicationDisplayName()); showMsgBox(errorMsg, QMessageBox::Warning); } return; @@ -410,10 +417,12 @@ void CorePlugin::checkSettings() errorDetails = Tr::tr("The file is invalid."); break; } - const QString errorMsg = Tr::tr("Error reading settings file \"%1\": %2\n" - "You will likely experience further problems using this instance of %3.") - .arg(QDir::toNativeSeparators(userSettings->fileName()), errorDetails, - QLatin1String(Core::Constants::IDE_DISPLAY_NAME)); + const QString errorMsg + = Tr::tr("Error reading settings file \"%1\": %2\n" + "You will likely experience further problems using this instance of %3.") + .arg(QDir::toNativeSeparators(userSettings->fileName()), + errorDetails, + QGuiApplication::applicationDisplayName()); showMsgBox(errorMsg, QMessageBox::Critical); } @@ -429,10 +438,11 @@ void CorePlugin::warnAboutCrashReporing() "To enable this feature go to %2."); if (Utils::HostOsInfo::isMacHost()) { - warnStr = warnStr.arg(QLatin1String(Core::Constants::IDE_DISPLAY_NAME), - Core::Constants::IDE_DISPLAY_NAME + Tr::tr(" > Preferences > Environment > System")); + warnStr = warnStr.arg(QGuiApplication::applicationDisplayName(), + QGuiApplication::applicationDisplayName() + + Tr::tr(" > Preferences > Environment > System")); } else { - warnStr = warnStr.arg(QLatin1String(Core::Constants::IDE_DISPLAY_NAME), + warnStr = warnStr.arg(QGuiApplication::applicationDisplayName(), Tr::tr("Edit > Preferences > Environment > System")); } @@ -459,15 +469,18 @@ void CorePlugin::warnAboutCrashReporing() QString CorePlugin::msgCrashpadInformation() { return Tr::tr("%1 uses Google Crashpad for collecting crashes and sending them to our backend " - "for processing. Crashpad may capture arbitrary contents from crashed process’ " - "memory, including user sensitive information, URLs, and whatever other content " - "users have trusted %1 with. The collected crash reports are however only used " - "for the sole purpose of fixing bugs.").arg(Core::Constants::IDE_DISPLAY_NAME) - + "<br><br>" + Tr::tr("More information:") - + "<br><a href='https://chromium.googlesource.com/crashpad/crashpad/+/master/doc/" - "overview_design.md'>" + Tr::tr("Crashpad Overview") + "</a>" - "<br><a href='https://sentry.io/security/'>" + Tr::tr("%1 security policy").arg("Sentry.io") - + "</a>"; + "for processing. Crashpad may capture arbitrary contents from crashed process’ " + "memory, including user sensitive information, URLs, and whatever other content " + "users have trusted %1 with. The collected crash reports are however only used " + "for the sole purpose of fixing bugs.") + .arg(QGuiApplication::applicationDisplayName()) + + "<br><br>" + Tr::tr("More information:") + + "<br><a href='https://chromium.googlesource.com/crashpad/crashpad/+/master/doc/" + "overview_design.md'>" + + Tr::tr("Crashpad Overview") + + "</a>" + "<br><a href='https://sentry.io/security/'>" + + Tr::tr("%1 security policy").arg("Sentry.io") + "</a>"; } ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown() diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 096076877f..61d1b21a90 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -19,8 +19,6 @@ Project { Depends { name: "Utils" } Depends { name: "Aggregation" } - Depends { name: "app_version_header" } - cpp.dynamicLibraries: { if (qbs.targetOS.contains("windows")) return ["ole32", "user32"] diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index e617e98d1c..09c7f4aa79 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -35,8 +35,6 @@ #include "../settingsdatabase.h" #include "../vcsmanager.h" -#include <app/app_version.h> - #include <extensionsystem/pluginmanager.h> #include <utils/algorithm.h> @@ -2161,7 +2159,7 @@ void EditorManagerPrivate::updateWindowTitleForDocument(IDocument *document, QWi if (!windowTitle.isEmpty()) windowTitle.append(dashSep); - windowTitle.append(Core::Constants::IDE_DISPLAY_NAME); + windowTitle.append(QGuiApplication::applicationDisplayName()); window->window()->setWindowTitle(windowTitle); window->window()->setWindowFilePath(filePath.path()); diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 6cafa6ff88..c65cfe8088 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -11,8 +11,6 @@ #include "documentmanager.h" #include "editormanager/editormanager.h" -#include <app/app_version.h> - #include <utils/algorithm.h> #include <utils/fileutils.h> #include <utils/macroexpander.h> diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 59224d48a5..8716e21858 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -7,11 +7,10 @@ #include "dialogs/settingsdialog.h" #include "windowsupport.h" -#include <app/app_version.h> - #include <extensionsystem/pluginmanager.h> #include <utils/algorithm.h> +#include <utils/appinfo.h> #include <utils/environment.h> #include <utils/fileutils.h> #include <utils/qtcassert.h> @@ -440,7 +439,7 @@ FilePath ICore::userResourcePath(const QString &rel) { // Create qtcreator dir if it doesn't yet exist const QString configDir = QFileInfo(settings(QSettings::UserScope)->fileName()).path(); - const QString urp = configDir + '/' + QLatin1String(Constants::IDE_ID); + const QString urp = configDir + '/' + appInfo().id; if (!QFileInfo::exists(urp + QLatin1Char('/'))) { QDir dir; @@ -467,7 +466,7 @@ FilePath ICore::cacheResourcePath(const QString &rel) FilePath ICore::installerResourcePath(const QString &rel) { return FilePath::fromString(settings(QSettings::SystemScope)->fileName()).parentDir() - / Constants::IDE_ID / rel; + / appInfo().id / rel; } /*! @@ -487,15 +486,18 @@ QString ICore::pluginPath() */ QString ICore::userPluginPath() { + const QVersionNumber appVersion = QVersionNumber::fromString( + QCoreApplication::applicationVersion()); QString pluginPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost()) pluginPath += "/data"; - pluginPath += '/' + QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR) + '/'; - pluginPath += QLatin1String(Utils::HostOsInfo::isMacHost() ? Core::Constants::IDE_DISPLAY_NAME - : Core::Constants::IDE_ID); + pluginPath += '/' + QCoreApplication::organizationName() + '/'; + pluginPath += Utils::HostOsInfo::isMacHost() ? QGuiApplication::applicationDisplayName() + : appInfo().id; pluginPath += "/plugins/"; - pluginPath += QString::number(IDE_VERSION_MAJOR) + '.' + QString::number(IDE_VERSION_MINOR) - + '.' + QString::number(IDE_VERSION_RELEASE); + pluginPath += QString::number(appVersion.majorVersion()) + '.' + + QString::number(appVersion.minorVersion()) + '.' + + QString::number(appVersion.microVersion()); return pluginPath; } @@ -518,11 +520,6 @@ FilePath ICore::crashReportsPath() return libexecPath("crashpad_reports/reports"); } -QString ICore::ideDisplayName() -{ - return Constants::IDE_DISPLAY_NAME; -} - static QString clangIncludePath(const QString &clangVersion) { return "/lib/clang/" + clangVersion + "/include"; @@ -619,10 +616,10 @@ static QString compilerString() QString ICore::versionString() { QString ideVersionDescription; - if (QLatin1String(Constants::IDE_VERSION_LONG) != QLatin1String(Constants::IDE_VERSION_DISPLAY)) - ideVersionDescription = Tr::tr(" (%1)").arg(QLatin1String(Constants::IDE_VERSION_LONG)); - return Tr::tr("%1 %2%3").arg(QLatin1String(Constants::IDE_DISPLAY_NAME), - QLatin1String(Constants::IDE_VERSION_DISPLAY), + if (QCoreApplication::applicationVersion() != appInfo().displayVersion) + ideVersionDescription = Tr::tr(" (%1)").arg(QCoreApplication::applicationVersion()); + return Tr::tr("%1 %2%3").arg(QGuiApplication::applicationDisplayName(), + appInfo().displayVersion, ideVersionDescription); } diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 1ecf606853..0939356d4d 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -80,8 +80,6 @@ public: static Utils::FilePath libexecPath(const QString &rel = {}); static Utils::FilePath crashReportsPath(); - static QString ideDisplayName(); - static QString versionString(); static QMainWindow *mainWindow(); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 846b5d9dea..807070b383 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -47,8 +47,6 @@ #include "versiondialog.h" #include "windowsupport.h" -#include <app/app_version.h> - #include <extensionsystem/pluginmanager.h> #include <utils/algorithm.h> @@ -126,7 +124,7 @@ MainWindow::MainWindow() , m_lowPrioAdditionalContexts(Constants::C_GLOBAL) , m_settingsDatabase( new SettingsDatabase(QFileInfo(PluginManager::settings()->fileName()).path(), - QLatin1String(Constants::IDE_CASED_ID), + QCoreApplication::applicationName(), this)) , m_progressManager(new ProgressManagerPrivate) , m_jsExpander(JsExpander::createGlobalJsExpander()) @@ -145,7 +143,7 @@ MainWindow::MainWindow() HistoryCompleter::setSettings(PluginManager::settings()); - setWindowTitle(Constants::IDE_DISPLAY_NAME); + setWindowTitle(QGuiApplication::applicationDisplayName()); if (HostOsInfo::isLinuxHost()) QApplication::setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); QString baseName = QApplication::style()->objectName(); @@ -384,13 +382,13 @@ void MainWindow::closeEvent(QCloseEvent *event) return; } - if (m_askConfirmationBeforeExit && - (QMessageBox::question(this, - Tr::tr("Exit %1?").arg(Constants::IDE_DISPLAY_NAME), - Tr::tr("Exit %1?").arg(Constants::IDE_DISPLAY_NAME), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No) - == QMessageBox::No)) { + if (m_askConfirmationBeforeExit + && (QMessageBox::question(this, + Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), + Tr::tr("Exit %1?").arg(QGuiApplication::applicationDisplayName()), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No) + == QMessageBox::No)) { event->ignore(); return; } @@ -762,7 +760,7 @@ void MainWindow::registerDefaultActions() // Debug Qt Creator menu mtools->appendGroup(Constants::G_TOOLS_DEBUG); ActionContainer *mtoolsdebug = ActionManager::createMenu(Constants::M_TOOLS_DEBUG); - mtoolsdebug->menu()->setTitle(Tr::tr("Debug %1").arg(Constants::IDE_DISPLAY_NAME)); + mtoolsdebug->menu()->setTitle(Tr::tr("Debug %1").arg(QGuiApplication::applicationDisplayName())); mtools->addMenu(mtoolsdebug, Constants::G_TOOLS_DEBUG); m_loggerAction = new QAction(Tr::tr("Show Logs..."), this); @@ -867,9 +865,14 @@ void MainWindow::registerDefaultActions() // About IDE Action icon = QIcon::fromTheme(QLatin1String("help-about")); if (HostOsInfo::isMacHost()) - tmpaction = new QAction(icon, Tr::tr("About &%1").arg(Constants::IDE_DISPLAY_NAME), this); // it's convention not to add dots to the about menu + tmpaction = new QAction(icon, + Tr::tr("About &%1").arg(QGuiApplication::applicationDisplayName()), + this); // it's convention not to add dots to the about menu else - tmpaction = new QAction(icon, Tr::tr("About &%1...").arg(Constants::IDE_DISPLAY_NAME), this); + tmpaction + = new QAction(icon, + Tr::tr("About &%1...").arg(QGuiApplication::applicationDisplayName()), + this); tmpaction->setMenuRole(QAction::AboutRole); cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp index 24d8c8dff1..c7f7dab231 100644 --- a/src/plugins/coreplugin/plugindialog.cpp +++ b/src/plugins/coreplugin/plugindialog.cpp @@ -8,8 +8,6 @@ #include "icore.h" #include "plugininstallwizard.h" -#include <app/app_version.h> - #include <extensionsystem/plugindetailsview.h> #include <extensionsystem/pluginerrorview.h> #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index 11bad10ca4..9aa067a45c 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -23,11 +23,10 @@ #include <utils/wizard.h> #include <utils/wizardpage.h> -#include <app/app_version.h> - #include <QButtonGroup> #include <QDir> #include <QDirIterator> +#include <QGuiApplication> #include <QLabel> #include <QMessageBox> #include <QPushButton> @@ -164,14 +163,16 @@ void checkContents(QPromise<ArchiveIssue> &promise, const FilePath &tempDir) return; if (coreplugin->provides(found->name, found->version)) return; - promise.addResult(ArchiveIssue{ - Tr::tr("Plugin requires an incompatible version of %1 (%2).") - .arg(Constants::IDE_DISPLAY_NAME).arg(found->version), InfoLabel::Error}); + promise.addResult( + ArchiveIssue{Tr::tr("Plugin requires an incompatible version of %1 (%2).") + .arg(QGuiApplication::applicationDisplayName(), found->version), + InfoLabel::Error}); return; // successful / no error } } - promise.addResult(ArchiveIssue{Tr::tr("Did not find %1 plugin.") - .arg(Constants::IDE_DISPLAY_NAME), InfoLabel::Error}); + promise.addResult( + ArchiveIssue{Tr::tr("Did not find %1 plugin.").arg(QGuiApplication::applicationDisplayName()), + InfoLabel::Error}); } class CheckArchivePage : public WizardPage @@ -306,17 +307,16 @@ public: localInstall->setChecked(!m_data->installIntoApplication); auto localLabel = new QLabel(Tr::tr("The plugin will be available to all compatible %1 " "installations, but only for the current user.") - .arg(Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); localLabel->setWordWrap(true); localLabel->setAttribute(Qt::WA_MacSmallSize, true); auto appInstall = new QRadioButton( - Tr::tr("%1 installation").arg(Constants::IDE_DISPLAY_NAME)); + Tr::tr("%1 installation").arg(QGuiApplication::applicationDisplayName())); appInstall->setChecked(m_data->installIntoApplication); - auto appLabel = new QLabel( - Tr::tr("The plugin will be available only to this %1 " - "installation, but for all users that can access it.") - .arg(Constants::IDE_DISPLAY_NAME)); + auto appLabel = new QLabel(Tr::tr("The plugin will be available only to this %1 " + "installation, but for all users that can access it.") + .arg(QGuiApplication::applicationDisplayName())); appLabel->setWordWrap(true); appLabel->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index f6641bad08..af34c668cf 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -15,8 +15,6 @@ #include "patchtool.h" #include "vcsmanager.h" -#include <app/app_version.h> - #include <utils/algorithm.h> #include <utils/checkablemessagebox.h> #include <utils/elidinglabel.h> @@ -31,6 +29,7 @@ #include <QCheckBox> #include <QComboBox> #include <QCoreApplication> +#include <QGuiApplication> #include <QLineEdit> #include <QMessageBox> #include <QPushButton> @@ -214,10 +213,10 @@ public: m_patchChooser->setFilePath(PatchTool::patchCommand()); m_autoSaveCheckBox->setChecked(EditorManagerPrivate::autoSaveEnabled()); m_autoSaveCheckBox->setToolTip(Tr::tr("Automatically creates temporary copies of " - "modified files. If %1 is restarted after " - "a crash or power failure, it asks whether to " - "recover the auto-saved content.") - .arg(Constants::IDE_DISPLAY_NAME)); + "modified files. If %1 is restarted after " + "a crash or power failure, it asks whether to " + "recover the auto-saved content.") + .arg(QGuiApplication::applicationDisplayName())); m_autoSaveRefactoringCheckBox->setChecked(EditorManager::autoSaveAfterRefactoring()); m_autoSaveRefactoringCheckBox->setToolTip( Tr::tr("Automatically saves all open files " diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 2846be849a..8c0e70186d 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -8,15 +8,15 @@ #include "coreicons.h" #include "icore.h" -#include <app/app_version.h> - #include <utils/algorithm.h> +#include <utils/appinfo.h> #include <utils/hostosinfo.h> #include <utils/qtcassert.h> #include <utils/utilsicons.h> #include <QDialogButtonBox> #include <QGridLayout> +#include <QGuiApplication> #include <QKeyEvent> #include <QLabel> #include <QPushButton> @@ -32,17 +32,18 @@ VersionDialog::VersionDialog(QWidget *parent) if (Utils::HostOsInfo::isLinuxHost()) setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); - setWindowTitle(Tr::tr("About %1").arg(Core::Constants::IDE_DISPLAY_NAME)); + setWindowTitle(Tr::tr("About %1").arg(QGuiApplication::applicationDisplayName())); auto layout = new QGridLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); + const Utils::AppInfo appInfo = Utils::appInfo(); QString ideRev; #ifdef IDE_REVISION - const QString revUrl = QString::fromLatin1(Constants::IDE_REVISION_URL); - const QString rev = QString::fromLatin1(Constants::IDE_REVISION_STR); ideRev = Tr::tr("<br/>From revision %1<br/>") - .arg(revUrl.isEmpty() ? rev - : QString::fromLatin1("<a href=\"%1\">%2</a>").arg(revUrl, rev)); + .arg(appInfo.revisionUrl.isEmpty() + ? appInfo.revision + : QString::fromLatin1("<a href=\"%1\">%2</a>") + .arg(appInfo.revisionUrl, appInfo.revision)); #endif QString buildDateInfo; #ifdef QTC_SHOW_BUILD_DATE @@ -56,27 +57,27 @@ VersionDialog::VersionDialog(QWidget *parent) const QString description = Tr::tr("<h3>%1</h3>" - "%2<br/>" - "%3" - "%4" - "%5" - "<br/>" - "Copyright 2008-%6 %7. All rights reserved.<br/>" - "<br/>" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.<br/>") + "%2<br/>" + "%3" + "%4" + "%5" + "<br/>" + "Copyright 2008-%6 %7. All rights reserved.<br/>" + "<br/>" + "The program is provided AS IS with NO WARRANTY OF ANY KIND, " + "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " + "PARTICULAR PURPOSE.<br/>") .arg(ICore::versionString(), ICore::buildCompatibilityString(), buildDateInfo, ideRev, additionalInfo.isEmpty() ? QString() : br + additionalInfo + br, - QLatin1String(Constants::IDE_YEAR), - QLatin1String(Constants::IDE_AUTHOR)) + appInfo.year, + appInfo.author) + "<br/>" + Tr::tr("The Qt logo as well as Qt®, Qt Quick®, Built with Qt®, Boot to Qt®, " - "Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® and Qt Embedded® are " - "registered trademarks of The Qt Company Ltd."); + "Qt Quick Compiler®, Qt Enterprise®, Qt Mobile® and Qt Embedded® are " + "registered trademarks of The Qt Company Ltd."); QLabel *copyRightLabel = new QLabel(description); copyRightLabel->setWordWrap(true); diff --git a/src/plugins/coreplugin/windowsupport.cpp b/src/plugins/coreplugin/windowsupport.cpp index 220df7fe5b..4cbfb57d03 100644 --- a/src/plugins/coreplugin/windowsupport.cpp +++ b/src/plugins/coreplugin/windowsupport.cpp @@ -10,14 +10,13 @@ #include "coreplugintr.h" #include "icore.h" -#include <app/app_version.h> - #include <utils/hostosinfo.h> #include <utils/qtcassert.h> #include <utils/stringutils.h> #include <QAction> #include <QEvent> +#include <QGuiApplication> #include <QMenu> #include <QWidget> #include <QWindowStateChangeEvent> @@ -188,7 +187,7 @@ void WindowList::updateTitle(QWidget *window) QTC_ASSERT(index >= 0, return); QTC_ASSERT(index < m_windowActions.size(), return); QString title = window->windowTitle(); - if (title.endsWith(QStringLiteral("- ") + Constants::IDE_DISPLAY_NAME)) + if (title.endsWith(QStringLiteral("- ") + QGuiApplication::applicationDisplayName())) title.chop(12); m_windowActions.at(index)->setText(Utils::quoteAmpersands(title.trimmed())); } diff --git a/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp b/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp index efcbd51569..4cc69fe439 100644 --- a/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp +++ b/src/plugins/cppeditor/cppbuiltinmodelmanagersupport.cpp @@ -13,7 +13,6 @@ #include "cpptoolsreuse.h" #include "symbolfinder.h" -#include <app/app_version.h> #include <coreplugin/messagemanager.h> #include <texteditor/basehoverhandler.h> #include <utils/qtcassert.h> diff --git a/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp b/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp index 2a6dfb6e1e..e2c879b183 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordumper.cpp @@ -8,7 +8,6 @@ #include "cpptoolsreuse.h" #include "cppworkingcopy.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <projectexplorer/projectmacro.h> #include <projectexplorer/project.h> diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs index b7d2aea031..4e36279580 100644 --- a/src/plugins/cppeditor/cppeditor.qbs +++ b/src/plugins/cppeditor/cppeditor.qbs @@ -13,8 +13,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } - Depends { name: "app_version_header" } - pluginTestDepends: [ "QmakeProjectManager", "QbsProjectManager", diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 21411577d3..6b9bad8c9c 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -6,7 +6,6 @@ #include "cppeditorplugin.h" #include "cppeditortr.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <projectexplorer/project.h> @@ -20,6 +19,7 @@ #include <QComboBox> #include <QCoreApplication> #include <QFile> +#include <QGuiApplication> #include <QLineEdit> #include <QLocale> #include <QSettings> @@ -435,7 +435,8 @@ void CppFileSettingsWidget::slotEdit() if (path.isEmpty()) return; FileSaver saver(path, QIODevice::Text); - saver.write(Tr::tr(licenseTemplateTemplate).arg(Core::Constants::IDE_DISPLAY_NAME).toUtf8()); + saver.write( + Tr::tr(licenseTemplateTemplate).arg(QGuiApplication::applicationDisplayName()).toUtf8()); if (!saver.finalize(this)) return; setLicenseTemplatePath(path); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index bb750f4753..b049d76f97 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -7,8 +7,6 @@ #include "cdbparsehelpers.h" #include "stringinputstream.h" -#include <app/app_version.h> - #include <debugger/breakhandler.h> #include <debugger/debuggeractions.h> #include <debugger/debuggercore.h> @@ -56,6 +54,7 @@ #include <cppeditor/cppworkingcopy.h> #include <QDir> +#include <QGuiApplication> #include <QRegularExpression> #include <cctype> @@ -333,16 +332,16 @@ void CdbEngine::setupEngine() const QFileInfo extensionFi(CdbEngine::extensionLibraryName(cdbIs64Bit, cdbIsArm)); if (!extensionFi.isFile()) { handleSetupFailure(Tr::tr("Internal error: The extension %1 cannot be found.\n" - "If you have updated %2 via Maintenance Tool, you may " - "need to rerun the Tool and select \"Add or remove components\" " - "and then select the " - "Qt > Tools > Qt Creator CDB Debugger Support component.\n" - "If you build %2 from sources and want to use a CDB executable " - "with another bitness than your %2 build, " - "you will need to build a separate CDB extension with the " - "same bitness as the CDB you want to use."). - arg(QDir::toNativeSeparators(extensionFi.absoluteFilePath()), - QString(Core::Constants::IDE_DISPLAY_NAME))); + "If you have updated %2 via Maintenance Tool, you may " + "need to rerun the Tool and select \"Add or remove components\" " + "and then select the " + "Qt > Tools > Qt Creator CDB Debugger Support component.\n" + "If you build %2 from sources and want to use a CDB executable " + "with another bitness than your %2 build, " + "you will need to build a separate CDB extension with the " + "same bitness as the CDB you want to use.") + .arg(QDir::toNativeSeparators(extensionFi.absoluteFilePath()), + QGuiApplication::applicationDisplayName())); return; } diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 1cc48186b6..1d6bb5022e 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -17,7 +17,6 @@ Project { Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } pluginTestDepends: [ "QmakeProjectManager" diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index afa7dd1459..f83c693581 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -12,8 +12,6 @@ #include "registerpostmortemaction.h" #endif -#include <app/app_version.h> - #include <coreplugin/coreconstants.h> #include <coreplugin/icore.h> @@ -21,6 +19,7 @@ #include <utils/qtcassert.h> #include <QDebug> +#include <QGuiApplication> using namespace Utils; @@ -267,7 +266,7 @@ DebuggerSettings::DebuggerSettings() raiseOnInterrupt.setSettingsKey(debugModeGroup, "RaiseOnInterrupt"); raiseOnInterrupt.setDefaultValue(true); raiseOnInterrupt.setLabelText(Tr::tr("Bring %1 to foreground when application interrupts") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); autoQuit.setSettingsKey(debugModeGroup, "AutoQuit"); autoQuit.setLabelText(Tr::tr("Automatically Quit Debugger")); @@ -318,12 +317,10 @@ DebuggerSettings::DebuggerSettings() #ifdef Q_OS_WIN registerForPostMortem = new RegisterPostMortemAction; registerForPostMortem->setSettingsKey(debugModeGroup, "RegisterForPostMortem"); - registerForPostMortem->setToolTip( - Tr::tr("Registers %1 for debugging crashed applications.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + registerForPostMortem->setToolTip(Tr::tr("Registers %1 for debugging crashed applications.") + .arg(QGuiApplication::applicationDisplayName())); registerForPostMortem->setLabelText( - Tr::tr("Use %1 for post-mortem debugging") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + Tr::tr("Use %1 for post-mortem debugging").arg(QGuiApplication::applicationDisplayName())); #else // Some dummy. registerForPostMortem = new BoolAspect; diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index c382e91c17..9ddd7fa6f7 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -7,8 +7,6 @@ #include "debuggerruncontrol.h" #include "debuggertr.h" -#include <app/app_version.h> - #include <coreplugin/icore.h> #include <projectexplorer/devicesupport/sshparameters.h> @@ -30,6 +28,7 @@ #include <QDir> #include <QFormLayout> #include <QGroupBox> +#include <QGuiApplication> #include <QLabel> #include <QPlainTextEdit> #include <QPushButton> @@ -563,15 +562,18 @@ static QString cdbRemoteHelp() const QString ext32 = QDir::toNativeSeparators(CdbEngine::extensionLibraryName(false)); const QString ext64 = QDir::toNativeSeparators(CdbEngine::extensionLibraryName(true)); - return Tr::tr( - "<html><body><p>The remote CDB needs to load the matching %1 CDB extension " - "(<code>%2</code> or <code>%3</code>, respectively).</p><p>Copy it onto the remote machine and set the " - "environment variable <code>%4</code> to point to its folder.</p><p>" - "Launch the remote CDB as <code>%5 <executable></code> " - "to use TCP/IP as communication protocol.</p><p>Enter the connection parameters as:</p>" - "<pre>%6</pre></body></html>") - .arg(QString(Core::Constants::IDE_DISPLAY_NAME), - ext32, ext64, QString("_NT_DEBUGGER_EXTENSION_PATH"), + return Tr:: + tr("<html><body><p>The remote CDB needs to load the matching %1 CDB extension " + "(<code>%2</code> or <code>%3</code>, respectively).</p><p>Copy it onto the remote " + "machine and set the " + "environment variable <code>%4</code> to point to its folder.</p><p>" + "Launch the remote CDB as <code>%5 <executable></code> " + "to use TCP/IP as communication protocol.</p><p>Enter the connection parameters as:</p>" + "<pre>%6</pre></body></html>") + .arg(QGuiApplication::applicationDisplayName(), + ext32, + ext64, + QString("_NT_DEBUGGER_EXTENSION_PATH"), QString("cdb.exe -server tcp:port=1234"), QString(cdbConnectionSyntax)); } diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 4aa0f1b33c..14dfbdfac3 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -31,8 +31,6 @@ #include "analyzer/analyzerconstants.h" #include "analyzer/analyzermanager.h" -#include <app/app_version.h> - #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -1671,10 +1669,11 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, const bool isWindows = (tcAbi.os() == Abi::WindowsOS); if (isWindows && isWinProcessBeingDebugged(processInfo.processId)) { AsynchronousMessageBox::warning( - Tr::tr("Process Already Under Debugger Control"), - Tr::tr("The process %1 is already under the control of a debugger.\n" - "%2 cannot attach to it.").arg(processInfo.processId) - .arg(Core::Constants::IDE_DISPLAY_NAME)); + Tr::tr("Process Already Under Debugger Control"), + Tr::tr("The process %1 is already under the control of a debugger.\n" + "%2 cannot attach to it.") + .arg(processInfo.processId) + .arg(QGuiApplication::applicationDisplayName())); return nullptr; } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index d52e2bc710..910372f193 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -34,7 +34,6 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/taskhub.h> -#include <app/app_version.h> #include <utils/algorithm.h> #include <utils/environment.h> #include <utils/hostosinfo.h> @@ -45,11 +44,12 @@ #include <utils/temporaryfile.h> #include <QDirIterator> +#include <QGuiApplication> +#include <QJsonArray> #include <QMessageBox> #include <QProcess> #include <QPushButton> #include <QRegularExpression> -#include <QJsonArray> using namespace Core; using namespace ProjectExplorer; @@ -1499,11 +1499,12 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response) int pythonMajor = m_pythonVersion / 10000; int pythonMinor = (m_pythonVersion / 100) % 100; QString out = "<p>" - + Tr::tr("The selected build of GDB supports Python scripting, " - "but the used version %1.%2 is not sufficient for " - "%3. Supported versions are Python 2.7 and 3.x.") - .arg(pythonMajor).arg(pythonMinor) - .arg(Core::Constants::IDE_DISPLAY_NAME); + + Tr::tr("The selected build of GDB supports Python scripting, " + "but the used version %1.%2 is not sufficient for " + "%3. Supported versions are Python 2.7 and 3.x.") + .arg(pythonMajor) + .arg(pythonMinor) + .arg(QGuiApplication::applicationDisplayName()); showStatusMessage(out); AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out); } @@ -1516,7 +1517,7 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response) if (msg.contains("Python scripting is not supported in this copy of GDB.")) { QString out1 = "The selected build of GDB does not support Python scripting."; QString out2 = QStringLiteral("It cannot be used in %1.") - .arg(Core::Constants::IDE_DISPLAY_NAME); + .arg(QGuiApplication::applicationDisplayName()); showStatusMessage(out1 + ' ' + out2); AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out1 + "<br>" + out2); } diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index a8b519aad0..3ff32f9df5 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -12,19 +12,18 @@ #include <QDebug> #include <QTime> +#include <QFileDialog> +#include <QGuiApplication> #include <QHBoxLayout> #include <QLabel> #include <QMenu> -#include <QSyntaxHighlighter> #include <QPlainTextEdit> #include <QPushButton> -#include <QFileDialog> +#include <QSyntaxHighlighter> #include <QToolButton> #include <aggregation/aggregate.h> -#include <app/app_version.h> - #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/findplaceholder.h> #include <coreplugin/minisplitter.h> @@ -438,17 +437,19 @@ LogWindow::LogWindow(DebuggerEngine *engine) setMinimumHeight(60); - showOutput(LogWarning, - Tr::tr("Note: This log contains possibly confidential information about your machine, " - "environment variables, in-memory data of the processes you are debugging, and more. " - "It is never transferred over the internet by %1, and only stored " - "to disk if you manually use the respective option from the context menu, or through " - "mechanisms that are not under the control of %1's Debugger plugin, " - "for instance in swap files, or other plugins you might use.\n" - "You may be asked to share the contents of this log when reporting bugs related " - "to debugger operation. In this case, make sure your submission does not " - "contain data you do not want to or you are not allowed to share.\n\n") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + showOutput( + LogWarning, + Tr::tr( + "Note: This log contains possibly confidential information about your machine, " + "environment variables, in-memory data of the processes you are debugging, and more. " + "It is never transferred over the internet by %1, and only stored " + "to disk if you manually use the respective option from the context menu, or through " + "mechanisms that are not under the control of %1's Debugger plugin, " + "for instance in swap files, or other plugins you might use.\n" + "You may be asked to share the contents of this log when reporting bugs related " + "to debugger operation. In this case, make sure your submission does not " + "contain data you do not want to or you are not allowed to share.\n\n") + .arg(QGuiApplication::applicationDisplayName())); } LogWindow::~LogWindow() diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index f8b010e276..65d49055cb 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -4,10 +4,8 @@ #include "procinterrupt.h" #include "debuggerconstants.h" -#include <app/app_version.h> - -#include <QCoreApplication> #include <QDir> +#include <QGuiApplication> #include <QProcess> // makes kill visible on Windows. using namespace Debugger::Internal; @@ -128,7 +126,7 @@ GDB 32bit | Api | Api | NA | Win32 "on your own, checkout " "https://code.qt.io/cgit/qt-creator/binary-artifacts.git/.") .arg(QDir::toNativeSeparators(executable), - QString(Core::Constants::IDE_DISPLAY_NAME)); + QGuiApplication::applicationDisplayName()); break; } switch (QProcess::execute(executable, QStringList(QString::number(pID)))) { diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 6c7962088a..f1724f2979 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -36,8 +36,6 @@ #include <texteditor/textdocument.h> #include <texteditor/texteditor.h> -#include <app/app_version.h> - #include <utils/basetreeview.h> #include <utils/fileinprojectfinder.h> #include <utils/process.h> @@ -48,6 +46,7 @@ #include <QDir> #include <QDockWidget> #include <QFileInfo> +#include <QGuiApplication> #include <QHostAddress> #include <QJsonArray> #include <QJsonDocument> @@ -386,7 +385,7 @@ void QmlEngine::connectionStartupFailed() auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); - infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); + infoBox->setWindowTitle(QGuiApplication::applicationDisplayName()); infoBox->setText(Tr::tr("Could not connect to the in-process QML debugger." "\nDo you want to retry?")); infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel | @@ -407,7 +406,7 @@ void QmlEngine::appStartupFailed(const QString &errorMessage) if (companionEngine()) { auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); - infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); + infoBox->setWindowTitle(QGuiApplication::applicationDisplayName()); infoBox->setText(error); infoBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Help); infoBox->setDefaultButton(QMessageBox::Ok); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 45a3277f70..f0ece852f4 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -28,7 +28,6 @@ #include <texteditor/syntaxhighlighter.h> -#include <app/app_version.h> #include <utils/algorithm.h> #include <utils/basetreeview.h> #include <utils/checkablemessagebox.h> @@ -269,7 +268,7 @@ public: this, &SeparatedView::tabBarContextMenuRequested); tabBar()->setContextMenuPolicy(Qt::CustomContextMenu); setWindowFlags(windowFlags() | Qt::Window); - setWindowTitle(Tr::tr("Debugger - %1").arg(Core::Constants::IDE_DISPLAY_NAME)); + setWindowTitle(Tr::tr("Debugger - %1").arg(QGuiApplication::applicationDisplayName())); QVariant geometry = SessionManager::value("DebuggerSeparateWidgetGeometry"); if (geometry.isValid()) { diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.qbs b/src/plugins/genericprojectmanager/genericprojectmanager.qbs index db678bd9dc..5ce959e9a6 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.qbs +++ b/src/plugins/genericprojectmanager/genericprojectmanager.qbs @@ -11,7 +11,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } pluginRecommends: [ "CppEditor" diff --git a/src/plugins/genericprojectmanager/genericprojectwizard.cpp b/src/plugins/genericprojectmanager/genericprojectwizard.cpp index 1f125ff321..314c850b0d 100644 --- a/src/plugins/genericprojectmanager/genericprojectwizard.cpp +++ b/src/plugins/genericprojectmanager/genericprojectwizard.cpp @@ -12,7 +12,6 @@ #include <projectexplorer/projectexplorericons.h> #include <projectexplorer/customwizard/customwizard.h> -#include <app/app_version.h> #include <utils/algorithm.h> #include <utils/fileutils.h> #include <utils/filewizardpage.h> @@ -97,9 +96,10 @@ GenericProjectWizard::GenericProjectWizard() setIcon(ProjectExplorer::Icons::WIZARD_IMPORT_AS_PROJECT.icon()); setDisplayName(Tr::tr("Import Existing Project")); setId("Z.Makefile"); - setDescription(Tr::tr("Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools. " - "This allows you to use %1 as a code editor.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + setDescription( + Tr::tr("Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools. " + "This allows you to use %1 as a code editor.") + .arg(QGuiApplication::applicationDisplayName())); setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY)); setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); setFlags(Core::IWizardFactory::PlatformIndependent); diff --git a/src/plugins/help/help.qbs b/src/plugins/help/help.qbs index d96cfa154e..a5eefb620d 100644 --- a/src/plugins/help/help.qbs +++ b/src/plugins/help/help.qbs @@ -16,8 +16,6 @@ Project { Depends { name: "Core" } Depends { name: "ProjectExplorer" } - Depends { name: "app_version_header" } - Depends { name: "qlitehtml"; required: false } cpp.defines: { diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 9ad9052867..a3c31c5c6b 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -20,8 +20,6 @@ #include "searchtaskhandler.h" #include "topicchooser.h" -#include <app/app_version.h> - #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -568,7 +566,7 @@ HelpViewer *HelpPluginPrivate::showHelpUrl(const QUrl &url, Core::HelpManager::H // QtHelp doesn't know about versions, add the version number and use that QUrl versioned = url; versioned.setHost(qtcreatorUnversionedID + "." - + QString::fromLatin1(Core::Constants::IDE_VERSION_LONG).remove('.')); + + QCoreApplication::applicationVersion().remove('.')); return showHelpUrl(versioned, location); } diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp index f397a5db12..e8be2bfbe3 100644 --- a/src/plugins/help/localhelpmanager.cpp +++ b/src/plugins/help/localhelpmanager.cpp @@ -21,10 +21,10 @@ #include "macwebkithelpviewer.h" #endif -#include <app/app_version.h> #include <coreplugin/icore.h> #include <utils/algorithm.h> +#include <utils/appinfo.h> #include <utils/environment.h> #include <utils/hostosinfo.h> #include <utils/qtcassert.h> @@ -35,6 +35,7 @@ #include <QHelpEngine> #include <QHelpLink> #include <QMutexLocker> +#include <QVersionNumber> #include <optional> @@ -113,9 +114,12 @@ LocalHelpManager *LocalHelpManager::instance() QString LocalHelpManager::defaultHomePage() { + const auto version = QVersionNumber::fromString(QCoreApplication::applicationVersion()); static const QString url = QString::fromLatin1("qthelp://org.qt-project.qtcreator." - "%1%2%3/doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR) - .arg(IDE_VERSION_RELEASE); + "%1%2%3/doc/index.html") + .arg(version.majorVersion()) + .arg(version.minorVersion()) + .arg(version.microVersion()); return url; } @@ -496,12 +500,13 @@ bool LocalHelpManager::canOpenOnlineHelp(const QUrl &url) bool LocalHelpManager::openOnlineHelp(const QUrl &url) { - static const QString unversionedLocalDomainName = QString("org.qt-project.%1").arg(Core::Constants::IDE_ID); + static const QString unversionedLocalDomainName + = QString("org.qt-project.%1").arg(Utils::appInfo().id); if (canOpenOnlineHelp(url)) { QString urlPrefix = "http://doc.qt.io/"; if (url.authority().startsWith(unversionedLocalDomainName)) { - urlPrefix.append(Core::Constants::IDE_ID); + urlPrefix.append(Utils::appInfo().id); } else { const auto host = url.host(); const auto dot = host.lastIndexOf('.'); diff --git a/src/plugins/languageclient/CMakeLists.txt b/src/plugins/languageclient/CMakeLists.txt index 5af221f7f8..03924f6205 100644 --- a/src/plugins/languageclient/CMakeLists.txt +++ b/src/plugins/languageclient/CMakeLists.txt @@ -5,7 +5,7 @@ elseif (MINGW) endif() add_qtc_plugin(LanguageClient - PUBLIC_DEPENDS LanguageServerProtocol Qt::Core app_version + PUBLIC_DEPENDS LanguageServerProtocol Qt::Core PLUGIN_DEPENDS ProjectExplorer Core TextEditor SOURCES callhierarchy.cpp callhierarchy.h diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 79e6b9a738..2db13172c9 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -20,8 +20,6 @@ #include "progressmanager.h" #include "semantichighlightsupport.h" -#include <app/app_version.h> - #include <coreplugin/editormanager/documentmodel.h> #include <coreplugin/icore.h> #include <coreplugin/idocument.h> @@ -54,10 +52,12 @@ #include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditorsettings.h> +#include <utils/appinfo.h> #include <utils/mimeutils.h> #include <utils/process.h> #include <QDebug> +#include <QGuiApplication> #include <QJsonDocument> #include <QLoggingCategory> #include <QMessageBox> @@ -148,8 +148,8 @@ public: { using namespace ProjectExplorer; - m_clientInfo.setName(Core::Constants::IDE_DISPLAY_NAME); - m_clientInfo.setVersion(Core::Constants::IDE_VERSION_DISPLAY); + m_clientInfo.setName(QGuiApplication::applicationDisplayName()); + m_clientInfo.setVersion(Utils::appInfo().displayVersion); m_clientProviders.completionAssistProvider = new LanguageClientCompletionAssistProvider(q); m_clientProviders.functionHintProvider = new FunctionHintAssistProvider(q); diff --git a/src/plugins/languageclient/languageclient.qbs b/src/plugins/languageclient/languageclient.qbs index 286f319a3c..f036c44e99 100644 --- a/src/plugins/languageclient/languageclient.qbs +++ b/src/plugins/languageclient/languageclient.qbs @@ -17,8 +17,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } - files: [ "callhierarchy.cpp", "callhierarchy.h", diff --git a/src/plugins/macros/macro.cpp b/src/plugins/macros/macro.cpp index 46eaa7a845..829cae5b72 100644 --- a/src/plugins/macros/macro.cpp +++ b/src/plugins/macros/macro.cpp @@ -4,7 +4,6 @@ #include "macro.h" #include "macroevent.h" -#include <app/app_version.h> #include <utils/fileutils.h> #include <QFileInfo> @@ -35,8 +34,8 @@ public: QList<MacroEvent> events; }; -Macro::MacroPrivate::MacroPrivate() : - version(QLatin1String(Core::Constants::IDE_VERSION_LONG)) +Macro::MacroPrivate::MacroPrivate() + : version(QCoreApplication::applicationVersion()) { } diff --git a/src/plugins/macros/macros.qbs b/src/plugins/macros/macros.qbs index c975f756d7..9aa7441b77 100644 --- a/src/plugins/macros/macros.qbs +++ b/src/plugins/macros/macros.qbs @@ -10,8 +10,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } - files: [ "actionmacrohandler.cpp", "actionmacrohandler.h", diff --git a/src/plugins/mcusupport/mcusupport.qbs b/src/plugins/mcusupport/mcusupport.qbs index 173fe55e6e..c9b09f81ed 100644 --- a/src/plugins/mcusupport/mcusupport.qbs +++ b/src/plugins/mcusupport/mcusupport.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Qt.widgets" } Depends { name: "Qt.testlib"; condition: qtc.testsEnabled } Depends { name: "Utils" } - Depends { name: "app_version_header" } Depends { name: "Core" } Depends { name: "BareMetal" } diff --git a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs index 15df062dfc..1c0ae3f9d4 100644 --- a/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs +++ b/src/plugins/mesonprojectmanager/mesonprojectmanager.qbs @@ -15,7 +15,6 @@ Project { Depends { name: "CppEditor" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } cpp.includePaths: "." diff --git a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp index a67175742b..539e5c1124 100644 --- a/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp +++ b/src/plugins/mesonprojectmanager/toolssettingsaccessor.cpp @@ -6,11 +6,10 @@ #include "mesonpluginconstants.h" #include "mesonprojectmanagertr.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <utils/fileutils.h> -#include <QCoreApplication> +#include <QGuiApplication> #include <QVariantMap> #include <iterator> @@ -27,7 +26,7 @@ static QString entryName(int index) ToolsSettingsAccessor::ToolsSettingsAccessor() { setDocType("QtCreatorMesonTools"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::userResourcePath(Constants::ToolsSettings::FILENAME)); } diff --git a/src/plugins/perfprofiler/perfprofiler.qbs b/src/plugins/perfprofiler/perfprofiler.qbs index 7a037e7fa4..68d8452ffc 100644 --- a/src/plugins/perfprofiler/perfprofiler.qbs +++ b/src/plugins/perfprofiler/perfprofiler.qbs @@ -9,7 +9,6 @@ QtcPlugin { Depends { name: "QtSupport" } Depends { name: "Tracing" } Depends { name: "Utils" } - Depends { name: "app_version_header" } Depends { name: "Qt" diff --git a/src/plugins/perfprofiler/perfprofilertracefile.cpp b/src/plugins/perfprofiler/perfprofilertracefile.cpp index 50c519e7af..9cc7befc4c 100644 --- a/src/plugins/perfprofiler/perfprofilertracefile.cpp +++ b/src/plugins/perfprofiler/perfprofilertracefile.cpp @@ -6,9 +6,8 @@ #include "perfprofilertr.h" #include "perfprofilertracefile.h" -#include <app/app_version.h> - #include <QFile> +#include <QGuiApplication> #include <QtEndian> namespace PerfProfiler { @@ -250,9 +249,9 @@ void PerfProfilerTraceFile::readFromDevice() fail(Tr::tr("Invalid data format. The trace file's identification string is \"%1\". " "An acceptable trace file should have \"%2\". You cannot read trace files " "generated with older versions of %3.") - .arg(QString::fromLatin1(magic)) - .arg(QString::fromLatin1(Constants::PerfZqfileMagic)) - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QString::fromLatin1(magic)) + .arg(QString::fromLatin1(Constants::PerfZqfileMagic)) + .arg(QGuiApplication::applicationDisplayName())); return; } diff --git a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp index 36b502c5ad..023dddb337 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopprocesssignaloperation.cpp @@ -5,14 +5,12 @@ #include "../projectexplorertr.h" -#include <app/app_version.h> - #include <utils/winutils.h> #include <utils/fileutils.h> #include <utils/processinfo.h> -#include <QCoreApplication> #include <QDir> +#include <QGuiApplication> #include <QProcess> #ifdef Q_OS_WIN @@ -168,10 +166,10 @@ GDB 32bit | Api | Api | N/A | Win32 if (!QFile::exists(executable)) { appendMsgCannotInterrupt(pid, Tr::tr("%1 does not exist. If you built %2 " - "yourself, check out https://code.qt.io/cgit/" - "qt-creator/binary-artifacts.git/.") + "yourself, check out https://code.qt.io/cgit/" + "qt-creator/binary-artifacts.git/.") .arg(QDir::toNativeSeparators(executable), - QString(Core::Constants::IDE_DISPLAY_NAME))); + QGuiApplication::applicationDisplayName())); } switch (QProcess::execute(executable, QStringList(QString::number(pid)))) { case -2: diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index 19f970b11a..48a8b325e4 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -11,9 +11,8 @@ #include <utils/fileutils.h> #include <utils/settingsaccessor.h> -#include <app/app_version.h> - #include <QDebug> +#include <QGuiApplication> using namespace Utils; @@ -38,7 +37,7 @@ public: AbiFlavorAccessor() { setDocType("QtCreatorExtraAbi"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::installerResourcePath("abi.xml")); addVersionUpgrader(std::make_unique<AbiFlavorUpgraderV0>()); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index d313cb433d..0b57384ea2 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -84,7 +84,6 @@ #include "projecttree.h" #include "projectwelcomepage.h" -#include <app/app_version.h> #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -2864,10 +2863,11 @@ bool ProjectExplorerPlugin::coreAboutToClose() QPushButton *closeAnyway = box.addButton(Tr::tr("Cancel Build && Close"), QMessageBox::AcceptRole); QPushButton *cancelClose = box.addButton(Tr::tr("Do Not Close"), QMessageBox::RejectRole); box.setDefaultButton(cancelClose); - box.setWindowTitle(Tr::tr("Close %1?").arg(Core::Constants::IDE_DISPLAY_NAME)); + box.setWindowTitle(Tr::tr("Close %1?").arg(QGuiApplication::applicationDisplayName())); box.setText(Tr::tr("A project is currently being built.")); - box.setInformativeText(Tr::tr("Do you want to cancel the build process and close %1 anyway?") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + box.setInformativeText( + Tr::tr("Do you want to cancel the build process and close %1 anyway?") + .arg(QGuiApplication::applicationDisplayName())); box.exec(); if (box.clickedButton() != closeAnyway) return false; diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 420296a306..68e3c85d03 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -10,7 +10,6 @@ Project { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } Depends { name: "libclang"; required: false } Depends { name: "clang_defines" } diff --git a/src/plugins/projectexplorer/projectexplorerconstants.cpp b/src/plugins/projectexplorer/projectexplorerconstants.cpp index 0481d82a02..0b1772c9cd 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.cpp +++ b/src/plugins/projectexplorer/projectexplorerconstants.cpp @@ -5,7 +5,7 @@ #include "projectexplorertr.h" -#include <coreplugin/icore.h> +#include <QGuiApplication> namespace ProjectExplorer { namespace Constants { @@ -18,7 +18,7 @@ QString msgAutoDetected() QString msgAutoDetectedToolTip() { return Tr::tr("Automatically managed by %1 or the installer.") - .arg(Core::ICore::ideDisplayName()); + .arg(QGuiApplication::applicationDisplayName()); } QString msgManual() diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 9c04314da1..e8ef6139d7 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -12,8 +12,6 @@ #include "projecttree.h" #include "target.h" -#include <app/app_version.h> - #include <coreplugin/documentmanager.h> #include <coreplugin/icore.h> #include <coreplugin/iversioncontrol.h> @@ -35,11 +33,12 @@ #include <QDialogButtonBox> #include <QFileInfo> #include <QFont> +#include <QGuiApplication> #include <QHBoxLayout> #include <QLabel> +#include <QLoggingCategory> #include <QMessageBox> #include <QMimeData> -#include <QLoggingCategory> #include <QPushButton> #include <QRadioButton> #include <QVBoxLayout> @@ -600,7 +599,7 @@ public: setWindowTitle(Tr::tr("Choose Drop Action")); const bool offerFileIo = !defaultTargetDir.isEmpty(); auto * const layout = new QVBoxLayout(this); - const QString idename(Core::Constants::IDE_DISPLAY_NAME); + const QString idename(QGuiApplication::applicationDisplayName()); layout->addWidget(new QLabel(Tr::tr("You just dragged some files from one project node to " "another.\nWhat should %1 do now?").arg(idename), this)); auto * const copyButton = new QRadioButton(this); diff --git a/src/plugins/projectexplorer/simpleprojectwizard.cpp b/src/plugins/projectexplorer/simpleprojectwizard.cpp index a73725daa1..455e253abe 100644 --- a/src/plugins/projectexplorer/simpleprojectwizard.cpp +++ b/src/plugins/projectexplorer/simpleprojectwizard.cpp @@ -6,8 +6,6 @@ #include "projectexplorerconstants.h" #include "projectexplorertr.h" -#include <app/app_version.h> - #include <coreplugin/basefilewizard.h> #include <coreplugin/icore.h> @@ -151,11 +149,13 @@ SimpleProjectWizard::SimpleProjectWizard() setIcon(ProjectExplorer::Icons::WIZARD_IMPORT_AS_PROJECT.icon()); setDisplayName(Tr::tr("Import as qmake or CMake Project (Limited Functionality)")); setId("Z.DummyProFile"); - setDescription(Tr::tr("Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools.<p>" - "This creates a project file that allows you to use %1 as a code editor " - "and as a launcher for debugging and analyzing tools. " - "If you want to build the project, you might need to edit the generated project file.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + setDescription( + Tr::tr( + "Imports existing projects that do not use qmake, CMake, Qbs, Meson, or Autotools.<p>" + "This creates a project file that allows you to use %1 as a code editor " + "and as a launcher for debugging and analyzing tools. " + "If you want to build the project, you might need to edit the generated project file.") + .arg(QGuiApplication::applicationDisplayName())); setCategory(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY); setDisplayCategory(Tr::tr(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY)); setFlags(IWizardFactory::PlatformIndependent); @@ -217,16 +217,16 @@ GeneratedFiles generateQmakeFiles(const SimpleProjectWizardDialog *wizard, GeneratedFile generatedProFile(proFileName); generatedProFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); generatedProFile.setContents( - "# Created by and for " + QLatin1String(Core::Constants::IDE_DISPLAY_NAME) + "# Created by and for " + QGuiApplication::applicationDisplayName() + " This file was created for editing the project sources only.\n" - "# You may attempt to use it for building too, by modifying this file here.\n\n" - "#TARGET = " + projectName + "\n\n" - "QT = " + wizard->qtModules() + "\n\n" - + proHeaders + "\n\n" - + proSources + "\n\n" - + proIncludes + "\n\n" - "#DEFINES = \n\n" - ); + "# You may attempt to use it for building too, by modifying this file here.\n\n" + "#TARGET = " + + projectName + + "\n\n" + "QT = " + + wizard->qtModules() + "\n\n" + proHeaders + "\n\n" + proSources + "\n\n" + proIncludes + + "\n\n" + "#DEFINES = \n\n"); return GeneratedFiles{generatedProFile}; } @@ -290,22 +290,22 @@ GeneratedFiles generateCmakeFiles(const SimpleProjectWizardDialog *wizard, GeneratedFile generatedProFile(projectFileName); generatedProFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); generatedProFile.setContents( - "# Created by and for " + QLatin1String(Core::Constants::IDE_DISPLAY_NAME) + "# Created by and for " + QGuiApplication::applicationDisplayName() + " This file was created for editing the project sources only.\n" "# You may attempt to use it for building too, by modifying this file here.\n\n" "cmake_minimum_required(VERSION 3.5)\n" - "project("+ projectName +")\n\n" + "project(" + + projectName + + ")\n\n" "set(CMAKE_AUTOUIC ON)\n" "set(CMAKE_AUTOMOC ON)\n" "set(CMAKE_AUTORCC ON)\n" "set(CMAKE_CXX_STANDARD 11)\n" "set(CMAKE_CXX_STANDARD_REQUIRED ON)\n" - + components + "\n\n" - + includes + "\n\n" - + srcs + "\n\n" + + components + "\n\n" + includes + "\n\n" + srcs + + "\n\n" "add_executable(${CMAKE_PROJECT_NAME} ${SRCS})\n\n" - + libs - ); + + libs); return GeneratedFiles{generatedProFile}; } diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index d2fdc3b43a..f17354bc5d 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -19,8 +19,6 @@ #include "targetsetuppage.h" #include "task.h" -#include <app/app_version.h> - #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> #include <coreplugin/modemanager.h> diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index 03c2a282be..a16a728344 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -7,7 +7,6 @@ #include "projectexplorerconstants.h" #include "projectexplorertr.h" -#include <app/app_version.h> #include <texteditor/fontsettings.h> #include <texteditor/textmark.h> #include <utils/algorithm.h> @@ -15,6 +14,7 @@ #include <utils/qtcassert.h> #include <QFileInfo> +#include <QGuiApplication> #include <QTextStream> using namespace Utils; @@ -61,8 +61,8 @@ Task Task::compilerMissingTask() { return BuildSystemTask(Task::Error, Tr::tr("%1 needs a compiler set up to build. " - "Configure a compiler in the kit options.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + "Configure a compiler in the kit options.") + .arg(QGuiApplication::applicationDisplayName())); } void Task::setMark(TextEditor::TextMark *mark) diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index e0717ab780..99ac9f8774 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -10,7 +10,6 @@ #include "toolchainconfigwidget.h" #include "toolchainmanager.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> @@ -117,10 +116,14 @@ public: const auto layout = new QVBoxLayout(this); m_detectX64AsX32CheckBox.setText(Tr::tr("Detect x86_64 GCC compilers " "as x86_64 and x86")); - m_detectX64AsX32CheckBox.setToolTip(Tr::tr("If checked, %1 will " - "set up two instances of each x86_64 compiler:\nOne for the native x86_64 target, and " - "one for a plain x86 target.\nEnable this if you plan to create 32-bit x86 binaries " - "without using a dedicated cross compiler.").arg(Core::Constants::IDE_DISPLAY_NAME)); + m_detectX64AsX32CheckBox.setToolTip( + Tr::tr("If checked, %1 will " + "set up two instances of each x86_64 compiler:\nOne for the native x86_64 " + "target, and " + "one for a plain x86 target.\nEnable this if you plan to create 32-bit x86 " + "binaries " + "without using a dedicated cross compiler.") + .arg(QGuiApplication::applicationDisplayName())); m_detectX64AsX32CheckBox.setChecked(settings.detectX64AsX32); layout->addWidget(&m_detectX64AsX32CheckBox); const auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 35224e4d02..9354f6e62d 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -10,11 +10,10 @@ #include <coreplugin/icore.h> -#include <app/app_version.h> - #include <utils/algorithm.h> #include <QElapsedTimer> +#include <QGuiApplication> #include <QLoggingCategory> using namespace Utils; @@ -172,7 +171,7 @@ static ToolChainOperations mergeToolChainLists(const Toolchains &systemFileTcs, ToolChainSettingsAccessor::ToolChainSettingsAccessor() { setDocType("QtCreatorToolChains"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); setBaseFilePath(Core::ICore::userResourcePath(TOOLCHAIN_FILENAME)); addVersionUpgrader(std::make_unique<ToolChainSettingsUpgraderV0>()); diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 5a765cb537..295bb2ea00 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -13,7 +13,6 @@ #include "kit.h" #include "kitmanager.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <utils/environment.h> #include <utils/hostosinfo.h> @@ -21,6 +20,7 @@ #include <utils/process.h> #include <utils/qtcassert.h> +#include <QGuiApplication> #include <QRegularExpression> using namespace Utils; @@ -288,7 +288,7 @@ UserFileAccessor::UserFileAccessor(Project *project) { setStrategy(std::make_unique<VersionedBackUpStrategy>(this)); setDocType("QtCreatorProject"); - setApplicationDisplayName(Core::Constants::IDE_DISPLAY_NAME); + setApplicationDisplayName(QGuiApplication::applicationDisplayName()); // Setup: const FilePath externalUser = externalUserFile(); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs index 99c4345f45..727507dda1 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs @@ -16,7 +16,6 @@ QtcPlugin { Depends { name: "CppEditor" } Depends { name: "QtSupport" } Depends { name: "QmlJSTools" } - Depends { name: "app_version_header" } files: [ "customqbspropertiesdialog.h", diff --git a/src/plugins/qbsprojectmanager/qbssession.cpp b/src/plugins/qbsprojectmanager/qbssession.cpp index d2e5d130f0..49d8b31b56 100644 --- a/src/plugins/qbsprojectmanager/qbssession.cpp +++ b/src/plugins/qbsprojectmanager/qbssession.cpp @@ -8,7 +8,6 @@ #include "qbsprojectmanagertr.h" #include "qbssettings.h" -#include <app/app_version.h> #include <coreplugin/messagemanager.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/taskhub.h> @@ -19,6 +18,7 @@ #include <QDir> #include <QEventLoop> +#include <QGuiApplication> #include <QJsonArray> #include <QJsonDocument> #include <QProcessEnvironment> @@ -243,7 +243,7 @@ QString QbsSession::errorString(QbsSession::Error error) //: %1 == "Qt Creator" or "Qt Design Studio" return Tr::tr("The qbs API level is not compatible with " "what %1 expects.") - .arg(Core::Constants::IDE_DISPLAY_NAME); + .arg(QGuiApplication::applicationDisplayName()); } return QString(); // For dumb compilers. } diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp index 409ebcd88b..d631f23ced 100644 --- a/src/plugins/qbsprojectmanager/qbssettings.cpp +++ b/src/plugins/qbsprojectmanager/qbssettings.cpp @@ -6,7 +6,6 @@ #include "qbsprojectmanagerconstants.h" #include "qbsprojectmanagertr.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <projectexplorer/projectexplorerconstants.h> #include <utils/environment.h> @@ -15,9 +14,9 @@ #include <utils/process.h> #include <utils/qtcsettings.h> -#include <QCoreApplication> #include <QCheckBox> #include <QFormLayout> +#include <QGuiApplication> #include <QLabel> #include <QPushButton> @@ -161,7 +160,7 @@ public: m_versionLabel.setText(getQbsVersionString()); //: %1 == "Qt Creator" or "Qt Design Studio" m_settingsDirCheckBox.setText(Tr::tr("Use %1 settings directory for Qbs") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + .arg(QGuiApplication::applicationDisplayName())); m_settingsDirCheckBox.setChecked(QbsSettings::useCreatorSettingsDirForQbs()); const auto layout = new QFormLayout(this); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs index e4276322c7..599441a0a8 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs @@ -14,7 +14,6 @@ Project { Depends { name: "CppEditor" } Depends { name: "TextEditor" } Depends { name: "ResourceEditor" } - Depends { name: "app_version_header" } Group { name: "General" diff --git a/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp b/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp index e52c0c7058..e413d66ba2 100644 --- a/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp +++ b/src/plugins/qmldesigner/puppetenvironmentbuilder.cpp @@ -7,8 +7,6 @@ #include <model.h> -#include <app/app_version.h> - #include <projectexplorer/kit.h> #include <projectexplorer/target.h> #include <utils/algorithm.h> diff --git a/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp b/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp index 1bd5899165..54549fa575 100644 --- a/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp +++ b/src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp @@ -5,7 +5,6 @@ #include "qmldesignerplugin.h" -#include <app/app_version.h> #include <edit3d/edit3dviewconfig.h> #include <itemlibraryimport.h> #include <projectexplorer/kit.h> diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index a25bbb832b..c83f830072 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -39,7 +39,6 @@ #include <qmlprojectmanager/qmlproject.h> -#include <app/app_version.h> #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -244,7 +243,7 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e ->addAction(cmd, Core::Constants::G_HELP_SUPPORT); connect(action, &QAction::triggered, this, [this] { - lauchFeedbackPopupInternal(Core::Constants::IDE_DISPLAY_NAME); + lauchFeedbackPopupInternal(QGuiApplication::applicationDisplayName()); }); if (!Utils::HostOsInfo::canCreateOpenGLContext(errorMessage)) diff --git a/src/plugins/qmldesigner/settingspage.cpp b/src/plugins/qmldesigner/settingspage.cpp index 8c3222d72c..f5556e4d94 100644 --- a/src/plugins/qmldesigner/settingspage.cpp +++ b/src/plugins/qmldesigner/settingspage.cpp @@ -7,8 +7,6 @@ #include "qmldesignerexternaldependencies.h" #include "qmldesignerplugin.h" -#include <app/app_version.h> - #include <coreplugin/icore.h> #include <qmljseditor/qmljseditorconstants.h> @@ -506,10 +504,11 @@ void SettingsPageWidget::apply() for (const char * const key : restartNecessaryKeys) { if (QmlDesignerPlugin::settings().value(key) != settings.value(key)) { - QMessageBox::information(Core::ICore::dialogParent(), tr("Restart Required"), - tr("The made changes will take effect after a " - "restart of the QML Emulation layer or %1.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); + QMessageBox::information(Core::ICore::dialogParent(), + tr("Restart Required"), + tr("The made changes will take effect after a " + "restart of the QML Emulation layer or %1.") + .arg(QGuiApplication::applicationDisplayName())); break; } } diff --git a/src/plugins/qmldesignerbase/qmldesignerbase.qbs b/src/plugins/qmldesignerbase/qmldesignerbase.qbs index 98f4cdf556..334bebe196 100644 --- a/src/plugins/qmldesignerbase/qmldesignerbase.qbs +++ b/src/plugins/qmldesignerbase/qmldesignerbase.qbs @@ -6,7 +6,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } Depends { name: "Qt.quickwidgets" } files: [ diff --git a/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp b/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp index d73ea62ea9..0878dc04e2 100644 --- a/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp +++ b/src/plugins/qmldesignerbase/utils/qmlpuppetpaths.cpp @@ -5,7 +5,6 @@ #include "designersettings.h" -#include <app/app_version.h> #include <coreplugin/icore.h> #include <projectexplorer/kit.h> #include <projectexplorer/target.h> @@ -19,7 +18,8 @@ namespace { Utils::FilePath qmlPuppetExecutablePath(const Utils::FilePath &workingDirectory) { - return workingDirectory.pathAppended(QString{"qml2puppet-"} + Core::Constants::IDE_VERSION_LONG) + return workingDirectory + .pathAppended(QString{"qml2puppet-"} + QCoreApplication::applicationVersion()) .withExecutableSuffix(); } diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 56a1e00cd6..359a9eb1cf 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -15,7 +15,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } Depends { name: "TextEditor" } - Depends { name: "app_version_header" } Group { name: "General" diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index f003d5f0e4..42826cd13f 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -15,8 +15,6 @@ #include "qmlprofilertr.h" #include "qmlprofilerviewmanager.h" -#include <app/app_version.h> - #include <coreplugin/actionmanager/command.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/coreconstants.h> @@ -333,7 +331,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) runWorker, [this, runWorker]() { auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); - infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); + infoBox->setWindowTitle(QGuiApplication::applicationDisplayName()); const int interval = d->m_profilerConnections->retryInterval(); const int retries = d->m_profilerConnections->maximumRetries(); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index d7418e1b31..60e58d78d6 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -9,8 +9,6 @@ #include "qtversionmanager.h" #include "qtversionfactory.h" -#include <app/app_version.h> - #include <coreplugin/coreconstants.h> #include <coreplugin/dialogs/restartdialog.h> #include <coreplugin/icore.h> @@ -803,14 +801,14 @@ void QtOptionsPageWidget::updateWidgets() static QString settingsFile(const QString &baseDir) { - return baseDir + (baseDir.isEmpty() ? "" : "/") + Core::Constants::IDE_SETTINGSVARIANT_STR + '/' - + Core::Constants::IDE_CASED_ID + ".ini"; + return baseDir + (baseDir.isEmpty() ? "" : "/") + QCoreApplication::organizationName() + '/' + + QCoreApplication::applicationName() + ".ini"; } static QString qtVersionsFile(const QString &baseDir) { - return baseDir + (baseDir.isEmpty() ? "" : "/") + Core::Constants::IDE_SETTINGSVARIANT_STR + '/' - + Core::Constants::IDE_ID + '/' + "qtversion.xml"; + return baseDir + (baseDir.isEmpty() ? "" : "/") + QCoreApplication::organizationName() + '/' + + QCoreApplication::applicationName() + '/' + "qtversion.xml"; } static std::optional<FilePath> currentlyLinkedQtDir(bool *hasInstallSettings) @@ -847,12 +845,12 @@ static bool canLinkWithQt(QString *toolTip) if (!Core::ICore::resourcePath().isWritableDir()) { canLink = false; tip << Tr::tr("%1's resource directory is not writable.") - .arg(Core::Constants::IDE_DISPLAY_NAME); + .arg(QGuiApplication::applicationDisplayName()); } const FilePath link = installSettingsValue ? *installSettingsValue : FilePath(); if (!link.isEmpty()) tip << Tr::tr("%1 is currently linked to \"%2\".") - .arg(QString(Core::Constants::IDE_DISPLAY_NAME), link.toUserOutput()); + .arg(QGuiApplication::applicationDisplayName(), link.toUserOutput()); if (toolTip) *toolTip = tip.join("\n\n"); return canLink; diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 526cf4a24f..502f13f758 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -6,7 +6,6 @@ Project { QtcPlugin { Depends { name: "Qt"; submodules: ["widgets", "xml"]; } Depends { name: "Utils" } - Depends { name: "app_version_header" } Depends { name: "Core" } Depends { name: "ProParser" } diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index 8cd7618944..795e183bd6 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -51,8 +51,6 @@ #include <QStandardPaths> #include <QXmlStreamWriter> -#include <app/app_version.h> - #include <coreplugin/icore.h> #include <coreplugin/minisplitter.h> diff --git a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp index e85a516cf1..4ee7ebc619 100644 --- a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp @@ -13,8 +13,6 @@ #include <QXmlStreamReader> #include <QXmlStreamWriter> -#include <app/app_version.h> - using namespace ScxmlEditor::PluginInterface; ScxmlDocument::ScxmlDocument(const QString &fileName, QObject *parent) @@ -62,7 +60,7 @@ void ScxmlDocument::clear(bool createRoot) if (createRoot) { pushRootTag(createScxmlTag()); - rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG)); + rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion()); auto ns = new ScxmlNamespace("qt", "http://www.qt.io/2015/02/scxml-ext"); ns->setTagVisibility("editorInfo", false); @@ -207,7 +205,7 @@ bool ScxmlDocument::load(QIODevice *io) // Check editorversion m_hasLayouted = rootTag()->hasAttribute("qt:editorversion"); - rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG)); + rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion()); } } @@ -363,7 +361,7 @@ void ScxmlDocument::load(const QString &fileName) // If loading doesn't work, create root tag here if (m_rootTags.isEmpty()) { pushRootTag(createScxmlTag()); - rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG)); + rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion()); } auto ns = new ScxmlNamespace("qt", "http://www.qt.io/2015/02/scxml-ext"); diff --git a/src/plugins/scxmleditor/scxmleditor.qbs b/src/plugins/scxmleditor/scxmleditor.qbs index 39340d8764..d8457e6e1a 100644 --- a/src/plugins/scxmleditor/scxmleditor.qbs +++ b/src/plugins/scxmleditor/scxmleditor.qbs @@ -11,8 +11,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "app_version_header" } - cpp.includePaths: base.concat([ ".", common.prefix, diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index b7a4725f81..7769f5f470 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -6,8 +6,6 @@ #include "qdsnewdialog.h" -#include <app/app_version.h> - #include <coreplugin/coreconstants.h> #include <coreplugin/dialogs/restartdialog.h> #include <coreplugin/documentmanager.h> @@ -39,6 +37,7 @@ #include <qmljs/qmljsmodelmanagerinterface.h> +#include <utils/appinfo.h> #include <utils/checkablemessagebox.h> #include <utils/hostosinfo.h> #include <utils/icon.h> @@ -166,7 +165,7 @@ public: explicit UsageStatisticPluginModel(QObject *parent = nullptr) : QObject(parent) { - m_versionString = Core::Constants::IDE_VERSION_DISPLAY; + m_versionString = Utils::appInfo().displayVersion; setupModel(); } @@ -532,8 +531,7 @@ static bool showSplashScreen() const QString lastQDSVersion = settings->value(lastQDSVersionEntry).toString(); - - const QString currentVersion = Core::Constants::IDE_VERSION_DISPLAY; + const QString currentVersion = Utils::appInfo().displayVersion; if (currentVersion != lastQDSVersion) { settings->setValue(lastQDSVersionEntry, currentVersion); diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs index 95acd8fe21..2811856c1f 100644 --- a/src/plugins/welcome/welcome.qbs +++ b/src/plugins/welcome/welcome.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Utils" } Depends { name: "Core" } - Depends { name: "app_version_header" } files: [ "introductionwidget.cpp", diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 915695dafa..d4089de465 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -7,8 +7,6 @@ #include <extensionsystem/iplugin.h> #include <extensionsystem/pluginmanager.h> -#include <app/app_version.h> - #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/command.h> @@ -30,6 +28,7 @@ #include <utils/treemodel.h> #include <QDesktopServices> +#include <QGuiApplication> #include <QLabel> #include <QMouseEvent> #include <QPainter> @@ -187,7 +186,7 @@ public: hbox->addSpacing(8); - auto ideNameLabel = new QLabel(Core::Constants::IDE_DISPLAY_NAME); + auto ideNameLabel = new QLabel(QGuiApplication::applicationDisplayName()); ideNameLabel->setFont(welcomeFont); ideNameLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); QPalette pal = palette(); |