summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-31 22:12:27 +0200
committerMontel Laurent <[email protected]>2017-07-31 22:12:27 +0200
commitc432c5f004d04f1c0c794f2ded2c04244b2a7637 (patch)
treeb89139a296b2833ddfe00868e0a9290b62dde963
parent138ac30ed5d94b2ab58cb805ce2de905452babd3 (diff)
Propagate listOfIncludeFile
-rw-r--r--src/ksieveui/autocreatescripts/sieveincludewidget.cpp12
-rw-r--r--src/ksieveui/autocreatescripts/sieveincludewidget.h7
-rw-r--r--src/ksieveui/widgets/includefilelineedit.cpp2
-rw-r--r--src/ksieveui/widgets/includefilelineedit.h2
4 files changed, 20 insertions, 3 deletions
diff --git a/src/ksieveui/autocreatescripts/sieveincludewidget.cpp b/src/ksieveui/autocreatescripts/sieveincludewidget.cpp
index 768527b..50aa062 100644
--- a/src/ksieveui/autocreatescripts/sieveincludewidget.cpp
+++ b/src/ksieveui/autocreatescripts/sieveincludewidget.cpp
@@ -93,6 +93,11 @@ void SieveIncludeActionWidget::clear()
mIncludeName->setText(QString());
}
+void SieveIncludeActionWidget::setListOfIncludeFile(const QStringList &listOfIncludeFile)
+{
+ mIncludeName->setListOfIncludeFile(listOfIncludeFile);
+}
+
void SieveIncludeActionWidget::loadScript(QXmlStreamReader &element, QString &error)
{
while (element.readNextStartElement()) {
@@ -207,6 +212,7 @@ SieveIncludeWidget::SieveIncludeWidget(QWidget *parent)
connect(mHelpButton, &SieveHelpButton::clicked, this, &SieveIncludeWidget::slotHelp);
mIncludeLister = new SieveIncludeWidgetLister;
+ //mIncludeLister->setListOfIncludeFile();
connect(mIncludeLister, &SieveIncludeWidgetLister::valueChanged, this, &SieveIncludeWidget::valueChanged);
lay->addWidget(mIncludeLister, 0, Qt::AlignTop);
setPageType(KSieveUi::SieveScriptBlockWidget::Include);
@@ -290,6 +296,11 @@ void SieveIncludeWidgetLister::updateAddRemoveButton()
}
}
+void SieveIncludeWidgetLister::setListOfIncludeFile(const QStringList &listOfIncludeFile)
+{
+ mListOfIncludeFile = listOfIncludeFile;
+}
+
void SieveIncludeWidgetLister::generatedScript(QString &script, QStringList &requires)
{
requires << QStringLiteral("include");
@@ -321,6 +332,7 @@ void SieveIncludeWidgetLister::clearWidget(QWidget *aWidget)
QWidget *SieveIncludeWidgetLister::createWidget(QWidget *parent)
{
SieveIncludeActionWidget *w = new SieveIncludeActionWidget(parent);
+ w->setListOfIncludeFile(mListOfIncludeFile);
reconnectWidget(w);
return w;
}
diff --git a/src/ksieveui/autocreatescripts/sieveincludewidget.h b/src/ksieveui/autocreatescripts/sieveincludewidget.h
index 344fad6..962baf6 100644
--- a/src/ksieveui/autocreatescripts/sieveincludewidget.h
+++ b/src/ksieveui/autocreatescripts/sieveincludewidget.h
@@ -31,6 +31,7 @@ class QCheckBox;
class QXmlStreamReader;
namespace KSieveUi {
class SieveHelpButton;
+class IncludeFileLineEdit;
class SieveIncludeLocation : public KComboBox
{
Q_OBJECT
@@ -60,6 +61,7 @@ public:
void loadScript(QXmlStreamReader &element, QString &error);
bool isInitialized() const;
void clear();
+ void setListOfIncludeFile(const QStringList &listOfIncludeFile);
private Q_SLOTS:
void slotAddWidget();
@@ -78,7 +80,7 @@ private:
QCheckBox *mOptional;
QCheckBox *mOnce;
SieveIncludeLocation *mLocation;
- QLineEdit *mIncludeName;
+ IncludeFileLineEdit *mIncludeName;
};
class SieveIncludeWidgetLister : public KPIM::KWidgetLister
@@ -91,6 +93,8 @@ public:
void generatedScript(QString &script, QStringList &requires);
void loadScript(QXmlStreamReader &element, QString &error);
+ void setListOfIncludeFile(const QStringList &listOfIncludeFile);
+
Q_SIGNALS:
void valueChanged();
@@ -104,6 +108,7 @@ protected:
private:
void reconnectWidget(SieveIncludeActionWidget *w);
void updateAddRemoveButton();
+ QStringList mListOfIncludeFile;
};
class SieveIncludeWidget : public SieveWidgetPageAbstract
diff --git a/src/ksieveui/widgets/includefilelineedit.cpp b/src/ksieveui/widgets/includefilelineedit.cpp
index 9ed9344..a79be05 100644
--- a/src/ksieveui/widgets/includefilelineedit.cpp
+++ b/src/ksieveui/widgets/includefilelineedit.cpp
@@ -37,7 +37,7 @@ IncludeFileLineEdit::~IncludeFileLineEdit()
}
-void IncludeFileLineEdit::setStringList(const QStringList &lst)
+void IncludeFileLineEdit::setListOfIncludeFile(const QStringList &lst)
{
mCompleter->setModel(new QStringListModel(lst));
}
diff --git a/src/ksieveui/widgets/includefilelineedit.h b/src/ksieveui/widgets/includefilelineedit.h
index 5f666eb..9a6dd70 100644
--- a/src/ksieveui/widgets/includefilelineedit.h
+++ b/src/ksieveui/widgets/includefilelineedit.h
@@ -31,7 +31,7 @@ public:
explicit IncludeFileLineEdit(QWidget *parent = nullptr);
~IncludeFileLineEdit();
- void setStringList(const QStringList &lst);
+ void setListOfIncludeFile(const QStringList &lst);
private:
void initialize();