Fix Qt6 building (#4393)

This commit is contained in:
pajlada
2023-02-19 20:19:18 +01:00
committed by GitHub
parent d3499e814e
commit c95a65c153
22 changed files with 114 additions and 37 deletions
+13 -3
View File
@@ -821,14 +821,14 @@ void TwitchMessageBuilder::runIgnoreReplaces(
};
auto addReplEmotes = [&twitchEmotes](const IgnorePhrase &phrase,
const QStringRef &midrepl,
const auto &midrepl,
int startIndex) mutable {
if (!phrase.containsEmote())
{
return;
}
QVector<QStringRef> words = midrepl.split(' ');
auto words = midrepl.split(' ');
int pos = 0;
for (const auto &word : words)
{
@@ -843,7 +843,7 @@ void TwitchMessageBuilder::runIgnoreReplaces(
}
twitchEmotes.push_back(TwitchEmoteOccurrence{
startIndex + pos,
startIndex + pos + emote.first.string.length(),
startIndex + pos + (int)emote.first.string.length(),
emote.second,
emote.first,
});
@@ -904,8 +904,13 @@ void TwitchMessageBuilder::runIgnoreReplaces(
shiftIndicesAfter(from + len, midsize - len);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
auto midExtendedRef =
QStringView{this->originalMessage_}.mid(pos1, pos2 - pos1);
#else
auto midExtendedRef =
this->originalMessage_.midRef(pos1, pos2 - pos1);
#endif
for (auto &tup : vret)
{
@@ -969,8 +974,13 @@ void TwitchMessageBuilder::runIgnoreReplaces(
shiftIndicesAfter(from + len, replacesize - len);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
auto midExtendedRef =
QStringView{this->originalMessage_}.mid(pos1, pos2 - pos1);
#else
auto midExtendedRef =
this->originalMessage_.midRef(pos1, pos2 - pos1);
#endif
for (auto &tup : vret)
{