Add CurrentProject:VcsTopLevelPath as a variable.

Change-Id: I46ed1c0711cc9cc23f82628e8e9dcd82b1112fad
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tom Deblauwe
2014-03-24 15:53:35 +01:00
committed by Tobias Hunger
parent a3da1dfce5
commit 8845683197
2 changed files with 8 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr("Name of the version control system in use by the current project."));
Core::VariableManager::registerVariable(Constants::VAR_VCS_TOPIC,
tr("The current version control topic (branch or tag) identification of the current project."));
Core::VariableManager::registerVariable(Constants::VAR_VCS_TOPLEVELPATH,
tr("The top level path to the repository the current project is in."));
return true;
}
@@ -167,6 +169,11 @@ void VcsPlugin::updateVariable(const QByteArray &variable)
Core::VariableManager::insert(variable, cachedVc->vcsTopic(cachedTopLevel));
else
Core::VariableManager::remove(variable);
} else if (variable == Constants::VAR_VCS_TOPLEVELPATH) {
if (cachedVc)
Core::VariableManager::insert(variable, cachedTopLevel);
else
Core::VariableManager::remove(variable);
}
}