forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
André Hartmann
parent
53a151074a
commit
aae3056b33
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user