Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-03-18 12:17:19 +0300
committerGitHub <noreply@github.com>2021-03-18 12:17:19 +0300
commit2e31fe956a1acf172b8d0559f7ed308acf947625 (patch)
tree2622dc0da59a5669fd9f38644c9f991e8d943507 /src
parente8ca55b36d7bea3e932ce94958843a24111efa2c (diff)
parent8a3847c7d390678019134d9875acd46db0217312 (diff)
Merge pull request #4875: FIX(client, ui): Ordering of Users inconsistent
If two persons are reading out the users in a channel in the order they are rendered, chances are that they will read the names in a different order. This is because the ordering of users takes the currently used locale into account that can differ from machine to machine. This is an inconsistency that one probably does not expect. Therefore this commit changes back to using a lexicographical comparison that should be the same on all machines, regardless of the locale. Fixes #4873
Diffstat (limited to 'src')
-rw-r--r--src/User.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/User.cpp b/src/User.cpp
index 893ccc5ae..58e8c1c0a 100644
--- a/src/User.cpp
+++ b/src/User.cpp
@@ -18,5 +18,8 @@ User::User() {
}
bool User::lessThan(const User *first, const User *second) {
- return (QString::localeAwareCompare(first->qsName, second->qsName) < 0);
+ // We explicitly don't use localeAwareCompare as this would result in a different
+ // ordering of users on clients with different locales. This is not what one would
+ // expect and thus we don't take the locale into account for comparing users.
+ return QString::compare(first->qsName, second->qsName) < 0;
}