VCS: Always allow "Revert Chunk"

Remove revertDiffChunkEnabled property

Any diff view might relate to previous changes, so it makes sense
to always allow reverting them

Change-Id: I8da0fb2d8625ac98140d1bde0296a4478bc6a0b7
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-05-31 14:35:20 +03:00
committed by Tobias Hunger
parent 3c342a49dc
commit 671bfb9250
7 changed files with 1 additions and 24 deletions

View File

@@ -603,7 +603,6 @@ public:
bool m_fileLogAnnotateEnabled;
TextEditor::BaseTextEditor *m_editor;
QWidget *m_configurationWidget;
bool m_revertChunkEnabled;
bool m_mouseDragging;
QList<AbstractTextCursorHandler *> m_textCursorHandlers;
@@ -619,7 +618,6 @@ VcsBaseEditorWidgetPrivate::VcsBaseEditorWidgetPrivate(VcsBaseEditorWidget *edit
m_fileLogAnnotateEnabled(false),
m_editor(0),
m_configurationWidget(0),
m_revertChunkEnabled(false),
m_mouseDragging(false)
{
m_textCursorHandlers.append(new ChangeTextCursorHandler(editorWidget));
@@ -922,7 +920,7 @@ void VcsBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e)
connect(applyAction, SIGNAL(triggered()), this, SLOT(slotApplyDiffChunk()));
// Revert a chunk from a VCS diff, which might be linked to reloading the diff.
QAction *revertAction = menu->addAction(tr("Revert Chunk..."));
revertAction->setEnabled(isRevertDiffChunkEnabled() && canApply);
revertAction->setEnabled(canApply);
revertAction->setData(qVariantFromValue(Internal::DiffChunkAction(chunk, true)));
connect(revertAction, SIGNAL(triggered()), this, SLOT(slotApplyDiffChunk()));
}
@@ -1412,16 +1410,6 @@ void VcsBaseEditorWidget::slotPaste()
}
}
bool VcsBaseEditorWidget::isRevertDiffChunkEnabled() const
{
return d->m_revertChunkEnabled;
}
void VcsBaseEditorWidget::setRevertDiffChunkEnabled(bool e)
{
d->m_revertChunkEnabled = e;
}
bool VcsBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const
{
if (!dc.isValid())