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 thisDiff = diffList.at(i);
|
||||||
Diff nextDiff = i < diffList.count() - 1
|
Diff nextDiff = i < diffList.count() - 1
|
||||||
? diffList.at(i + 1)
|
? diffList.at(i + 1)
|
||||||
: Diff(Diff::Equal, QString());
|
: Diff(Diff::Equal);
|
||||||
if (thisDiff.command == Diff::Delete
|
if (thisDiff.command == Diff::Delete
|
||||||
&& nextDiff.command == Diff::Insert) {
|
&& nextDiff.command == Diff::Insert) {
|
||||||
const int delInsOverlap = commonOverlap(thisDiff.text, nextDiff.text);
|
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) :
|
Diff::Diff(Command com, const QString &txt) :
|
||||||
command(com),
|
command(com),
|
||||||
text(txt)
|
text(txt)
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ public:
|
|||||||
Insert,
|
Insert,
|
||||||
Equal
|
Equal
|
||||||
};
|
};
|
||||||
Command command;
|
Command command = Equal;
|
||||||
QString text;
|
QString text;
|
||||||
Diff(Command com, const QString &txt = QString());
|
Diff() = default;
|
||||||
Diff();
|
Diff(Command com, const QString &txt = {});
|
||||||
bool operator==(const Diff &other) const;
|
bool operator==(const Diff &other) const;
|
||||||
bool operator!=(const Diff &other) const;
|
bool operator!=(const Diff &other) const;
|
||||||
QString toString() const;
|
QString toString() const;
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
DiffFileInfo() = default;
|
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) {}
|
: fileName(file), typeInfo(type) {}
|
||||||
QString fileName;
|
QString fileName;
|
||||||
QString typeInfo;
|
QString typeInfo;
|
||||||
@@ -61,7 +60,7 @@ public:
|
|||||||
Separator,
|
Separator,
|
||||||
Invalid
|
Invalid
|
||||||
};
|
};
|
||||||
TextLineData() {}
|
TextLineData() = default;
|
||||||
TextLineData(const QString &txt) : text(txt), textLineType(TextLine) {}
|
TextLineData(const QString &txt) : text(txt), textLineType(TextLine) {}
|
||||||
TextLineData(TextLineType t) : textLineType(t) {}
|
TextLineData(TextLineType t) : textLineType(t) {}
|
||||||
QString text;
|
QString text;
|
||||||
@@ -77,7 +76,7 @@ public:
|
|||||||
|
|
||||||
class DIFFEDITOR_EXPORT RowData {
|
class DIFFEDITOR_EXPORT RowData {
|
||||||
public:
|
public:
|
||||||
RowData() {}
|
RowData() = default;
|
||||||
RowData(const TextLineData &l)
|
RowData(const TextLineData &l)
|
||||||
: leftLine(l), rightLine(l), equal(true) {}
|
: leftLine(l), rightLine(l), equal(true) {}
|
||||||
RowData(const TextLineData &l, const TextLineData &r)
|
RowData(const TextLineData &l, const TextLineData &r)
|
||||||
@@ -89,7 +88,6 @@ public:
|
|||||||
|
|
||||||
class DIFFEDITOR_EXPORT ChunkData {
|
class DIFFEDITOR_EXPORT ChunkData {
|
||||||
public:
|
public:
|
||||||
ChunkData() {}
|
|
||||||
QList<RowData> rows;
|
QList<RowData> rows;
|
||||||
QString contextInfo;
|
QString contextInfo;
|
||||||
int leftStartingLineNumber = 0;
|
int leftStartingLineNumber = 0;
|
||||||
@@ -99,7 +97,7 @@ public:
|
|||||||
|
|
||||||
class DIFFEDITOR_EXPORT ChunkSelection {
|
class DIFFEDITOR_EXPORT ChunkSelection {
|
||||||
public:
|
public:
|
||||||
ChunkSelection() {}
|
ChunkSelection() = default;
|
||||||
ChunkSelection(const QList<int> &left, const QList<int> &right)
|
ChunkSelection(const QList<int> &left, const QList<int> &right)
|
||||||
: leftSelection(left), rightSelection(right) {}
|
: leftSelection(left), rightSelection(right) {}
|
||||||
bool isNull() const { return leftSelection.isEmpty() && rightSelection.isEmpty(); }
|
bool isNull() const { return leftSelection.isEmpty() && rightSelection.isEmpty(); }
|
||||||
@@ -119,7 +117,7 @@ public:
|
|||||||
RenameFile
|
RenameFile
|
||||||
};
|
};
|
||||||
|
|
||||||
FileData() {}
|
FileData() = default;
|
||||||
FileData(const ChunkData &chunkData) { chunks.append(chunkData); }
|
FileData(const ChunkData &chunkData) { chunks.append(chunkData); }
|
||||||
QList<ChunkData> chunks;
|
QList<ChunkData> chunks;
|
||||||
DiffFileInfo leftFileInfo;
|
DiffFileInfo leftFileInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user