From 0933d6811149ec754f4493908aaca4486c87f990 Mon Sep 17 00:00:00 2001 From: zneix Date: Sat, 31 Jul 2021 00:25:39 +0200 Subject: [PATCH] Update to Qt::SkipEmptyParts --- src/controllers/commands/CommandController.cpp | 6 +++--- src/messages/search/AuthorPredicate.cpp | 2 +- src/messages/search/ChannelPredicate.cpp | 2 +- src/messages/search/LinkPredicate.cpp | 3 +-- src/messages/search/MessageFlagsPredicate.cpp | 2 +- src/widgets/helper/SearchPopup.cpp | 2 +- src/widgets/settingspages/CommandPage.cpp | 6 +++--- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index fcca4a2f9..3c59f3795 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -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) { diff --git a/src/messages/search/AuthorPredicate.cpp b/src/messages/search/AuthorPredicate.cpp index 8e1b73280..fb0e89dbf 100644 --- a/src/messages/search/AuthorPredicate.cpp +++ b/src/messages/search/AuthorPredicate.cpp @@ -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; } diff --git a/src/messages/search/ChannelPredicate.cpp b/src/messages/search/ChannelPredicate.cpp index 0c1980c1f..f46ad454c 100644 --- a/src/messages/search/ChannelPredicate.cpp +++ b/src/messages/search/ChannelPredicate.cpp @@ -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; } diff --git a/src/messages/search/LinkPredicate.cpp b/src/messages/search/LinkPredicate.cpp index 41fec567b..63eb9c042 100644 --- a/src/messages/search/LinkPredicate.cpp +++ b/src/messages/search/LinkPredicate.cpp @@ -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; diff --git a/src/messages/search/MessageFlagsPredicate.cpp b/src/messages/search/MessageFlagsPredicate.cpp index da8ed64cd..1765e06aa 100644 --- a/src/messages/search/MessageFlagsPredicate.cpp +++ b/src/messages/search/MessageFlagsPredicate.cpp @@ -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") { diff --git a/src/widgets/helper/SearchPopup.cpp b/src/widgets/helper/SearchPopup.cpp index e6f8c8e89..7cf76e343 100644 --- a/src/widgets/helper/SearchPopup.cpp +++ b/src/widgets/helper/SearchPopup.cpp @@ -167,7 +167,7 @@ std::vector> SearchPopup::parsePredicates( static QRegularExpression predicateRegex(R"(^(\w+):([\w,]+)$)"); std::vector> predicates; - auto words = input.split(' ', QString::SkipEmptyParts); + auto words = input.split(' ', Qt::SkipEmptyParts); QStringList authors; QStringList channels; diff --git a/src/widgets/settingspages/CommandPage.cpp b/src/widgets/settingspages/CommandPage.cpp index 7dc72c55f..4776ebd1f 100644 --- a/src/widgets/settingspages/CommandPage.cpp +++ b/src/widgets/settingspages/CommandPage.cpp @@ -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) {