forked from qt-creator/qt-creator
DiffEditor: Rely on compiler generated constructors
Change-Id: I16527f2f971fa110ceb0b35755a1f49663ccb460 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -159,7 +159,7 @@ static QList<Diff> cleanupOverlaps(const QList<Diff> &diffList)
|
||||
Diff thisDiff = diffList.at(i);
|
||||
Diff nextDiff = i < diffList.count() - 1
|
||||
? diffList.at(i + 1)
|
||||
: Diff(Diff::Equal, QString());
|
||||
: Diff(Diff::Equal);
|
||||
if (thisDiff.command == Diff::Delete
|
||||
&& nextDiff.command == Diff::Insert) {
|
||||
const int delInsOverlap = commonOverlap(thisDiff.text, nextDiff.text);
|
||||
@@ -926,12 +926,6 @@ void Differ::diffBetweenEqualities(const QList<Diff> &leftInput,
|
||||
|
||||
///////////////
|
||||
|
||||
|
||||
Diff::Diff() :
|
||||
command(Diff::Equal)
|
||||
{
|
||||
}
|
||||
|
||||
Diff::Diff(Command com, const QString &txt) :
|
||||
command(com),
|
||||
text(txt)
|
||||
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
Insert,
|
||||
Equal
|
||||
};
|
||||
Command command;
|
||||
Command command = Equal;
|
||||
QString text;
|
||||
Diff(Command com, const QString &txt = QString());
|
||||
Diff();
|
||||
Diff() = default;
|
||||
Diff(Command com, const QString &txt = {});
|
||||
bool operator==(const Diff &other) const;
|
||||
bool operator!=(const Diff &other) const;
|
||||
QString toString() const;
|
||||
|
||||
@@ -46,8 +46,7 @@ public:
|
||||
};
|
||||
|
||||
DiffFileInfo() = default;
|
||||
DiffFileInfo(const QString &file) : fileName(file) {}
|
||||
DiffFileInfo(const QString &file, const QString &type)
|
||||
DiffFileInfo(const QString &file, const QString &type = {})
|
||||
: fileName(file), typeInfo(type) {}
|
||||
QString fileName;
|
||||
QString typeInfo;
|
||||
@@ -61,7 +60,7 @@ public:
|
||||
Separator,
|
||||
Invalid
|
||||
};
|
||||
TextLineData() {}
|
||||
TextLineData() = default;
|
||||
TextLineData(const QString &txt) : text(txt), textLineType(TextLine) {}
|
||||
TextLineData(TextLineType t) : textLineType(t) {}
|
||||
QString text;
|
||||
@@ -77,7 +76,7 @@ public:
|
||||
|
||||
class DIFFEDITOR_EXPORT RowData {
|
||||
public:
|
||||
RowData() {}
|
||||
RowData() = default;
|
||||
RowData(const TextLineData &l)
|
||||
: leftLine(l), rightLine(l), equal(true) {}
|
||||
RowData(const TextLineData &l, const TextLineData &r)
|
||||
@@ -89,7 +88,6 @@ public:
|
||||
|
||||
class DIFFEDITOR_EXPORT ChunkData {
|
||||
public:
|
||||
ChunkData() {}
|
||||
QList<RowData> rows;
|
||||
QString contextInfo;
|
||||
int leftStartingLineNumber = 0;
|
||||
@@ -99,7 +97,7 @@ public:
|
||||
|
||||
class DIFFEDITOR_EXPORT ChunkSelection {
|
||||
public:
|
||||
ChunkSelection() {}
|
||||
ChunkSelection() = default;
|
||||
ChunkSelection(const QList<int> &left, const QList<int> &right)
|
||||
: leftSelection(left), rightSelection(right) {}
|
||||
bool isNull() const { return leftSelection.isEmpty() && rightSelection.isEmpty(); }
|
||||
@@ -119,7 +117,7 @@ public:
|
||||
RenameFile
|
||||
};
|
||||
|
||||
FileData() {}
|
||||
FileData() = default;
|
||||
FileData(const ChunkData &chunkData) { chunks.append(chunkData); }
|
||||
QList<ChunkData> chunks;
|
||||
DiffFileInfo leftFileInfo;
|
||||
|
||||
Reference in New Issue
Block a user