Commit 4fba26cf authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port to QRegularExpression

parent fe3edbc7
Pipeline #185521 passed with stage
in 2 minutes and 45 seconds
......@@ -12,9 +12,10 @@
using namespace KMBox;
const QRegularExpression MBoxPrivate::mSeparatorMatcher(QStringLiteral("^From .*[0-9][0-9]:[0-9][0-9]"));
MBoxPrivate::MBoxPrivate(MBox *mbox)
: mMBox(mbox)
, mSeparatorMatcher(QStringLiteral("^From .*[0-9][0-9]:[0-9][0-9]"))
, mLockType(MBox::None)
{
connect(&mUnlockTimer, &QTimer::timeout, this, &MBoxPrivate::unlockMBox);
......@@ -210,7 +211,7 @@ bool MBoxPrivate::isMBoxSeparator(const QByteArray &line) const
return false;
}
return mSeparatorMatcher.indexIn(QString::fromLatin1(line)) >= 0;
return mSeparatorMatcher.match(QLatin1String(line)).hasMatch();
}
#undef STRDIM
......@@ -10,7 +10,7 @@
#include <QFile>
#include <QObject>
#include <QRegExp>
#include <QRegularExpression>
#include <QTimer>
namespace KMBox
......@@ -45,7 +45,7 @@ public:
MBox *const mMBox;
QFile mMboxFile;
QTimer mUnlockTimer;
QRegExp mSeparatorMatcher;
static const QRegularExpression mSeparatorMatcher;
MBox::LockType mLockType;
bool mFileLocked = false;
bool mReadOnly = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment