DiffEditor: Stage and unstage selected lines for Git

Fixes: QTCREATORBUG-19071
Change-Id: I560ba208e68e477ea865e499847d819cfdfeb6f3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Andre Hartmann
2017-11-29 21:36:30 +01:00
committed by Jarek Kobus
parent 2758682723
commit 1766832918
15 changed files with 422 additions and 57 deletions

View File

@@ -38,6 +38,8 @@ namespace DiffEditor {
namespace Internal { class DiffEditorDocument; }
class ChunkSelection;
class DIFFEDITOR_EXPORT DiffEditorController : public QObject
{
Q_OBJECT
@@ -58,18 +60,21 @@ public:
AddPrefix = 2
};
Q_DECLARE_FLAGS(PatchOptions, PatchOption)
QString makePatch(int fileIndex, int chunkIndex, PatchOptions options) const;
QString makePatch(int fileIndex, int chunkIndex, const ChunkSelection &selection,
PatchOptions options) const;
static Core::IDocument *findOrCreateDocument(const QString &vcsId,
const QString &displayName);
static DiffEditorController *controller(Core::IDocument *document);
void requestChunkActions(QMenu *menu, int fileIndex, int chunkIndex);
void requestChunkActions(QMenu *menu, int fileIndex, int chunkIndex,
const ChunkSelection &selection);
bool chunkExists(int fileIndex, int chunkIndex) const;
Core::IDocument *document() const;
signals:
void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex);
void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex,
const ChunkSelection &selection);
protected:
// reloadFinished() should be called