mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Update to Qt::SkipEmptyParts
This commit is contained in:
parent
1520398984
commit
0933d68111
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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")
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue