Commit 47800614 authored by Tobias Hunger's avatar Tobias Hunger

ProjectNodes: Sort based on line numbers

Sort filenodes based on filenumbers if filenames are identical.

Fall back to comparing pointers only if the line numbers are also
the same.

Change-Id: I5e53f01c2b4684307895a57a2d1b27507e218af3
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 10e01db4
......@@ -149,8 +149,10 @@ bool sortNodes(Node *n1, Node *n2)
result = caseFriendlyCompare(filePath1, filePath2);
if (result != 0)
return result < 0; // sort by filepath
else
return n1 < n2; // sort by pointer value
if (n1->line() != n2->line())
return n1->line() < n2->line(); // sort by line numbers
return n1 < n2; // sort by pointer value
}
}
return false;
......
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