Commit 4d7c010a authored by Daniel Teske's avatar Daniel Teske
Browse files

FlatModel: Sort file nodes according to displaname first



So far the filename and displayname was the same for all filenodes. That
changes with the ResourceNodes, so adjust the flatmodel.

Task-number: QTCREATORBUG-11590

Change-Id: Id5a7ecda8963b64a6ebccc589b38f428366da3fd
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 56ae18e5
......@@ -136,13 +136,17 @@ bool sortNodes(Node *n1, Node *n2)
// must be file nodes
{
int result = caseFriendlyCompare(n1->displayName(), n2->displayName());
if (result != 0)
return result < 0;
const QString filePath1 = n1->path();
const QString filePath2 = n2->path();
const QString fileName1 = QFileInfo(filePath1).fileName();
const QString fileName2 = QFileInfo(filePath2).fileName();
int result = caseFriendlyCompare(fileName1, fileName2);
result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0) {
return result < 0; // sort by filename
} else {
......
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