summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-11-05 07:26:53 +0100
committerMontel Laurent <[email protected]>2015-11-05 07:26:53 +0100
commitae5e3beb647685881e324bb3e19c51ddd258399f (patch)
tree39e904df2f9b01faf05c56fab09dd98daca74308
parent86030218ccb24f98f9acb2bbcb9023176fdf44df (diff)
Use QRegularExpression here
-rw-r--r--agents/archivemailagent/archivemailmanager.cpp5
-rw-r--r--agents/archivemailagent/archivemailwidget.cpp4
-rw-r--r--agents/followupreminderagent/autotests/followupreminderconfigtest.cpp3
-rw-r--r--agents/followupreminderagent/autotests/followupreminderconfigtest.h4
-rw-r--r--agents/followupreminderagent/followupremindermanager.cpp3
-rw-r--r--agents/sendlateragent/autotests/sendlaterconfigtest.cpp2
-rw-r--r--agents/sendlateragent/autotests/sendlaterconfigtest.h4
-rw-r--r--agents/sendlateragent/sendlatermanager.cpp3
-rw-r--r--mailcommon/src/search/searchpattern.cpp1
-rw-r--r--mailcommon/src/search/searchrule/searchrule.cpp1
10 files changed, 16 insertions, 14 deletions
diff --git a/agents/archivemailagent/archivemailmanager.cpp b/agents/archivemailagent/archivemailmanager.cpp
index e236f31..55b2850 100644
--- a/agents/archivemailagent/archivemailmanager.cpp
+++ b/agents/archivemailagent/archivemailmanager.cpp
@@ -31,6 +31,7 @@
#include <QDate>
#include <QFile>
#include <QDir>
+#include <QRegularExpression>
ArchiveMailManager::ArchiveMailManager(QObject *parent)
: QObject(parent)
@@ -62,7 +63,7 @@ void ArchiveMailManager::load()
qDeleteAll(mListArchiveInfo);
mListArchiveInfo.clear();
- const QStringList collectionList = mConfig->groupList().filter(QRegExp(QStringLiteral("ArchiveMailCollection \\d+")));
+ const QStringList collectionList = mConfig->groupList().filter(QRegularExpression(QStringLiteral("ArchiveMailCollection \\d+")));
const int numberOfCollection = collectionList.count();
for (int i = 0; i < numberOfCollection; ++i) {
KConfigGroup group = mConfig->group(collectionList.at(i));
@@ -187,7 +188,7 @@ QString ArchiveMailManager::infoToStr(ArchiveMailInfo *info) const
QString ArchiveMailManager::printArchiveListInfo()
{
QString infoStr;
- const QStringList collectionList = mConfig->groupList().filter(QRegExp(QStringLiteral("ArchiveMailCollection \\d+")));
+ const QStringList collectionList = mConfig->groupList().filter(QRegularExpression(QStringLiteral("ArchiveMailCollection \\d+")));
const int numberOfCollection = collectionList.count();
for (int i = 0; i < numberOfCollection; ++i) {
KConfigGroup group = mConfig->group(collectionList.at(i));
diff --git a/agents/archivemailagent/archivemailwidget.cpp b/agents/archivemailagent/archivemailwidget.cpp
index 892532c..35d953d 100644
--- a/agents/archivemailagent/archivemailwidget.cpp
+++ b/agents/archivemailagent/archivemailwidget.cpp
@@ -145,7 +145,7 @@ void ArchiveMailWidget::needReloadConfig()
void ArchiveMailWidget::load()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig();
- const QStringList collectionList = config->groupList().filter(QRegExp(archiveMailCollectionPattern()));
+ const QStringList collectionList = config->groupList().filter(QRegularExpression(archiveMailCollectionPattern()));
const int numberOfCollection = collectionList.count();
for (int i = 0; i < numberOfCollection; ++i) {
KConfigGroup group = config->group(collectionList.at(i));
@@ -199,7 +199,7 @@ void ArchiveMailWidget::save()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
// first, delete all filter groups:
- const QStringList filterGroups = config->groupList().filter(QRegExp(archiveMailCollectionPattern()));
+ const QStringList filterGroups = config->groupList().filter(QRegularExpression(archiveMailCollectionPattern()));
foreach (const QString &group, filterGroups) {
config->deleteGroup(group);
diff --git a/agents/followupreminderagent/autotests/followupreminderconfigtest.cpp b/agents/followupreminderagent/autotests/followupreminderconfigtest.cpp
index b012a9b..cc8867e 100644
--- a/agents/followupreminderagent/autotests/followupreminderconfigtest.cpp
+++ b/agents/followupreminderagent/autotests/followupreminderconfigtest.cpp
@@ -20,6 +20,7 @@
#include "FollowupReminder/FollowUpReminderInfo"
#include <qtest.h>
#include <KSharedConfig>
+#include <QRegularExpression>
FollowUpReminderConfigTest::FollowUpReminderConfigTest(QObject *parent)
: QObject(parent)
@@ -35,7 +36,7 @@ FollowUpReminderConfigTest::~FollowUpReminderConfigTest()
void FollowUpReminderConfigTest::init()
{
mConfig = KSharedConfig::openConfig(QStringLiteral("test-followupreminder.rc"), KConfig::SimpleConfig);
- mFollowupRegExpFilter = QRegExp(QStringLiteral("FollowupReminderItem \\d+"));
+ mFollowupRegExpFilter = QRegularExpression(QStringLiteral("FollowupReminderItem \\d+"));
cleanup();
}
diff --git a/agents/followupreminderagent/autotests/followupreminderconfigtest.h b/agents/followupreminderagent/autotests/followupreminderconfigtest.h
index 52af77f..3ea8e2d 100644
--- a/agents/followupreminderagent/autotests/followupreminderconfigtest.h
+++ b/agents/followupreminderagent/autotests/followupreminderconfigtest.h
@@ -19,7 +19,7 @@
#define FOLLOWUPREMINDERCONFIGTEST_H
#include <QObject>
-#include <QRegExp>
+#include <QRegularExpression>
#include <KSharedConfig>
class FollowUpReminderConfigTest : public QObject
@@ -43,7 +43,7 @@ private Q_SLOTS:
private:
KSharedConfig::Ptr mConfig;
- QRegExp mFollowupRegExpFilter;
+ QRegularExpression mFollowupRegExpFilter;
};
#endif // FOLLOWUPREMINDERCONFIGTEST_H
diff --git a/agents/followupreminderagent/followupremindermanager.cpp b/agents/followupreminderagent/followupremindermanager.cpp
index 9758e04..b50a0af 100644
--- a/agents/followupreminderagent/followupremindermanager.cpp
+++ b/agents/followupreminderagent/followupremindermanager.cpp
@@ -31,6 +31,7 @@
#include <knotification.h>
#include <KLocalizedString>
#include <KIconLoader>
+#include <QRegularExpression>
using namespace FollowUpReminder;
FollowUpReminderManager::FollowUpReminderManager(QObject *parent)
@@ -51,7 +52,7 @@ void FollowUpReminderManager::load(bool forceReloadConfig)
if (forceReloadConfig) {
mConfig->reparseConfiguration();
}
- const QStringList itemList = mConfig->groupList().filter(QRegExp(QStringLiteral("FollowupReminderItem \\d+")));
+ const QStringList itemList = mConfig->groupList().filter(QRegularExpression(QStringLiteral("FollowupReminderItem \\d+")));
const int numberOfItems = itemList.count();
QList<FollowUpReminder::FollowUpReminderInfo *> noAnswerList;
for (int i = 0; i < numberOfItems; ++i) {
diff --git a/agents/sendlateragent/autotests/sendlaterconfigtest.cpp b/agents/sendlateragent/autotests/sendlaterconfigtest.cpp
index 06ab778..5ebfe6f 100644
--- a/agents/sendlateragent/autotests/sendlaterconfigtest.cpp
+++ b/agents/sendlateragent/autotests/sendlaterconfigtest.cpp
@@ -34,7 +34,7 @@ SendLaterConfigTest::~SendLaterConfigTest()
void SendLaterConfigTest::init()
{
mConfig = KSharedConfig::openConfig(QStringLiteral("test-sendlateragent.rc"), KConfig::SimpleConfig);
- mSendlaterRegExpFilter = QRegExp(QStringLiteral("SendLaterItem \\d+"));
+ mSendlaterRegExpFilter = QRegularExpression(QStringLiteral("SendLaterItem \\d+"));
cleanup();
}
diff --git a/agents/sendlateragent/autotests/sendlaterconfigtest.h b/agents/sendlateragent/autotests/sendlaterconfigtest.h
index 7259d1f..befe206 100644
--- a/agents/sendlateragent/autotests/sendlaterconfigtest.h
+++ b/agents/sendlateragent/autotests/sendlaterconfigtest.h
@@ -20,7 +20,7 @@
#include <QObject>
#include <KSharedConfig>
-#include <QRegExp>
+#include <QRegularExpression>
class SendLaterConfigTest : public QObject
{
@@ -38,7 +38,7 @@ private Q_SLOTS:
void shouldNotAddInvalidItem();
private:
KSharedConfig::Ptr mConfig;
- QRegExp mSendlaterRegExpFilter;
+ QRegularExpression mSendlaterRegExpFilter;
};
#endif // SENDLATERCONFIGTEST_H
diff --git a/agents/sendlateragent/sendlatermanager.cpp b/agents/sendlateragent/sendlatermanager.cpp
index c20804d..ba8148e 100644
--- a/agents/sendlateragent/sendlatermanager.cpp
+++ b/agents/sendlateragent/sendlatermanager.cpp
@@ -29,6 +29,7 @@
#include <KLocalizedString>
#include "sendlateragent_debug.h"
+#include <QRegularExpression>
#include <QStringList>
#include <QTimer>
@@ -64,7 +65,7 @@ void SendLaterManager::load(bool forcereload)
mConfig->reparseConfiguration();
}
- const QStringList itemList = mConfig->groupList().filter(QRegExp(QStringLiteral("SendLaterItem \\d+")));
+ const QStringList itemList = mConfig->groupList().filter(QRegularExpression(QStringLiteral("SendLaterItem \\d+")));
const int numberOfItems = itemList.count();
for (int i = 0; i < numberOfItems; ++i) {
KConfigGroup group = mConfig->group(itemList.at(i));
diff --git a/mailcommon/src/search/searchpattern.cpp b/mailcommon/src/search/searchpattern.cpp
index d17d28e..dedee3c 100644
--- a/mailcommon/src/search/searchpattern.cpp
+++ b/mailcommon/src/search/searchpattern.cpp
@@ -38,7 +38,6 @@ using MailCommon::FilterLog;
#include <KLocalizedString>
#include <QDataStream>
-#include <QRegExp>
#include <algorithm>
#include <boost/bind.hpp>
diff --git a/mailcommon/src/search/searchrule/searchrule.cpp b/mailcommon/src/search/searchrule/searchrule.cpp
index 70d667c..adbca76 100644
--- a/mailcommon/src/search/searchrule/searchrule.cpp
+++ b/mailcommon/src/search/searchrule/searchrule.cpp
@@ -26,7 +26,6 @@
#include <KConfigGroup>
#include <QDataStream>
-#include <QRegExp>
#include <algorithm>
#include <boost/bind.hpp>