forked from qt-creator/qt-creator
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:
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
@@ -9,15 +9,22 @@
|
||||
|
||||
namespace Core {
|
||||
|
||||
enum class PatchAction {
|
||||
Apply,
|
||||
Revert
|
||||
};
|
||||
|
||||
class CORE_EXPORT PatchTool
|
||||
{
|
||||
public:
|
||||
static Utils::FilePath patchCommand();
|
||||
static void setPatchCommand(const Utils::FilePath &newCommand);
|
||||
|
||||
static bool confirmPatching(QWidget *parent, PatchAction patchAction);
|
||||
|
||||
// Utility to run the 'patch' command
|
||||
static bool runPatch(const QByteArray &input, const Utils::FilePath &workingDirectory = {},
|
||||
int strip = 0, bool reverse = false);
|
||||
int strip = 0, PatchAction patchAction = PatchAction::Apply);
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
Reference in New Issue
Block a user