Use same sorting method in emote popup as in the completion model
Fixes #1549
This commit is contained in:
@@ -38,13 +38,7 @@ bool CompletionModel::TaggedString::operator<(const TaggedString &that) const
|
||||
return this->isEmote();
|
||||
}
|
||||
|
||||
// try comparing insensitively, if they are the same then senstively
|
||||
// (fixes order of LuL and LUL)
|
||||
int k = QString::compare(this->string, that.string, Qt::CaseInsensitive);
|
||||
if (k == 0)
|
||||
return this->string > that.string;
|
||||
|
||||
return k < 0;
|
||||
return CompletionModel::compareStrings(this->string, that.string);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -191,4 +185,15 @@ void CompletionModel::refresh(const QString &prefix, bool isFirstWord)
|
||||
}
|
||||
}
|
||||
|
||||
bool CompletionModel::compareStrings(const QString &a, const QString &b)
|
||||
{
|
||||
// try comparing insensitively, if they are the same then senstively
|
||||
// (fixes order of LuL and LUL)
|
||||
int k = QString::compare(a, b, Qt::CaseInsensitive);
|
||||
if (k == 0)
|
||||
return a > b;
|
||||
|
||||
return k < 0;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user