From kde-pim Fri Mar 25 12:59:05 2005 From: Matt Douhan Date: Fri, 25 Mar 2005 12:59:05 +0000 To: kde-pim Subject: [Kde-pim] patch for KABC email storage Message-Id: <200503251359.05998.matt () fruitsalad ! org> X-MARC-Message: https://marc.info/?l=kde-pim&m=111175566531692 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_ZsARCUi59mcFlQJ" --Boundary-00=_ZsARCUi59mcFlQJ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello Currently the email storage in kabc allows for email addresses in the form of m@@@@@@@t@@@@@@@@jongel.c@m I added the simple validator from libemailfunctions to the email address editor widget locally and that fixes the issue instantly. But for the life of me I cannot figure out how to validate the LineEdit if the user does not click the "edit email addresses" button, the same validation should happen when the user clicks ok or apply in the main dialog. Comments and advice as always highly appreciated rgds Matt -- Matt Douhan www.fruitsalad.org kolab2 + kontact + toltec == success Now lets get Horde into shape mmkay --Boundary-00=_ZsARCUi59mcFlQJ Content-Type: text/x-diff; charset="us-ascii"; name="patch_kaddressbook_emaileditwidget_cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_kaddressbook_emaileditwidget_cpp" Index: emaileditwidget.cpp =================================================================== RCS file: /home/kde/kdepim/kaddressbook/emaileditwidget.cpp,v retrieving revision 1.28 diff -u -3 -p -r1.28 emaileditwidget.cpp --- emaileditwidget.cpp 31 Jan 2005 21:40:26 -0000 1.28 +++ emaileditwidget.cpp 25 Mar 2005 09:45:05 -0000 @@ -41,6 +41,7 @@ #include #include #include +#include #include "emaileditwidget.h" @@ -257,6 +258,15 @@ void EmailEditDialog::add() QString::null, &ok, this, "EmailEditDialog", validator ); + // Validate email address + if ( !email.isEmpty() ) { + if ( !KPIM::isValidSimpleEmailAddress( email )) { + QString errorMsg( KPIM::simpleEmailAddressErrorMsg()); + KMessageBox::sorry( this, errorMsg, i18n("Invalid Email Address") ); + return; + } + } + if ( !ok ) return; @@ -282,6 +292,16 @@ void EmailEditDialog::edit() mEmailListBox->text( editPos ), &ok, this, "EmailEditDialog", validator ); + + // Validate email address + if ( !email.isEmpty() ) { + if ( !KPIM::isValidSimpleEmailAddress( email )) { + QString errorMsg( KPIM::simpleEmailAddressErrorMsg()); + KMessageBox::sorry( this, errorMsg, i18n("Invalid Email Address") ); + return; + } + } + if ( !ok ) return; --Boundary-00=_ZsARCUi59mcFlQJ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --Boundary-00=_ZsARCUi59mcFlQJ--