aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/project.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-08-01 20:52:58 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-08-02 11:08:25 +0000
commit8d8e60436da8103f98147c45a9c6da7cd31fcb80 (patch)
tree72ec53ab1b9866bce511ca86d44a966c3d01bd3d /src/plugins/projectexplorer/project.cpp
parent9098bcd7061a3378c10b82cef1aec79d03f0d97f (diff)
ProjectExplorer: Simplify return statements
Change-Id: Ifef006cd2dcc567097ce16376eab9ccedb092f04 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/project.cpp')
-rw-r--r--src/plugins/projectexplorer/project.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp
index c541d04773..85a3850447 100644
--- a/src/plugins/projectexplorer/project.cpp
+++ b/src/plugins/projectexplorer/project.cpp
@@ -725,7 +725,7 @@ FilePath Project::projectDirectory() const
FilePath Project::projectDirectory(const FilePath &top)
{
if (top.isEmpty())
- return FilePath();
+ return {};
return top.absolutePath();
}
@@ -1232,10 +1232,10 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
//: %1 is something like "Active project"
::PE::Tr::tr("%1: Variables in the active build environment.")
.arg(descriptor),
- [bcGetter](const QString &var) {
+ [bcGetter](const QString &var) -> QString {
if (BuildConfiguration *const bc = bcGetter())
return bc->environment().expandedValueForKey(var);
- return QString();
+ return {};
});
expander->registerVariable(fullPrefix + "RunConfig:Name",
@@ -1245,7 +1245,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
[rcGetter]() -> QString {
if (const RunConfiguration *const rc = rcGetter())
return rc->displayName();
- return QString();
+ return {};
});
expander->registerFileVariables(fullPrefix + "RunConfig:Executable",
//: %1 is something like "Active project"
@@ -1262,25 +1262,25 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
::PE::Tr::tr(
"%1: Variables in the environment of the active run configuration.")
.arg(descriptor),
- [rcGetter](const QString &var) {
+ [rcGetter](const QString &var) -> QString {
if (const RunConfiguration *const rc = rcGetter()) {
if (const auto envAspect = rc->aspect<EnvironmentAspect>())
return envAspect->environment().expandedValueForKey(var);
}
- return QString();
+ return {};
});
expander->registerVariable(fullPrefix + "RunConfig:WorkingDir",
//: %1 is something like "Active project"
::PE::Tr::tr(
"%1: Working directory of the active run configuration.")
.arg(descriptor),
- [rcGetter] {
+ [rcGetter]() -> QString {
if (const RunConfiguration *const rc = rcGetter()) {
if (const auto wdAspect
= rc->aspect<WorkingDirectoryAspect>())
return wdAspect->workingDirectory().toString();
}
- return QString();
+ return {};
});
}