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) 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)
{ {
@ -832,7 +832,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)
{ {
@ -866,7 +866,7 @@ QString CommandController::execCommand(const QString &textNoEmoji,
text = getApp()->emotes->emojis.replaceShortCodes( text = getApp()->emotes->emojis.replaceShortCodes(
this->execCustomCommand(words, it.value(), dryRun)); this->execCustomCommand(words, it.value(), dryRun));
words = text.split(' ', QString::SkipEmptyParts); words = text.split(' ', Qt::SkipEmptyParts);
if (words.length() == 0) 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 // 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;
} }

View file

@ -8,7 +8,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;
} }

View file

@ -9,8 +9,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;

View file

@ -6,7 +6,7 @@ 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")
{ {

View file

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

View file

@ -59,9 +59,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)
{ {