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
@@ -1,5 +1,6 @@
#include "providers/bttv/liveupdates/BttvLiveUpdateSubscription.hpp"
#include <QDebug>
#include <QJsonDocument>
namespace chatterino {
+2 -1
View File
@@ -94,7 +94,8 @@ void IrcServer::initializeConnectionSignals(IrcConnection *connection,
QObject::connect(connection, &Communi::IrcConnection::nickNameRequired,
this, [](const QString &reserved, QString *result) {
*result = reserved + (std::rand() % 100);
*result = QString("%1%2").arg(
reserved, QString::number(std::rand() % 100));
});
QObject::connect(connection, &Communi::IrcConnection::noticeMessageReceived,
+1 -1
View File
@@ -325,7 +325,7 @@ std::shared_ptr<Channel> TwitchIrcServer::getChannelOrEmptyByID(
continue;
if (twitchChannel->roomId() == channelId &&
twitchChannel->getName().splitRef(":").size() < 3)
twitchChannel->getName().count(':') < 2)
{
return twitchChannel;
}
+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)
{