PatchTool: Introduce PatchAction enum

Add static PatchTool::confirmPatching() and reuse it
in two places.

Use Tr::tr() inside PatchTool.

Change-Id: I70779619dbb58ab6e46a585bbeff51588ccb2f53
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-09-29 15:31:27 +02:00
parent 2d360db2c3
commit b67c868f75
14 changed files with 140 additions and 131 deletions

View File

@@ -13,6 +13,7 @@
#include <QStringList>
using namespace Core;
using namespace Utils;
namespace DiffEditor {
@@ -55,7 +56,8 @@ QString DiffEditorController::makePatch(int fileIndex, int chunkIndex,
PatchOptions options) const
{
return m_document->makePatch(fileIndex, chunkIndex, selection,
options & Revert, options & AddPrefix);
(options & Revert) ? PatchAction::Revert : PatchAction::Apply,
options & AddPrefix);
}
Core::IDocument *DiffEditorController::findOrCreateDocument(const QString &vcsId,