Commit 34c2f63c authored by Laurent Montel's avatar Laurent Montel 😁

Add code for create new regexpeditorlineeditabstract. + add new autottest

parent ee057a40
......@@ -21,7 +21,12 @@
#include <KLocalizedString>
#include <KPluginLoader>
#include <KPluginFactory>
#include <QStringList>
#include <QRegularExpression>
#include "autocreatescripts/sieveconditions/widgets/regexpeditorlineedit.h"
using namespace KSieveUi;
QString AutoCreateScriptUtil::createMultiLine(const QString &str)
......@@ -190,3 +195,16 @@ QString AutoCreateScriptUtil::indentation()
{
return QStringLiteral(" ");
}
AbstractRegexpEditorLineEdit *AutoCreateScriptUtil::createRegexpEditorLineEdit(QWidget *parent)
{
KSieveUi::AbstractRegexpEditorLineEdit *edit = nullptr;
KPluginLoader loader(QStringLiteral("libksieve/regexpeditorlineeditplugin"));
KPluginFactory *factory = loader.factory();
if (factory) {
edit = factory->create<KSieveUi::AbstractRegexpEditorLineEdit>(parent);
} else {
edit = new KSieveUi::RegexpEditorLineEdit(parent);
}
return edit;
}
......@@ -23,6 +23,7 @@
#include <QString>
#include <QStringList>
#include <QDomNode>
#include <KSieveUi/AbstractRegexpEditorLineEdit>
namespace KSieveUi {
namespace AutoCreateScriptUtil {
QString createMultiLine(const QString &str);
......@@ -42,6 +43,7 @@ void comboboxItemNotFound(const QString &searchItem, const QString &name, QStrin
QString createFullWhatsThis(const QString &help, const QString &href);
QString protectSlash(QString str);
QString indentation();
AbstractRegexpEditorLineEdit *createRegexpEditorLineEdit(QWidget *parent = nullptr);
}
}
#endif // AUTOCREATESCRIPTUTIL_H
if anyof (header :contains "Subject" "[kdepim-runtime]"
, header :contains "Subject" "[akonadi"
, header :contains "Subject" "[kmail2"
, header :contains "Subject" "[pim-sieve-editor"
, header :contains "Subject" "[pim-data-exporter"
, header :contains "Subject" "[akonadi-search/")
{
fileinto "bb";
}
if anyof (header :contains "Subject" "[kdepim-runtime]"
, header :contains "Subject" "[akonadi"
, header :contains "Subject" "[kmail2"
, header :contains "Subject" "[pim-sieve-editor"
, header :contains "Subject" "[pim-data-exporter"
, header :contains "Subject" "[akonadi-search/")
{
fileinto "bb";
}
Markdown is supported
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