-rw-r--r-- | kabc/addressee.cpp | 3 | ||||
-rw-r--r-- | kabc/phonenumber.cpp | 31 | ||||
-rw-r--r-- | kabc/plugins/ldap/ldapE.pro | 2 |
3 files changed, 16 insertions, 20 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 028d3bb..eec0f1f 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -315,25 +315,26 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
315 | PhoneNumber::List::Iterator phoneItAD; | 315 | PhoneNumber::List::Iterator phoneItAD; |
316 | for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { | 316 | for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { |
317 | bool found = false; | 317 | bool found = false; |
318 | PhoneNumber::List::Iterator it; | 318 | PhoneNumber::List::Iterator it; |
319 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 319 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
320 | if ( ( *phoneItAD ).contains( (*it) ) ) { | 320 | if ( ( *phoneItAD ).contains( (*it) ) ) { |
321 | found = true; | 321 | found = true; |
322 | (*it).setType( ( *phoneItAD ).type() ); | 322 | (*it).setType( ( *phoneItAD ).type() ); |
323 | (*it).setNumber( ( *phoneItAD ).number() ); | 323 | (*it).setNumber( ( *phoneItAD ).number() ); |
324 | break; | 324 | break; |
325 | } | 325 | } |
326 | } | 326 | } |
327 | if ( isSubSet && ! found ) | 327 | // if ( isSubSet && ! found ) |
328 | if ( ! found ) // LR try this one... | ||
328 | mData->phoneNumbers.append( *phoneItAD ); | 329 | mData->phoneNumbers.append( *phoneItAD ); |
329 | } | 330 | } |
330 | if ( isSubSet ) { | 331 | if ( isSubSet ) { |
331 | // ************* emails; | 332 | // ************* emails; |
332 | t = mData->emails; | 333 | t = mData->emails; |
333 | tAD = ad.mData->emails; | 334 | tAD = ad.mData->emails; |
334 | for ( iii = 0; iii < tAD.count(); ++iii) | 335 | for ( iii = 0; iii < tAD.count(); ++iii) |
335 | if ( !t.contains(tAD[iii] ) ) | 336 | if ( !t.contains(tAD[iii] ) ) |
336 | mData->emails.append( tAD[iii] ); | 337 | mData->emails.append( tAD[iii] ); |
337 | } | 338 | } |
338 | 339 | ||
339 | // ************* categories; | 340 | // ************* categories; |
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 3d82553..abb3b3b 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp | |||
@@ -80,42 +80,37 @@ bool PhoneNumber::simplifyNumber() | |||
80 | } | 80 | } |
81 | // make cellphone compatible | 81 | // make cellphone compatible |
82 | void PhoneNumber::simplifyType() | 82 | void PhoneNumber::simplifyType() |
83 | { | 83 | { |
84 | if ( mType & Fax ) mType = Fax; | 84 | if ( mType & Fax ) mType = Fax; |
85 | else if ( mType & Cell ) mType = Cell; | 85 | else if ( mType & Cell ) mType = Cell; |
86 | else if ( mType & Work ) mType = Work ; | 86 | else if ( mType & Work ) mType = Work ; |
87 | else if ( mType & Home ) mType = Home; | 87 | else if ( mType & Home ) mType = Home; |
88 | else mType = Pref; | 88 | else mType = Pref; |
89 | } | 89 | } |
90 | bool PhoneNumber::contains( const PhoneNumber &p ) | 90 | bool PhoneNumber::contains( const PhoneNumber &p ) |
91 | { | 91 | { |
92 | QString Number; | 92 | PhoneNumber myself; |
93 | QString Num; | 93 | PhoneNumber other; |
94 | uint i; | 94 | myself = *this; |
95 | Number = mNumber.stripWhiteSpace (); | 95 | other = p; |
96 | Num = ""; | 96 | myself.simplifyNumber(); |
97 | for ( i = 0; i < Number.length(); ++i) { | 97 | other.simplifyNumber(); |
98 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) | 98 | if ( myself.number() != other.number ()) |
99 | Num += Number.at(i); | 99 | return false; |
100 | } | 100 | myself.simplifyType(); |
101 | QString NumberR; | 101 | other.simplifyType(); |
102 | QString NumR; | 102 | if ( myself.type() == other.type()) |
103 | NumberR = p.mNumber.stripWhiteSpace (); | 103 | return true; |
104 | NumR = ""; | 104 | return false; |
105 | for ( i = 0; i < NumberR.length(); ++i) { | ||
106 | if ( NumberR.at(i).isDigit() || NumberR.at(i) == '+'|| NumberR.at(i) == '*'|| NumberR.at(i) == '#' ) | ||
107 | NumR += NumberR.at(i); | ||
108 | } | ||
109 | return (Num == NumR); | ||
110 | } | 105 | } |
111 | 106 | ||
112 | void PhoneNumber::setId( const QString &id ) | 107 | void PhoneNumber::setId( const QString &id ) |
113 | { | 108 | { |
114 | mId = id; | 109 | mId = id; |
115 | } | 110 | } |
116 | 111 | ||
117 | QString PhoneNumber::id() const | 112 | QString PhoneNumber::id() const |
118 | { | 113 | { |
119 | return mId; | 114 | return mId; |
120 | } | 115 | } |
121 | 116 | ||
diff --git a/kabc/plugins/ldap/ldapE.pro b/kabc/plugins/ldap/ldapE.pro index df3c94c..57b6f84 100644 --- a/kabc/plugins/ldap/ldapE.pro +++ b/kabc/plugins/ldap/ldapE.pro | |||
@@ -1,21 +1,21 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | #release debug | 3 | #release debug |
4 | 4 | ||
5 | TARGET = microkabc_ldap | 5 | TARGET = microkabc_ldap |
6 | INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include | 6 | INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include |
7 | OBJECTS_DIR = obj/$(PLATFORM) | 7 | OBJECTS_DIR = obj/$(PLATFORM) |
8 | MOC_DIR = moc/$(PLATFORM) | 8 | MOC_DIR = moc/$(PLATFORM) |
9 | DESTDIR = $(QPEDIR)/lib | 9 | DESTDIR = $(QPEDIR)/lib |
10 | LIBS += -lmicrokde -lkamicrokabc | 10 | LIBS += -lmicrokde -lmicrokabc |
11 | LIBS += -L$(QPEDIR)/lib | 11 | LIBS += -L$(QPEDIR)/lib |
12 | 12 | ||
13 | INTERFACES = \ | 13 | INTERFACES = \ |
14 | 14 | ||
15 | HEADERS = \ | 15 | HEADERS = \ |
16 | resourceldap.h \ | 16 | resourceldap.h \ |
17 | resourceldapconfig.h | 17 | resourceldapconfig.h |
18 | 18 | ||
19 | SOURCES = \ | 19 | SOURCES = \ |
20 | resourceldap.cpp \ | 20 | resourceldap.cpp \ |
21 | resourceldapconfig.cpp | 21 | resourceldapconfig.cpp |