forked from qt-creator/qt-creator
DiffEditor: Refactor the user-facing parts
* Move all data handling into DiffEditorDocument * Move much of the logic of how to update views into the DiffEditor. * Introduce a base class for the different views on the diff to implement. * Remove DiffEditorGuiController * Make DiffEditorController smaller and merge the DiffEditorReloader into the class * Simplify communication between the classes involved * Make much of the implementation private to the plugin Change-Id: I7ccb9df6061923bcb34cf3090d6d8331895e83c7 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#define SIDEBYSIDEDIFFEDITORWIDGET_H
|
||||
|
||||
#include "differ.h"
|
||||
#include "diffeditorcontroller.h"
|
||||
#include "diffeditordocument.h"
|
||||
#include <QWidget>
|
||||
#include <QTextCharFormat>
|
||||
|
||||
@@ -60,16 +60,23 @@ class SideBySideDiffEditorWidget : public QWidget
|
||||
public:
|
||||
explicit SideBySideDiffEditorWidget(QWidget *parent = 0);
|
||||
|
||||
void setDiffEditorGuiController(Internal::DiffEditorGuiController *controller);
|
||||
void setDocument(DiffEditorDocument *document);
|
||||
|
||||
private slots:
|
||||
void clear(const QString &message = QString());
|
||||
void clearAll(const QString &message = QString());
|
||||
void setDiff(const QList<FileData> &diffFileList,
|
||||
const QString &workingDirectory);
|
||||
|
||||
void setCurrentDiffFileIndex(int diffFileIndex);
|
||||
|
||||
void setHorizontalSync(bool sync);
|
||||
|
||||
void saveState();
|
||||
void restoreState();
|
||||
|
||||
void clear(const QString &message = QString());
|
||||
|
||||
signals:
|
||||
void currentDiffFileIndexChanged(int index);
|
||||
|
||||
private slots:
|
||||
void setFontSettings(const TextEditor::FontSettings &fontSettings);
|
||||
void slotLeftJumpToOriginalFileRequested(int diffFileIndex,
|
||||
int lineNumber, int columnNumber);
|
||||
@@ -98,16 +105,16 @@ private:
|
||||
int lineNumber, int columnNumber);
|
||||
void patch(bool revert);
|
||||
|
||||
DiffEditorGuiController *m_guiController;
|
||||
DiffEditorController *m_controller;
|
||||
DiffEditorDocument *m_document;
|
||||
SideDiffEditorWidget *m_leftEditor;
|
||||
SideDiffEditorWidget *m_rightEditor;
|
||||
QSplitter *m_splitter;
|
||||
|
||||
QList<FileData> m_contextFileData; // ultimate data to be shown, contextLinesNumber taken into account
|
||||
QList<FileData> m_contextFileData; // ultimate data to be shown, contextLineCount taken into account
|
||||
|
||||
bool m_ignoreCurrentIndexChange;
|
||||
bool m_foldingBlocker;
|
||||
bool m_horizontalSync;
|
||||
int m_contextMenuFileIndex;
|
||||
int m_contextMenuChunkIndex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user