forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user