projects
/
jenirok
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed search to retry automatically couple of times before failing.
[jenirok]
/
src
/
common
/
contactmanager.cpp
diff --git
a/src/common/contactmanager.cpp
b/src/common/contactmanager.cpp
index
caf360c
..
fc0c62d
100644
(file)
--- a/
src/common/contactmanager.cpp
+++ b/
src/common/contactmanager.cpp
@@
-17,6
+17,7
@@
*/
#include <QtCore/QDebug>
*/
#include <QtCore/QDebug>
+#include <QtCore/QRegExp>
#include "contactmanager.h"
#include "contactmanager.h"
@@
-77,6
+78,7
@@
bool ContactManager::addContact(Contact const& contact)
char* firstname = contact.name.firstname.toUtf8().data();
char* surname = contact.name.surname.toUtf8().data();
char* firstname = contact.name.firstname.toUtf8().data();
char* surname = contact.name.surname.toUtf8().data();
+
e_contact_set(newContact, E_CONTACT_GIVEN_NAME, (gpointer)firstname);
e_contact_set(newContact, E_CONTACT_FAMILY_NAME, (gpointer)surname);
e_contact_set(newContact, E_CONTACT_GIVEN_NAME, (gpointer)firstname);
e_contact_set(newContact, E_CONTACT_FAMILY_NAME, (gpointer)surname);
@@
-123,12
+125,15
@@
void ContactManager::stringToName(QString const& strname, ContactManager::Name&
if(ename)
{
if(ename)
{
- QString additional = QString(ename->additional);
+ static QRegExp check("([A-Z]+)");
+ QString additional = QString::fromUtf8(ename->additional);
+ QString firstname = QString::fromUtf8(ename->given);
+ QString surname = QString::fromUtf8(ename->family);
- if(additional.isEmpty())
+ if(additional.isEmpty() && check.indexIn(firstname, 1) == -1 && check.indexIn(surname, 1) == -1)
{
{
- name.firstname = QString(ename->given);
- name.surname = QString(ename->family);
+ name.firstname = firstname;
+ name.surname = surname;
}
else
{
}
else
{