Update to Qt::SkipEmptyParts

This commit is contained in:
zneix 2021-07-31 00:25:39 +02:00
parent 1520398984
commit 0933d68111
No known key found for this signature in database
GPG key ID: 911916E0523B22F6
7 changed files with 11 additions and 12 deletions

View file

@ -182,7 +182,7 @@ bool appendWhisperMessageWordsLocally(const QStringList &words)
bool appendWhisperMessageStringLocally(const QString &textNoEmoji)
{
QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji);
QStringList words = text.split(' ', QString::SkipEmptyParts);
QStringList words = text.split(' ', Qt::SkipEmptyParts);
if (words.length() == 0)
{
@ -832,7 +832,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
ChannelPtr channel, bool dryRun)
{
QString text = getApp()->emotes->emojis.replaceShortCodes(textNoEmoji);
QStringList words = text.split(' ', QString::SkipEmptyParts);
QStringList words = text.split(' ', Qt::SkipEmptyParts);
if (words.length() == 0)
{
@ -866,7 +866,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
text = getApp()->emotes->emojis.replaceShortCodes(
this->execCustomCommand(words, it.value(), dryRun));
words = text.split(' ', QString::SkipEmptyParts);
words = text.split(' ', Qt::SkipEmptyParts);
if (words.length() == 0)
{

View file

@ -8,7 +8,7 @@ AuthorPredicate::AuthorPredicate(const QStringList &authors)
// Check if any comma-seperated values were passed and transform those
for (const auto &entry : authors)
{
for (const auto &author : entry.split(',', QString::SkipEmptyParts))
for (const auto &author : entry.split(',', Qt::SkipEmptyParts))
{
this->authors_ << author;
}

View file

@ -8,7 +8,7 @@ ChannelPredicate::ChannelPredicate(const QStringList &channels)
// Check if any comma-seperated values were passed and transform those
for (const auto &entry : channels)
{
for (const auto &channel : entry.split(',', QString::SkipEmptyParts))
for (const auto &channel : entry.split(',', Qt::SkipEmptyParts))
{
this->channels_ << channel;
}

View file

@ -9,8 +9,7 @@ LinkPredicate::LinkPredicate()
bool LinkPredicate::appliesTo(const Message &message)
{
for (const auto &word :
message.messageText.split(' ', QString::SkipEmptyParts))
for (const auto &word : message.messageText.split(' ', Qt::SkipEmptyParts))
{
if (LinkParser(word).hasMatch())
return true;

View file

@ -6,7 +6,7 @@ MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags)
: flags_()
{
// 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")
{

View file

@ -167,7 +167,7 @@ std::vector<std::unique_ptr<MessagePredicate>> SearchPopup::parsePredicates(
static QRegularExpression predicateRegex(R"(^(\w+):([\w,]+)$)");
std::vector<std::unique_ptr<MessagePredicate>> predicates;
auto words = input.split(' ', QString::SkipEmptyParts);
auto words = input.split(' ', Qt::SkipEmptyParts);
QStringList authors;
QStringList channels;

View file

@ -59,9 +59,9 @@ CommandPage::CommandPage()
QObject::connect(button, &QPushButton::clicked, this, [] {
QFile c1settings = c1settingsPath();
c1settings.open(QIODevice::ReadOnly);
for (auto line : QString(c1settings.readAll())
.split(QRegularExpression("[\r\n]"),
QString::SkipEmptyParts))
for (auto line :
QString(c1settings.readAll())
.split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts))
{
if (int index = line.indexOf(' '); index != -1)
{