Commit d2c7aad8 authored by dt's avatar dt Committed by con
Browse files

FlatModel: Fix sorting

Mea culpa
parent 216bdca7
...@@ -78,7 +78,7 @@ bool sortNodes(Node *n1, Node *n2) ...@@ -78,7 +78,7 @@ bool sortNodes(Node *n1, Node *n2)
int result = fileNameCompare(fileName1, fileName2); int result = fileNameCompare(fileName1, fileName2);
if (result != 0) if (result != 0)
return result; return result < 0;
else else
return file1 < file2; return file1 < file2;
} else { } else {
...@@ -98,7 +98,7 @@ bool sortNodes(Node *n1, Node *n2) ...@@ -98,7 +98,7 @@ bool sortNodes(Node *n1, Node *n2)
int result = fileNameCompare(project1->displayName(), project2->displayName()); int result = fileNameCompare(project1->displayName(), project2->displayName());
if (result != 0) if (result != 0)
return result; return result < 0;
else else
return project1 < project2; // sort by pointer value return project1 < project2; // sort by pointer value
} else { } else {
...@@ -115,7 +115,7 @@ bool sortNodes(Node *n1, Node *n2) ...@@ -115,7 +115,7 @@ bool sortNodes(Node *n1, Node *n2)
int result = fileNameCompare(folder1->path(), folder2->path()); int result = fileNameCompare(folder1->path(), folder2->path());
if (result != 0) if (result != 0)
return result; return result < 0;
else else
return folder1 < folder2; return folder1 < folder2;
} else { } else {
...@@ -135,11 +135,11 @@ bool sortNodes(Node *n1, Node *n2) ...@@ -135,11 +135,11 @@ bool sortNodes(Node *n1, Node *n2)
int result = fileNameCompare(fileName1, fileName2); int result = fileNameCompare(fileName1, fileName2);
if (result != 0) { if (result != 0) {
return result; // sort by filename return result < 0; // sort by filename
} else { } else {
result = fileNameCompare(filePath1, filePath2); result = fileNameCompare(filePath1, filePath2);
if (result != 0) { if (result != 0) {
return result; // sort by filepath return result < 0; // sort by filepath
} else { } else {
return n1 < n2; // sort by pointer value return n1 < n2; // sort by pointer value
} }
......
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