summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-09-04 08:14:13 +0200
committerMontel Laurent <[email protected]>2017-09-04 08:14:13 +0200
commiteb3cfd8220b2cb39f6f3cdf22e4d3e0e5352f74f (patch)
treefc08aed6220c5eb7f284987d35b69b82ea0094c6
parent1e3519fc1aa4e17997e3c90375671f41675801e4 (diff)
Add email validator here
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/CMakeLists.txt2
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/autotests/CMakeLists.txt2
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.cpp7
3 files changed, 9 insertions, 2 deletions
diff --git a/kmail/editorsendcheckplugins/confirm-address/CMakeLists.txt b/kmail/editorsendcheckplugins/confirm-address/CMakeLists.txt
index b2222f6..f273bff 100644
--- a/kmail/editorsendcheckplugins/confirm-address/CMakeLists.txt
+++ b/kmail/editorsendcheckplugins/confirm-address/CMakeLists.txt
@@ -18,7 +18,7 @@ kcoreaddons_add_plugin(kmail_confirmaddresseditorplugin JSON kmail_confirmaddres
${kmail_confirmaddresseditorplugin_SRCS} INSTALL_NAMESPACE kmail)
target_link_libraries(kmail_confirmaddresseditorplugin
- KF5::IconThemes KF5::MessageComposer KF5::I18n KF5::PimCommon
+ KF5::IconThemes KF5::MessageComposer KF5::I18n KF5::PimCommon KF5::Libkdepim
)
if(BUILD_TESTING)
diff --git a/kmail/editorsendcheckplugins/confirm-address/autotests/CMakeLists.txt b/kmail/editorsendcheckplugins/confirm-address/autotests/CMakeLists.txt
index 5260c2c..a00a332 100644
--- a/kmail/editorsendcheckplugins/confirm-address/autotests/CMakeLists.txt
+++ b/kmail/editorsendcheckplugins/confirm-address/autotests/CMakeLists.txt
@@ -8,7 +8,7 @@ macro(add_kmail_confirmaddress_unittest _source _additional)
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(kmail_editorplugin-${_name})
- target_link_libraries( ${_name} Qt5::Test KF5::IconThemes KF5::MessageComposer KF5::I18n KF5::PimCommon)
+ target_link_libraries( ${_name} Qt5::Test KF5::IconThemes KF5::MessageComposer KF5::I18n KF5::PimCommon KF5::Libkdepim)
endmacro ()
add_kmail_confirmaddress_unittest(confirmaddressplugintest.cpp "../confirmaddressemailentrydialog.cpp;../confirmaddresssimplestringlisteditor.cpp;../confirmaddressconfiguredialog.cpp;../confirmaddressplugin.cpp;../confirmaddressinterface.cpp;../confirmaddressconfigurewidget.cpp;../confirmaddressdialog.cpp;../confirmaddresswidget.cpp;../confirmaddressconfiguretab.cpp;../confirmaddressconfiguretabwidget.cpp;../confirmaddresscheckjob.cpp")
diff --git a/kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.cpp b/kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.cpp
index f8b077a..a7ee9fc 100644
--- a/kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.cpp
+++ b/kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.cpp
@@ -24,6 +24,7 @@
#include <QDialogButtonBox>
#include <QLineEdit>
#include <QLabel>
+#include <Libkdepim/EmailValidator>
ConfirmAddressEmailEntryDialog::ConfirmAddressEmailEntryDialog(QWidget *parent)
: QDialog(parent)
@@ -38,9 +39,15 @@ ConfirmAddressEmailEntryDialog::ConfirmAddressEmailEntryDialog(QWidget *parent)
mLineEdit->setObjectName(QStringLiteral("lineedit"));
mainLayout->addWidget(mLineEdit);
+ KPIM::EmailValidator *emailValidator = new KPIM::EmailValidator(this);
+ mLineEdit->setValidator(emailValidator);
+
+
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttons->setObjectName(QStringLiteral("buttons"));
mainLayout->addWidget(buttons);
+ connect(buttons, &QDialogButtonBox::accepted, this, &ConfirmAddressEmailEntryDialog::accept);
+ connect(buttons, &QDialogButtonBox::rejected, this, &ConfirmAddressEmailEntryDialog::reject);
}
QString ConfirmAddressEmailEntryDialog::emails() const