summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-29 08:52:42 +0200
committerMontel Laurent <[email protected]>2017-05-29 08:52:42 +0200
commit3fcca363dbcbe1ae20f2c245dc63a5c172a6da1b (patch)
treee4192466d667999976dce66bda55e8eccbc7ae52
parent300b9bfac36a77e1d5e9de04aed2ae4ee5e649a1 (diff)
Implement clear global variable
-rw-r--r--src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp13
-rw-r--r--src/ksieveui/autocreatescripts/sieveglobalvariablewidget.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp b/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp
index 237ab32..90b8115 100644
--- a/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.cpp
@@ -100,6 +100,13 @@ void SieveGlobalVariableActionWidget::initWidget()
connect(mRemove, &QPushButton::clicked, this, &SieveGlobalVariableActionWidget::slotRemoveWidget);
}
+void SieveGlobalVariableActionWidget::clear()
+{
+ mVariableName->clear();
+ mSetValueTo->setChecked(false);
+ mVariableValue->clear();
+}
+
bool SieveGlobalVariableActionWidget::isInitialized() const
{
return !mVariableName->text().isEmpty();
@@ -274,8 +281,10 @@ void SieveGlobalVariableLister::reconnectWidget(SieveGlobalVariableActionWidget
void SieveGlobalVariableLister::clearWidget(QWidget *aWidget)
{
- Q_UNUSED(aWidget);
- //TODO
+ if (aWidget) {
+ SieveGlobalVariableActionWidget *widget = static_cast<SieveGlobalVariableActionWidget *>(aWidget);
+ widget->clear();
+ }
Q_EMIT valueChanged();
}
diff --git a/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.h b/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.h
index 6ec0339..94d7c11 100644
--- a/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.h
+++ b/src/ksieveui/autocreatescripts/sieveglobalvariablewidget.h
@@ -47,6 +47,7 @@ public:
void setVariableValue(const QString &name);
QString variableName() const;
+ void clear();
private Q_SLOTS:
void slotAddWidget();
void slotRemoveWidget();