chore: silence some deprecation warnings in Qt 6.8 (#5529)
This commit is contained in:
@@ -28,7 +28,7 @@ void parseEmoji(const std::shared_ptr<EmojiData> &emojiData,
|
||||
const rapidjson::Value &unparsedEmoji,
|
||||
const QString &shortCode = {})
|
||||
{
|
||||
std::vector<uint32_t> unicodeBytes{};
|
||||
std::vector<char32_t> unicodeBytes{};
|
||||
|
||||
struct {
|
||||
bool apple;
|
||||
@@ -82,7 +82,7 @@ void parseEmoji(const std::shared_ptr<EmojiData> &emojiData,
|
||||
for (const QString &unicodeCharacter : unicodeCharacters)
|
||||
{
|
||||
bool ok{false};
|
||||
unicodeBytes.push_back(QString(unicodeCharacter).toUInt(&ok, 16));
|
||||
unicodeBytes.push_back(unicodeCharacter.toUInt(&ok, 16));
|
||||
if (!ok)
|
||||
{
|
||||
qCWarning(chatterinoEmoji)
|
||||
@@ -92,14 +92,15 @@ void parseEmoji(const std::shared_ptr<EmojiData> &emojiData,
|
||||
}
|
||||
|
||||
// We can safely do a narrowing static cast since unicodeBytes will never be a large number
|
||||
emojiData->value = QString::fromUcs4(unicodeBytes.data(),
|
||||
static_cast<int>(unicodeBytes.size()));
|
||||
emojiData->value =
|
||||
QString::fromUcs4(unicodeBytes.data(),
|
||||
static_cast<QString::size_type>(unicodeBytes.size()));
|
||||
|
||||
if (!emojiData->nonQualifiedCode.isEmpty())
|
||||
{
|
||||
QStringList nonQualifiedCharacters =
|
||||
emojiData->nonQualifiedCode.toLower().split('-');
|
||||
std::vector<uint32_t> nonQualifiedBytes{};
|
||||
std::vector<char32_t> nonQualifiedBytes{};
|
||||
for (const QString &unicodeCharacter : nonQualifiedCharacters)
|
||||
{
|
||||
bool ok{false};
|
||||
@@ -115,9 +116,9 @@ void parseEmoji(const std::shared_ptr<EmojiData> &emojiData,
|
||||
}
|
||||
|
||||
// We can safely do a narrowing static cast since unicodeBytes will never be a large number
|
||||
emojiData->nonQualified =
|
||||
QString::fromUcs4(nonQualifiedBytes.data(),
|
||||
static_cast<int>(nonQualifiedBytes.size()));
|
||||
emojiData->nonQualified = QString::fromUcs4(
|
||||
nonQualifiedBytes.data(),
|
||||
static_cast<QString::size_type>(nonQualifiedBytes.size()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ void TwitchAccount::loadUserstateEmotes(std::weak_ptr<Channel> weakChannel)
|
||||
}
|
||||
|
||||
// filter out emote sets from userstate message, which are not in fetched emote set list
|
||||
for (const auto &emoteSetKey : qAsConst(this->userstateEmoteSets_))
|
||||
for (const auto &emoteSetKey : this->userstateEmoteSets_)
|
||||
{
|
||||
if (!existingEmoteSetKeys.contains(emoteSetKey))
|
||||
{
|
||||
|
||||
@@ -1185,7 +1185,11 @@ void TwitchMessageBuilder::processIgnorePhrases(
|
||||
QRegularExpression emoteregex(
|
||||
"\\b" + emote.name.string + "\\b",
|
||||
QRegularExpression::UseUnicodePropertiesOption);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
auto match = emoteregex.matchView(midExtendedRef);
|
||||
#else
|
||||
auto match = emoteregex.match(midExtendedRef);
|
||||
#endif
|
||||
if (match.hasMatch())
|
||||
{
|
||||
emote.start = static_cast<int>(from + match.capturedStart());
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTimeZone>
|
||||
#include <QUrl>
|
||||
#include <QUrlQuery>
|
||||
|
||||
@@ -722,7 +723,7 @@ struct HelixShieldModeStatus {
|
||||
, lastActivatedAt(QDateTime::fromString(
|
||||
json["last_activated_at"].toString(), Qt::ISODate))
|
||||
{
|
||||
this->lastActivatedAt.setTimeSpec(Qt::UTC);
|
||||
this->lastActivatedAt.setTimeZone(QTimeZone::utc());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user