Commit cb60d9cc authored by Laurent Montel's avatar Laurent Montel 😁

Inform when we switch to regexp support

parent b2b59757
......@@ -29,13 +29,22 @@ SelectMatchTypeComboBox::SelectMatchTypeComboBox(SieveEditorGraphicalModeWidget
{
mHasRegexCapability = sieveGraphicalModeWidget->sieveCapabilities().contains(QStringLiteral("regex"));
initialize();
connect(this, static_cast<void (SelectMatchTypeComboBox::*)(int)>(&SelectMatchTypeComboBox::activated), this, &SelectMatchTypeComboBox::valueChanged);
connect(this, static_cast<void (SelectMatchTypeComboBox::*)(int)>(&SelectMatchTypeComboBox::activated), this, &SelectMatchTypeComboBox::slotValueChanged);
}
SelectMatchTypeComboBox::~SelectMatchTypeComboBox()
{
}
void SelectMatchTypeComboBox::slotValueChanged(int val)
{
if (mHasRegexCapability) {
const QString value = itemData(val).toString();
Q_EMIT switchToRegexp(value.contains(QStringLiteral("regex")));
}
Q_EMIT valueChanged();
}
void SelectMatchTypeComboBox::initialize()
{
addItem(i18n("is"), QStringLiteral(":is"));
......
......@@ -36,8 +36,10 @@ public:
Q_SIGNALS:
void valueChanged();
void switchToRegexp(bool useReg);
private:
void slotValueChanged(int val);
void initialize();
bool mHasRegexCapability;
};
......
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