[Kde-pim] [kdepimlibs/KDE/4.9] akonadi/contact: Don't allow to create group with @ or . in groupname

David Faure faure at kde.org
Tue Jul 10 10:37:53 BST 2012


On Sunday 08 July 2012 14:24:55 Montel Laurent wrote:
> Git commit 28b47910cfd742d5d67ce8a2a51487fbc87480dd by Montel Laurent.
> Committed on 08/07/2012 at 14:24.
> Pushed by mlaurent into branch 'KDE/4.9'.
> 
> Don't allow to create group with @ or . in groupname

Good. Now, if groups cannot contain '@', can we skip the searching of groups 
when the user typed an email address containing '@' ?
This should make things a bit faster when sending emails.

diff --git a/akonadi/contact/contactgroupexpandjob.cpp 
b/akonadi/contact/contactgroupexpandjob.cpp
index fee2d62..75b2ade 100644
--- a/akonadi/contact/contactgroupexpandjob.cpp
+++ b/akonadi/contact/contactgroupexpandjob.cpp
@@ -139,7 +139,7 @@ ContactGroupExpandJob::~ContactGroupExpandJob()
 
 void ContactGroupExpandJob::start()
 {
-  if ( !d->mName.isEmpty() ) {
+  if ( !d->mName.isEmpty() && !d->mName.contains( QLatin1Char( '@' ) ) ) {
     // we have to search the contact group first
     ContactGroupSearchJob *searchJob = new ContactGroupSearchJob( this );
     searchJob->setQuery( ContactGroupSearchJob::Name, d->mName );


-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list