Commit 88456831 authored by Tom Deblauwe's avatar Tom Deblauwe Committed by Tobias Hunger

Add CurrentProject:VcsTopLevelPath as a variable.

Change-Id: I46ed1c0711cc9cc23f82628e8e9dcd82b1112fad
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent a3da1dfc
......@@ -51,6 +51,7 @@ const char VCS_ID_CVS[] = "Z.CVS";
const char VAR_VCS_NAME[] = "CurrentProject:VcsName";
const char VAR_VCS_TOPIC[] = "CurrentProject:VcsTopic";
const char VAR_VCS_TOPLEVELPATH[] = "CurrentProject:VcsTopLevelPath";
} // namespace Constants
} // namespace VcsBase
......
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment