Reduce usage of app_version header

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

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

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

View File

@@ -4,12 +4,6 @@ if(NOT IS_ABSOLUTE "${IDE_ICON_PATH}")
set(IDE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IDE_ICON_PATH}")
endif()
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/app_version.h
DESTINATION ${IDE_HEADER_INSTALL_PATH}/src/app
COMPONENT Devel EXCLUDE_FROM_ALL
)
add_qtc_executable(qtcreator
DEFINES IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
DEPENDS Aggregation ExtensionSystem Qt::Core Qt::Widgets Utils shared_qtsingleapplication app_version

View File

@@ -11,6 +11,7 @@
#include <qtsingleapplication.h>
#include <utils/algorithm.h>
#include <utils/appinfo.h>
#include <utils/environment.h>
#include <utils/fileutils.h>
#include <utils/fsengine/fsengine.h>
@@ -653,6 +654,16 @@ int main(int argc, char **argv)
PluginManager::setGlobalSettings(globalSettings);
PluginManager::setSettings(settings);
using namespace Core;
Utils::AppInfo info;
info.author = Constants::IDE_AUTHOR;
info.year = Constants::IDE_YEAR;
info.displayVersion = Constants::IDE_VERSION_DISPLAY;
info.id = Constants::IDE_ID;
info.revision = Constants::IDE_REVISION_STR;
info.revisionUrl = Constants::IDE_REVISION_URL;
Utils::Internal::setAppInfo(info);
QTranslator translator;
QTranslator qtTranslator;
QStringList uiLanguages = QLocale::system().uiLanguages();

View File

@@ -4,7 +4,6 @@
#include "mainwidget.h"
#include "ui_mainwidget.h"
#include <app/app_version.h>
#include <QApplication>
#include <QDateTime>
@@ -23,7 +22,8 @@ MainWidget::MainWidget(QWidget *parent) :
{
ui->setupUi(this);
ui->mainWidgetTopLabel.setText(tr("%1 has crashed").arg(Core::Constants::IDE_DISPLAY_NAME));
const QString applicationName = QApplication::arguments().at(3);
ui->mainWidgetTopLabel.setText(tr("%1 has crashed").arg(applicationName));
connect(ui->restartButton, &QAbstractButton::clicked, this, &MainWidget::restartApplication);
connect(ui->quitButton, &QAbstractButton::clicked, this, &MainWidget::quitApplication);

View File

@@ -9,6 +9,7 @@ add_qtc_library(Utils
QtConcurrentTools
algorithm.h
ansiescapecodehandler.cpp ansiescapecodehandler.h
appinfo.cpp appinfo.h
appmainwindow.cpp appmainwindow.h
archive.cpp archive.h
aspects.cpp aspects.h

View File

@@ -0,0 +1,20 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "appinfo.h"
Q_GLOBAL_STATIC(Utils::AppInfo, sAppInfo)
namespace Utils {
Utils::AppInfo appInfo()
{
return *sAppInfo;
}
void Internal::setAppInfo(const AppInfo &info)
{
*sAppInfo = info;
}
} // namespace Utils

29
src/libs/utils/appinfo.h Normal file
View File

@@ -0,0 +1,29 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "utils_global.h"
#include <QString>
namespace Utils {
class QTCREATOR_UTILS_EXPORT AppInfo
{
public:
QString author;
QString year;
QString displayVersion;
QString id;
QString revision;
QString revisionUrl;
};
QTCREATOR_UTILS_EXPORT AppInfo appInfo();
namespace Internal {
QTCREATOR_UTILS_EXPORT void setAppInfo(const AppInfo &info);
} // namespace Internal
} // namespace Utils

View File

@@ -36,7 +36,6 @@ Project {
Depends { name: "Qt"; submodules: ["concurrent", "core-private", "network", "qml", "widgets", "xml"] }
Depends { name: "Qt.macextras"; condition: Qt.core.versionMajor < 6 && qbs.targetOS.contains("macos") }
Depends { name: "Tasking" }
Depends { name: "app_version_header" }
Depends { name: "ptyqt" }
files: [
@@ -44,6 +43,8 @@ Project {
"algorithm.h",
"ansiescapecodehandler.cpp",
"ansiescapecodehandler.h",
"appinfo.cpp",
"appinfo.h",
"appmainwindow.cpp",
"appmainwindow.h",
"archive.cpp",

View File

@@ -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",

View File

@@ -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);

View File

@@ -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>

View File

@@ -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?"));

View File

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

View File

@@ -10,8 +10,6 @@
#include "cmaketool.h"
#include "cmaketoolmanager.h"
#include <app/app_version.h>
#include <coreplugin/icore.h>
#include <ios/iosconstants.h>
@@ -41,6 +39,7 @@
#include <QDialog>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QGuiApplication>
#include <QLineEdit>
#include <QPlainTextEdit>
#include <QPointer>
@@ -740,7 +739,7 @@ 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));
.arg(QGuiApplication::applicationDisplayName()));
}
}

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,4 @@
add_qtc_plugin(Coco
PUBLIC_DEPENDS app_version
PLUGIN_DEPENDS Core LanguageClient
SOURCES
cocolanguageclient.cpp cocolanguageclient.h

View File

@@ -7,8 +7,6 @@ QtcPlugin {
Depends { name: "LanguageClient" }
Depends { name: "TextEditor" }
Depends { name: "app_version_header" }
Depends { name: "Qt"; submodules: ["widgets"] }
files: [

View File

@@ -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();

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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); });
@@ -398,7 +405,7 @@ void CorePlugin::checkSettings()
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));
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"
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));
.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"));
}
@@ -462,12 +472,15 @@ QString CorePlugin::msgCrashpadInformation()
"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)
"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>";
"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()

View File

@@ -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"]

View File

@@ -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());

View File

@@ -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>

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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,10 +382,10 @@ 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),
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)) {
@@ -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);

View File

@@ -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>

View File

@@ -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 "
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));
.arg(QGuiApplication::applicationDisplayName()));
appLabel->setWordWrap(true);
appLabel->setAttribute(Qt::WA_MacSmallSize, true);

View File

@@ -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>
@@ -217,7 +216,7 @@ public:
"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));
.arg(QGuiApplication::applicationDisplayName()));
m_autoSaveRefactoringCheckBox->setChecked(EditorManager::autoSaveAfterRefactoring());
m_autoSaveRefactoringCheckBox->setToolTip(
Tr::tr("Automatically saves all open files "

View File

@@ -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
@@ -71,8 +72,8 @@ VersionDialog::VersionDialog(QWidget *parent)
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 "

View File

@@ -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()));
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -13,8 +13,6 @@ QtcPlugin {
Depends { name: "TextEditor" }
Depends { name: "ProjectExplorer" }
Depends { name: "app_version_header" }
pluginTestDepends: [
"QmakeProjectManager",
"QbsProjectManager",

View File

@@ -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);

View File

@@ -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>
@@ -340,9 +339,9 @@ void CdbEngine::setupEngine()
"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)));
"same bitness as the CDB you want to use.")
.arg(QDir::toNativeSeparators(extensionFi.absoluteFilePath()),
QGuiApplication::applicationDisplayName()));
return;
}

View File

@@ -17,7 +17,6 @@ Project {
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "TextEditor" }
Depends { name: "app_version_header" }
pluginTestDepends: [
"QmakeProjectManager"

View File

@@ -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;

View File

@@ -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 "
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 &lt;executable&gt;</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"),
.arg(QGuiApplication::applicationDisplayName(),
ext32,
ext64,
QString("_NT_DEBUGGER_EXTENSION_PATH"),
QString("cdb.exe -server tcp:port=1234"),
QString(cdbConnectionSyntax));
}

View File

@@ -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>
@@ -1673,8 +1671,9 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
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));
"%2 cannot attach to it.")
.arg(processInfo.processId)
.arg(QGuiApplication::applicationDisplayName()));
return nullptr;
}

View File

@@ -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;
@@ -1502,8 +1502,9 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response)
+ 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);
.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);
}

View File

@@ -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,8 +437,10 @@ LogWindow::LogWindow(DebuggerEngine *engine)
setMinimumHeight(60);
showOutput(LogWarning,
Tr::tr("Note: This log contains possibly confidential information about your machine, "
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 "
@@ -448,7 +449,7 @@ LogWindow::LogWindow(DebuggerEngine *engine)
"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));
.arg(QGuiApplication::applicationDisplayName()));
}
LogWindow::~LogWindow()

View File

@@ -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)))) {

View File

@@ -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);

View File

@@ -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()) {

View File

@@ -11,7 +11,6 @@ QtcPlugin {
Depends { name: "TextEditor" }
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "app_version_header" }
pluginRecommends: [
"CppEditor"

View File

@@ -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. "
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));
.arg(QGuiApplication::applicationDisplayName()));
setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
setFlags(Core::IWizardFactory::PlatformIndependent);

View File

@@ -16,8 +16,6 @@ Project {
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "app_version_header" }
Depends { name: "qlitehtml"; required: false }
cpp.defines: {

View File

@@ -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);
}

View File

@@ -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('.');

View File

@@ -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

View File

@@ -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);

View File

@@ -17,8 +17,6 @@ QtcPlugin {
Depends { name: "Core" }
Depends { name: "TextEditor" }
Depends { name: "app_version_header" }
files: [
"callhierarchy.cpp",
"callhierarchy.h",

View File

@@ -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())
{
}

View File

@@ -10,8 +10,6 @@ QtcPlugin {
Depends { name: "Core" }
Depends { name: "TextEditor" }
Depends { name: "app_version_header" }
files: [
"actionmacrohandler.cpp",
"actionmacrohandler.h",

View File

@@ -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" }

View File

@@ -15,7 +15,6 @@ Project {
Depends { name: "CppEditor" }
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "app_version_header" }
cpp.includePaths: "."

View File

@@ -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));
}

View File

@@ -9,7 +9,6 @@ QtcPlugin {
Depends { name: "QtSupport" }
Depends { name: "Tracing" }
Depends { name: "Utils" }
Depends { name: "app_version_header" }
Depends {
name: "Qt"

View File

@@ -6,9 +6,8 @@
#include "perfprofilertr.h"
#include "perfprofilertracefile.h"
#include <app/app_version.h>
#include <QFile>
#include <QGuiApplication>
#include <QtEndian>
namespace PerfProfiler {
@@ -252,7 +251,7 @@ void PerfProfilerTraceFile::readFromDevice()
"generated with older versions of %3.")
.arg(QString::fromLatin1(magic))
.arg(QString::fromLatin1(Constants::PerfZqfileMagic))
.arg(Core::Constants::IDE_DISPLAY_NAME));
.arg(QGuiApplication::applicationDisplayName()));
return;
}

View File

@@ -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
@@ -171,7 +169,7 @@ GDB 32bit | Api | Api | N/A | Win32
"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:

View File

@@ -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>());
}

View File

@@ -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;

View File

@@ -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" }

View File

@@ -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()

View File

@@ -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);

View File

@@ -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>"
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));
.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"
);
"#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};
}

View File

@@ -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>

View File

@@ -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;
@@ -62,7 +62,7 @@ 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));
.arg(QGuiApplication::applicationDisplayName()));
}
void Task::setMark(TextEditor::TextMark *mark)

View File

@@ -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);

View File

@@ -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>());

View File

@@ -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();

View File

@@ -16,7 +16,6 @@ QtcPlugin {
Depends { name: "CppEditor" }
Depends { name: "QtSupport" }
Depends { name: "QmlJSTools" }
Depends { name: "app_version_header" }
files: [
"customqbspropertiesdialog.h",

View File

@@ -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.
}

View File

@@ -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);

View File

@@ -14,7 +14,6 @@ Project {
Depends { name: "CppEditor" }
Depends { name: "TextEditor" }
Depends { name: "ResourceEditor" }
Depends { name: "app_version_header" }
Group {
name: "General"

View File

@@ -7,8 +7,6 @@
#include <model.h>
#include <app/app_version.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/target.h>
#include <utils/algorithm.h>

View File

@@ -5,7 +5,6 @@
#include "qmldesignerplugin.h"
#include <app/app_version.h>
#include <edit3d/edit3dviewconfig.h>
#include <itemlibraryimport.h>
#include <projectexplorer/kit.h>

View File

@@ -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))

View File

@@ -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"),
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));
.arg(QGuiApplication::applicationDisplayName()));
break;
}
}

View File

@@ -6,7 +6,6 @@ QtcPlugin {
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "app_version_header" }
Depends { name: "Qt.quickwidgets" }
files: [

View File

@@ -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();
}

View File

@@ -15,7 +15,6 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "TextEditor" }
Depends { name: "app_version_header" }
Group {
name: "General"

View File

@@ -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();

View File

@@ -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;

View File

@@ -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" }

View File

@@ -51,8 +51,6 @@
#include <QStandardPaths>
#include <QXmlStreamWriter>
#include <app/app_version.h>
#include <coreplugin/icore.h>
#include <coreplugin/minisplitter.h>

View File

@@ -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");

View File

@@ -11,8 +11,6 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "app_version_header" }
cpp.includePaths: base.concat([
".",
common.prefix,

View File

@@ -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);

View File

@@ -7,7 +7,6 @@ QtcPlugin {
Depends { name: "Utils" }
Depends { name: "Core" }
Depends { name: "app_version_header" }
files: [
"introductionwidget.cpp",

View File

@@ -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();

View File

@@ -8,7 +8,6 @@ QtcTool {
Depends { name: "Qt.widgets" }
Depends { name: "Qt.xml" }
Depends { name: "Qt.network" }
Depends { name: "app_version_header" }
files: [
"cfutils.h",