forked from qt-creator/qt-creator
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:
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "diffeditorcontroller.h"
|
|
||||||
|
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <utils/guard.h>
|
#include <utils/guard.h>
|
||||||
|
@@ -66,6 +66,7 @@ public:
|
|||||||
static DiffEditorController *controller(Core::IDocument *document);
|
static DiffEditorController *controller(Core::IDocument *document);
|
||||||
|
|
||||||
void branchesReceived(const QString &branches);
|
void branchesReceived(const QString &branches);
|
||||||
|
void requestChunkActions(QMenu *menu, int diffFileIndex, int chunkIndex);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void chunkActionsRequested(QMenu *menu, bool isValid);
|
void chunkActionsRequested(QMenu *menu, bool isValid);
|
||||||
@@ -87,7 +88,6 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void requestMoreInformation();
|
void requestMoreInformation();
|
||||||
void requestChunkActions(QMenu *menu, int diffFileIndex, int chunkIndex);
|
|
||||||
|
|
||||||
Internal::DiffEditorDocument *const m_document;
|
Internal::DiffEditorDocument *const m_document;
|
||||||
|
|
||||||
|
@@ -71,8 +71,6 @@ void DiffEditorDocument::setController(DiffEditorController *controller)
|
|||||||
m_controller = controller;
|
m_controller = controller;
|
||||||
|
|
||||||
if (m_controller) {
|
if (m_controller) {
|
||||||
connect(this, &DiffEditorDocument::chunkActionsRequested,
|
|
||||||
m_controller, &DiffEditorController::requestChunkActions);
|
|
||||||
connect(this, &DiffEditorDocument::requestMoreInformation,
|
connect(this, &DiffEditorDocument::requestMoreInformation,
|
||||||
m_controller, &DiffEditorController::requestMoreInformation);
|
m_controller, &DiffEditorController::requestMoreInformation);
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,6 @@ signals:
|
|||||||
void temporaryStateChanged();
|
void temporaryStateChanged();
|
||||||
void documentChanged();
|
void documentChanged();
|
||||||
void descriptionChanged();
|
void descriptionChanged();
|
||||||
void chunkActionsRequested(QMenu *menu, int diffFileIndex, int chunkIndex);
|
|
||||||
void requestMoreInformation();
|
void requestMoreInformation();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "diffeditorwidgetcontroller.h"
|
#include "diffeditorwidgetcontroller.h"
|
||||||
#include "diffeditorconstants.h"
|
#include "diffeditorconstants.h"
|
||||||
|
#include "diffeditorcontroller.h"
|
||||||
#include "diffeditordocument.h"
|
#include "diffeditordocument.h"
|
||||||
|
|
||||||
#include <coreplugin/documentmanager.h>
|
#include <coreplugin/documentmanager.h>
|
||||||
@@ -247,7 +248,8 @@ bool DiffEditorWidgetController::setAndVerifyIndexes(QMenu *menu,
|
|||||||
if (m_contextMenuChunkIndex >= fileData.chunks.count())
|
if (m_contextMenuChunkIndex >= fileData.chunks.count())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_document->chunkActionsRequested(menu, diffFileIndex, chunkIndex);
|
if (DiffEditorController *controller = m_document->controller())
|
||||||
|
controller->requestChunkActions(menu, diffFileIndex, chunkIndex);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user