This commit is contained in:
fourtf 2018-08-14 17:34:45 +02:00
parent c4e3bf1a8c
commit 902fe684c0
2 changed files with 8 additions and 5 deletions

View file

@ -82,7 +82,8 @@ void CompletionModel::refresh(const QString &prefix)
if (prefix.length() < 2) return;
auto addString = [&](const QString &str, TaggedString::Type type) {
if (str.startsWith(prefix)) this->items_.emplace(str + " ", type);
if (str.startsWith(prefix, Qt::CaseInsensitive))
this->items_.emplace(str + " ", type);
};
if (auto channel = dynamic_cast<TwitchChannel *>(&this->channel_)) {

View file

@ -85,8 +85,8 @@ UsernameSet::ConstIterator UsernameSet::Range::end()
//
Prefix::Prefix(const QString &string)
: first(string.size() >= 1 ? string[0] : '\0')
, second(string.size() >= 2 ? string[1] : '\0')
: first(string.size() >= 1 ? string[0].toLower() : '\0')
, second(string.size() >= 2 ? string[1].toLower() : '\0')
{
}
@ -101,9 +101,11 @@ bool Prefix::isStartOf(const QString &string) const
if (string.size() == 0) {
return this->first == QChar('\0') && this->second == QChar('\0');
} else if (string.size() == 1) {
return this->first == string[0] && this->second == QChar('\0');
return this->first == string[0].toLower() &&
this->second == QChar('\0');
} else {
return this->first == string[0] && this->second == string[1];
return this->first == string[0].toLower() &&
this->second == string[1].toLower();
}
}