diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2017-12-06 21:30:57 +0100 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2017-12-09 14:45:37 +0000 |
commit | aae3056b336ae05de72f9a1f3e61eea2006484ba (patch) | |
tree | 9db3990eeb84a1829ee0bbc69915e0b44655188b /src/plugins/diffeditor/diffutils.h | |
parent | 53a151074ad37d12e730fbd85ec0e0675d00f6d0 (diff) |
DiffEditor: Modernize
* Use member init
* Use nullptr
* Use range-for
* omit QLatin1{String|Char} where possible
Change-Id: Ib231b747cdd9073b3d4fc6779b8e0afb2b404a31
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/diffeditor/diffutils.h')
-rw-r--r-- | src/plugins/diffeditor/diffutils.h | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/src/plugins/diffeditor/diffutils.h b/src/plugins/diffeditor/diffutils.h index ed0130bfbd..1b45102128 100644 --- a/src/plugins/diffeditor/diffutils.h +++ b/src/plugins/diffeditor/diffutils.h @@ -63,10 +63,10 @@ public: Separator, Invalid }; - TextLineData() : textLineType(Invalid) {} + TextLineData() {} TextLineData(const QString &txt) : textLineType(TextLine), text(txt) {} TextLineData(TextLineType t) : textLineType(t) {} - TextLineType textLineType; + TextLineType textLineType = Invalid; QString text; /* * <start position, end position> @@ -79,24 +79,23 @@ public: class DIFFEDITOR_EXPORT RowData { public: - RowData() : equal(false) {} + RowData() {} RowData(const TextLineData &l) : leftLine(l), rightLine(l), equal(true) {} RowData(const TextLineData &l, const TextLineData &r) - : leftLine(l), rightLine(r), equal(false) {} + : leftLine(l), rightLine(r) {} TextLineData leftLine; TextLineData rightLine; - bool equal; + bool equal = false; }; class DIFFEDITOR_EXPORT ChunkData { public: - ChunkData() : contextChunk(false), - leftStartingLineNumber(0), rightStartingLineNumber(0) {} + ChunkData() {} QList<RowData> rows; - bool contextChunk; - int leftStartingLineNumber; - int rightStartingLineNumber; + bool contextChunk = false; + int leftStartingLineNumber = 0; + int rightStartingLineNumber = 0; QString contextInfo; }; @@ -111,23 +110,15 @@ public: RenameFile }; - FileData() - : fileOperation(ChangeFile), - binaryFiles(false), - lastChunkAtTheEndOfFile(false), - contextChunksIncluded(false) {} - FileData(const ChunkData &chunkData) - : fileOperation(ChangeFile), - binaryFiles(false), - lastChunkAtTheEndOfFile(false), - contextChunksIncluded(false) { chunks.append(chunkData); } + FileData() {} + FileData(const ChunkData &chunkData) { chunks.append(chunkData); } QList<ChunkData> chunks; DiffFileInfo leftFileInfo; DiffFileInfo rightFileInfo; - FileOperation fileOperation; - bool binaryFiles; - bool lastChunkAtTheEndOfFile; - bool contextChunksIncluded; + FileOperation fileOperation = ChangeFile; + bool binaryFiles = false; + bool lastChunkAtTheEndOfFile = false; + bool contextChunksIncluded = false; }; class DIFFEDITOR_EXPORT DiffUtils { |