Utils: Introduce case friendly comparison function to stringutils

Use this operator in the miniprojecttargetselector as well as the
projectconfigurationmodel. This should unify the sorting of
build-/deploy- and runconfigurations in various places in Creator.

Task-number: QTCREATORBUG-20023
Change-Id: I7aed2ebcb9d65244395d68b7dc5da599d6503962
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2018-03-13 15:54:27 +01:00
parent a5d6fe33cb
commit 37b86c89d1
6 changed files with 15 additions and 15 deletions

View File

@@ -367,4 +367,12 @@ QTCREATOR_UTILS_EXPORT int parseUsedPortFromNetstatOutput(const QByteArray &line
return port;
}
int caseFriendlyCompare(const QString &a, const QString &b)
{
int result = a.compare(b, Qt::CaseInsensitive);
if (result != 0)
return result;
return a.compare(b, Qt::CaseSensitive);
}
} // namespace Utils