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

Add email validator here

parent 1e3519fc
......@@ -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)
......
......@@ -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")
......
......@@ -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
......
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