VCS: Add 'Blame current revision' in blame context menu

Internal change: added decorateVersion() function for decorating
a revision. This is called for both the current version and previous ones

Change-Id: I8b23fd628c9db01b005c19d46580979c5a21c687
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-06-04 12:15:54 +03:00
committed by Tobias Hunger
parent 6f7ae05d69
commit 3c342a49dc
10 changed files with 72 additions and 103 deletions

View File

@@ -352,11 +352,12 @@ void ChangeTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType typ
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
menu->addAction(createDescribeAction(m_currentChange));
menu->addSeparator();
menu->addAction(createAnnotateAction(editorWidget()->decorateVersion(m_currentChange), false));
const QStringList previousVersions = editorWidget()->annotationPreviousVersions(m_currentChange);
if (!previousVersions.isEmpty()) {
menu->addSeparator();
foreach (const QString &pv, previousVersions)
menu->addAction(createAnnotateAction(pv, true));
menu->addAction(createAnnotateAction(editorWidget()->decorateVersion(pv), true));
}
break;
}
@@ -1437,6 +1438,11 @@ bool VcsBaseEditorWidget::applyDiffChunk(const DiffChunk &dc, bool revert) const
return VcsBasePlugin::runPatch(dc.asPatch(), QString(), 0, revert);
}
QString VcsBaseEditorWidget::decorateVersion(const QString &revision) const
{
return revision;
}
void VcsBaseEditorWidget::slotApplyDiffChunk()
{
const QAction *a = qobject_cast<QAction *>(sender());