Commit 096bc3b0 authored by jkobus's avatar jkobus Committed by Jarek Kobus
Browse files

Add default arg to Diff ctor



Change-Id: I97d4b99250d55216ef866f7529ca423e2133db09
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent a74b59ff
......@@ -516,7 +516,7 @@ QList<Diff> Differ::diffNonCharMode(const QString text1, const QString text2)
for (int i = 0; i <= diffList.count(); i++) {
const Diff diffItem = i < diffList.count()
? diffList.at(i)
: Diff(Diff::Equal, QLatin1String("")); // dummy, ensure we process to the end even when diffList doesn't end with equality
: Diff(Diff::Equal); // dummy, ensure we process to the end even when diffList doesn't end with equality
if (diffItem.command == Diff::Delete) {
lastDelete += diffItem.text;
} else if (diffItem.command == Diff::Insert) {
......@@ -605,7 +605,7 @@ QList<Diff> Differ::merge(const QList<Diff> &diffList)
for (int i = 0; i <= diffList.count(); i++) {
Diff diff = i < diffList.count()
? diffList.at(i)
: Diff(Diff::Equal, QString()); // dummy, ensure we process to the end even when diffList doesn't end with equality
: Diff(Diff::Equal); // dummy, ensure we process to the end even when diffList doesn't end with equality
if (diff.command == Diff::Delete) {
lastDelete += diff.text;
} else if (diff.command == Diff::Insert) {
......@@ -685,7 +685,7 @@ QList<Diff> Differ::cleanupSemantics(const QList<Diff> &diffList)
for (int i = 0; i <= diffList.count(); i++) {
Diff diff = i < diffList.count()
? diffList.at(i)
: Diff(Diff::Equal, QString()); // dummy, ensure we process to the end even when diffList doesn't end with equality
: Diff(Diff::Equal); // dummy, ensure we process to the end even when diffList doesn't end with equality
if (diff.command == Diff::Equal) {
if (!equalities.isEmpty()) {
EqualityData &previousData = equalities.last();
......
......@@ -50,7 +50,7 @@ public:
};
Command command;
QString text;
Diff(Command com, const QString &txt);
Diff(Command com, const QString &txt = QString());
Diff();
bool operator==(const Diff &other) const;
bool operator!=(const Diff &other) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment