Commit 3f74332f authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Tobias Hunger
Browse files

VCS: Prevent display of "Describe Change" for invalid revision



Change-Id: I0e0d3429819c4dc72071106c680e9db5d4f5cd32
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 686c0850
......@@ -337,26 +337,29 @@ void ChangeTextCursorHandler::handleCurrentContents()
void ChangeTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType type) const
{
VcsBaseEditorWidget *widget = editorWidget();
switch (type) {
case LogOutput: { // Describe current / Annotate file of current
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
menu->addAction(createDescribeAction(m_currentChange));
if (editorWidget()->isFileLogAnnotateEnabled())
if (widget->isFileLogAnnotateEnabled())
menu->addAction(createAnnotateAction(m_currentChange, false));
break;
}
case AnnotateOutput: { // Describe current / annotate previous
bool currentValid = widget->isValidRevision(m_currentChange);
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
menu->addAction(createDescribeAction(m_currentChange));
if (currentValid)
menu->addAction(createDescribeAction(m_currentChange));
menu->addSeparator();
if (editorWidget()->isValidRevision(m_currentChange))
menu->addAction(createAnnotateAction(editorWidget()->decorateVersion(m_currentChange), false));
const QStringList previousVersions = editorWidget()->annotationPreviousVersions(m_currentChange);
if (currentValid)
menu->addAction(createAnnotateAction(widget->decorateVersion(m_currentChange), false));
const QStringList previousVersions = widget->annotationPreviousVersions(m_currentChange);
if (!previousVersions.isEmpty()) {
foreach (const QString &pv, previousVersions)
menu->addAction(createAnnotateAction(editorWidget()->decorateVersion(pv), true));
menu->addAction(createAnnotateAction(widget->decorateVersion(pv), true));
}
break;
}
......
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