Don't route request for chunk actions through diff doc

Change-Id: Ia2c052ab4a39e99466d697b44b5d58a574408fb0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2018-02-14 13:38:56 +01:00
parent 11a6f000be
commit 9494a9e0c0
5 changed files with 4 additions and 7 deletions

View File

@@ -25,8 +25,6 @@
#pragma once
#include "diffeditorcontroller.h"
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/idocument.h>
#include <utils/guard.h>

View File

@@ -66,6 +66,7 @@ public:
static DiffEditorController *controller(Core::IDocument *document);
void branchesReceived(const QString &branches);
void requestChunkActions(QMenu *menu, int diffFileIndex, int chunkIndex);
signals:
void chunkActionsRequested(QMenu *menu, bool isValid);
@@ -87,7 +88,6 @@ protected:
private:
void requestMoreInformation();
void requestChunkActions(QMenu *menu, int diffFileIndex, int chunkIndex);
Internal::DiffEditorDocument *const m_document;

View File

@@ -71,8 +71,6 @@ void DiffEditorDocument::setController(DiffEditorController *controller)
m_controller = controller;
if (m_controller) {
connect(this, &DiffEditorDocument::chunkActionsRequested,
m_controller, &DiffEditorController::requestChunkActions);
connect(this, &DiffEditorDocument::requestMoreInformation,
m_controller, &DiffEditorController::requestMoreInformation);
}

View File

@@ -90,7 +90,6 @@ signals:
void temporaryStateChanged();
void documentChanged();
void descriptionChanged();
void chunkActionsRequested(QMenu *menu, int diffFileIndex, int chunkIndex);
void requestMoreInformation();
private:

View File

@@ -25,6 +25,7 @@
#include "diffeditorwidgetcontroller.h"
#include "diffeditorconstants.h"
#include "diffeditorcontroller.h"
#include "diffeditordocument.h"
#include <coreplugin/documentmanager.h>
@@ -247,7 +248,8 @@ bool DiffEditorWidgetController::setAndVerifyIndexes(QMenu *menu,
if (m_contextMenuChunkIndex >= fileData.chunks.count())
return false;
m_document->chunkActionsRequested(menu, diffFileIndex, chunkIndex);
if (DiffEditorController *controller = m_document->controller())
controller->requestChunkActions(menu, diffFileIndex, chunkIndex);
return true;
}