VcsPlugin: Simplify return statements

Change-Id: Icdf580fb1ca6860a82f3594e4676fb450b55d174
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-08-02 11:45:36 +02:00
parent 224e4eeb59
commit 88926ed1a8
8 changed files with 14 additions and 16 deletions

View File

@@ -107,8 +107,7 @@ void VcsPlugin::initialize()
MacroExpander *expander = globalMacroExpander();
expander->registerVariable(Constants::VAR_VCS_NAME,
Tr::tr("Name of the version control system in use by the current project."),
[]() -> QString {
Tr::tr("Name of the version control system in use by the current project."), [] {
IVersionControl *vc = nullptr;
if (Project *project = ProjectTree::currentProject())
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory());
@@ -116,8 +115,8 @@ void VcsPlugin::initialize()
});
expander->registerVariable(Constants::VAR_VCS_TOPIC,
Tr::tr("The current version control topic (branch or tag) identification of the current project."),
[]() -> QString {
Tr::tr("The current version control topic (branch or tag) identification "
"of the current project."), [] {
IVersionControl *vc = nullptr;
FilePath topLevel;
if (Project *project = ProjectTree::currentProject())
@@ -126,8 +125,7 @@ void VcsPlugin::initialize()
});
expander->registerVariable(Constants::VAR_VCS_TOPLEVELPATH,
Tr::tr("The top level path to the repository the current project is in."),
[]() -> QString {
Tr::tr("The top level path to the repository the current project is in."), [] {
if (Project *project = ProjectTree::currentProject())
return VcsManager::findTopLevelForDirectory(project->projectDirectory()).toString();
return QString();