DiffEditor: Share "failed" state among multiple views

Change-Id: Id049ce8eafcb21d5e60fae17c47df8657c0e5779
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jarek Kobus
2017-07-03 11:26:52 +02:00
parent 6509753e86
commit 13fc3c8313
5 changed files with 43 additions and 15 deletions

View File

@@ -46,6 +46,12 @@ public:
DiffEditorController *controller() const;
enum State {
LoadOK,
Reloading,
LoadFailed
};
QString makePatch(int fileIndex, int chunkIndex,
bool revert, bool addPrefix = false,
const QString &overriddenFileName = QString()) const;
@@ -76,7 +82,7 @@ public:
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
OpenResult open(QString *errorString, const QString &fileName,
const QString &realFileName) override;
bool isReloading() const { return m_isReloading; }
State state() const { return m_state; }
void beginReload();
void endReload(bool success);
@@ -100,7 +106,7 @@ private:
int m_contextLineCount;
bool m_isContextLineCountForced;
bool m_ignoreWhitespace;
bool m_isReloading = false;
State m_state = LoadOK;
friend class ::DiffEditor::DiffEditorController;
};