summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/projectexplorer.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-01-04 14:08:13 +0100
committerEike Ziller <eike.ziller@qt.io>2023-01-09 11:55:08 +0000
commit23fa784e9c90fcc26413012f861becf696503fab (patch)
tree0a834f5b3ea6bbab771ccf09bd1152bf5c9a6794 /src/plugins/projectexplorer/projectexplorer.cpp
parent37fafcabb23eea4fc22d3f54f714bf0ced297b94 (diff)
downloadqt-creator-23fa784e9c90fcc26413012f861becf696503fab.tar.gz
MacroExpanders: Remove legacy "Current(Project|Build|Kit)" variables
Should use "CurrentDocument:....." now. Change-Id: Ie47f0e0f77b506bef6fc7a173aec8cfdcf863e5e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projectexplorer.cpp')
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index abd2903f1f..647d4435c9 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -55,6 +55,7 @@
#include "projectexplorericons.h"
#include "projectexplorersettings.h"
#include "projectexplorersettingspage.h"
+#include "projectexplorertr.h"
#include "projectfilewizardextension.h"
#include "projectmanager.h"
#include "projectnodes.h"
@@ -1943,19 +1944,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->updateWelcomePage();
- // FIXME: These are mostly "legacy"/"convenience" entries, relying on
- // the global entry point ProjectExplorer::currentProject(). They should
- // not be used in the Run/Build configuration pages.
- // TODO: Remove the CurrentProject versions in ~4.16
MacroExpander *expander = Utils::globalMacroExpander();
- expander->registerFileVariables(Constants::VAR_CURRENTPROJECT_PREFIX,
- tr("Current project's main file."),
- []() -> FilePath {
- FilePath projectFilePath;
- if (Project *project = ProjectTree::currentProject())
- projectFilePath = project->projectFilePath();
- return projectFilePath;
- }, false);
expander->registerFileVariables("CurrentDocument:Project",
tr("Main file of the project the current document belongs to."),
[]() -> FilePath {
@@ -1965,12 +1954,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return projectFilePath;
}, false);
- expander->registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
- tr("The name of the current project."),
- []() -> QString {
- Project *project = ProjectTree::currentProject();
- return project ? project->displayName() : QString();
- }, false);
expander->registerVariable("CurrentDocument:Project:Name",
tr("The name of the project the current document belongs to."),
[]() -> QString {
@@ -1978,13 +1961,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return project ? project->displayName() : QString();
});
- expander->registerPrefix(Constants::VAR_CURRENTBUILD_ENV,
- BuildConfiguration::tr("Variables in the current build environment."),
- [](const QString &var) {
- if (BuildConfiguration *bc = currentBuildConfiguration())
- return bc->environment().expandedValueForKey(var);
- return QString();
- }, false);
const char currentBuildEnvVar[] = "CurrentDocument:Project:BuildConfig:Env";
expander->registerPrefix(currentBuildEnvVar,
BuildConfiguration::tr(