Fix Qt::SkipEmptyParts deprecation warning (#3726)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include "util/FormatTime.hpp"
|
#include "util/FormatTime.hpp"
|
||||||
#include "util/Helpers.hpp"
|
#include "util/Helpers.hpp"
|
||||||
#include "util/IncognitoBrowser.hpp"
|
#include "util/IncognitoBrowser.hpp"
|
||||||
|
#include "util/Qt.hpp"
|
||||||
#include "util/StreamLink.hpp"
|
#include "util/StreamLink.hpp"
|
||||||
#include "util/Twitch.hpp"
|
#include "util/Twitch.hpp"
|
||||||
#include "widgets/Window.hpp"
|
#include "widgets/Window.hpp"
|
||||||
@@ -156,7 +157,7 @@ bool appendWhisperMessageWordsLocally(const QStringList &words)
|
|||||||
bool appendWhisperMessageStringLocally(const QString &textNoEmoji)
|
bool appendWhisperMessageStringLocally(const QString &textNoEmoji)
|
||||||
{
|
{
|
||||||
QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji);
|
QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji);
|
||||||
QStringList words = text.split(' ', QString::SkipEmptyParts);
|
QStringList words = text.split(' ', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
if (words.length() == 0)
|
if (words.length() == 0)
|
||||||
{
|
{
|
||||||
@@ -970,7 +971,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
|
|||||||
ChannelPtr channel, bool dryRun)
|
ChannelPtr channel, bool dryRun)
|
||||||
{
|
{
|
||||||
QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji);
|
QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji);
|
||||||
QStringList words = text.split(' ', QString::SkipEmptyParts);
|
QStringList words = text.split(' ', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
if (words.length() == 0)
|
if (words.length() == 0)
|
||||||
{
|
{
|
||||||
@@ -1007,7 +1008,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
|
|||||||
text = getApp()->emotes->emojis.replaceShortCodes(
|
text = getApp()->emotes->emojis.replaceShortCodes(
|
||||||
this->execCustomCommand(words, it.value(), dryRun, channel));
|
this->execCustomCommand(words, it.value(), dryRun, channel));
|
||||||
|
|
||||||
words = text.split(' ', QString::SkipEmptyParts);
|
words = text.split(' ', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
if (words.length() == 0)
|
if (words.length() == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#include "messages/search/AuthorPredicate.hpp"
|
#include "messages/search/AuthorPredicate.hpp"
|
||||||
|
|
||||||
|
#include "util/Qt.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
AuthorPredicate::AuthorPredicate(const QStringList &authors)
|
AuthorPredicate::AuthorPredicate(const QStringList &authors)
|
||||||
@@ -8,7 +10,7 @@ AuthorPredicate::AuthorPredicate(const QStringList &authors)
|
|||||||
// Check if any comma-seperated values were passed and transform those
|
// Check if any comma-seperated values were passed and transform those
|
||||||
for (const auto &entry : authors)
|
for (const auto &entry : authors)
|
||||||
{
|
{
|
||||||
for (const auto &author : entry.split(',', QString::SkipEmptyParts))
|
for (const auto &author : entry.split(',', Qt::SkipEmptyParts))
|
||||||
{
|
{
|
||||||
this->authors_ << author;
|
this->authors_ << author;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#include "messages/search/ChannelPredicate.hpp"
|
#include "messages/search/ChannelPredicate.hpp"
|
||||||
|
|
||||||
|
#include "util/Qt.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
ChannelPredicate::ChannelPredicate(const QStringList &channels)
|
ChannelPredicate::ChannelPredicate(const QStringList &channels)
|
||||||
@@ -8,7 +10,7 @@ ChannelPredicate::ChannelPredicate(const QStringList &channels)
|
|||||||
// Check if any comma-seperated values were passed and transform those
|
// Check if any comma-seperated values were passed and transform those
|
||||||
for (const auto &entry : channels)
|
for (const auto &entry : channels)
|
||||||
{
|
{
|
||||||
for (const auto &channel : entry.split(',', QString::SkipEmptyParts))
|
for (const auto &channel : entry.split(',', Qt::SkipEmptyParts))
|
||||||
{
|
{
|
||||||
this->channels_ << channel;
|
this->channels_ << channel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#include "messages/search/LinkPredicate.hpp"
|
#include "messages/search/LinkPredicate.hpp"
|
||||||
|
|
||||||
#include "common/LinkParser.hpp"
|
#include "common/LinkParser.hpp"
|
||||||
|
#include "util/Qt.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
@@ -9,8 +11,7 @@ LinkPredicate::LinkPredicate()
|
|||||||
|
|
||||||
bool LinkPredicate::appliesTo(const Message &message)
|
bool LinkPredicate::appliesTo(const Message &message)
|
||||||
{
|
{
|
||||||
for (const auto &word :
|
for (const auto &word : message.messageText.split(' ', Qt::SkipEmptyParts))
|
||||||
message.messageText.split(' ', QString::SkipEmptyParts))
|
|
||||||
{
|
{
|
||||||
if (LinkParser(word).hasMatch())
|
if (LinkParser(word).hasMatch())
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#include "messages/search/MessageFlagsPredicate.hpp"
|
#include "messages/search/MessageFlagsPredicate.hpp"
|
||||||
|
|
||||||
|
#include "util/Qt.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags)
|
MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags)
|
||||||
: flags_()
|
: flags_()
|
||||||
{
|
{
|
||||||
// Check if any comma-seperated values were passed and transform those
|
// Check if any comma-seperated values were passed and transform those
|
||||||
for (const auto &flag : flags.split(',', QString::SkipEmptyParts))
|
for (const auto &flag : flags.split(',', Qt::SkipEmptyParts))
|
||||||
{
|
{
|
||||||
if (flag == "deleted" || flag == "disabled")
|
if (flag == "deleted" || flag == "disabled")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
|
namespace Qt {
|
||||||
|
const QString::SplitBehavior SkipEmptyParts = QString::SkipEmptyParts;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "widgets/helper/EditableModelView.hpp"
|
#include "widgets/helper/EditableModelView.hpp"
|
||||||
//#include "widgets/helper/ComboBoxItemDelegate.hpp"
|
//#include "widgets/helper/ComboBoxItemDelegate.hpp"
|
||||||
#include "util/CombinePath.hpp"
|
#include "util/CombinePath.hpp"
|
||||||
|
#include "util/Qt.hpp"
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
@@ -59,9 +60,9 @@ CommandPage::CommandPage()
|
|||||||
QObject::connect(button, &QPushButton::clicked, this, [] {
|
QObject::connect(button, &QPushButton::clicked, this, [] {
|
||||||
QFile c1settings = c1settingsPath();
|
QFile c1settings = c1settingsPath();
|
||||||
c1settings.open(QIODevice::ReadOnly);
|
c1settings.open(QIODevice::ReadOnly);
|
||||||
for (auto line : QString(c1settings.readAll())
|
for (auto line :
|
||||||
.split(QRegularExpression("[\r\n]"),
|
QString(c1settings.readAll())
|
||||||
QString::SkipEmptyParts))
|
.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts))
|
||||||
{
|
{
|
||||||
if (int index = line.indexOf(' '); index != -1)
|
if (int index = line.indexOf(' '); index != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user