forked from qt-creator/qt-creator
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: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user