-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 | |||
@@ -303,49 +303,50 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
303 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | 303 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; |
304 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | 304 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; |
305 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; | 305 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
306 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; | 306 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
307 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | 307 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; |
308 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; | 308 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; |
309 | QStringList t; | 309 | QStringList t; |
310 | QStringList tAD; | 310 | QStringList tAD; |
311 | uint iii; | 311 | uint iii; |
312 | 312 | ||
313 | // ********** phone numbers | 313 | // ********** phone numbers |
314 | PhoneNumber::List phoneAD = ad.phoneNumbers(); | 314 | PhoneNumber::List phoneAD = ad.phoneNumbers(); |
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; |
340 | t = mData->categories; | 341 | t = mData->categories; |
341 | tAD = ad.mData->categories; | 342 | tAD = ad.mData->categories; |
342 | for ( iii = 0; iii < tAD.count(); ++iii) | 343 | for ( iii = 0; iii < tAD.count(); ++iii) |
343 | if ( !t.contains(tAD[iii] ) ) | 344 | if ( !t.contains(tAD[iii] ) ) |
344 | mData->categories.append( tAD[iii] ); | 345 | mData->categories.append( tAD[iii] ); |
345 | QStringList::ConstIterator it; | 346 | QStringList::ConstIterator it; |
346 | for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) { | 347 | for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) { |
347 | QString qualifiedName = (*it).left( (*it).find( ":" )); | 348 | QString qualifiedName = (*it).left( (*it).find( ":" )); |
348 | bool found = false; | 349 | bool found = false; |
349 | QStringList::ConstIterator itL; | 350 | QStringList::ConstIterator itL; |
350 | for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) { | 351 | for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) { |
351 | if ( (*itL).startsWith( qualifiedName ) ) { | 352 | if ( (*itL).startsWith( qualifiedName ) ) { |
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 3d82553..abb3b3b 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp | |||
@@ -68,66 +68,61 @@ bool PhoneNumber::operator!=( const PhoneNumber &p ) const | |||
68 | 68 | ||
69 | bool PhoneNumber::simplifyNumber() | 69 | bool PhoneNumber::simplifyNumber() |
70 | { | 70 | { |
71 | QString Number; | 71 | QString Number; |
72 | int i; | 72 | int i; |
73 | Number = mNumber.stripWhiteSpace (); | 73 | Number = mNumber.stripWhiteSpace (); |
74 | mNumber = ""; | 74 | mNumber = ""; |
75 | for ( i = 0; i < Number.length(); ++i) { | 75 | for ( i = 0; i < Number.length(); ++i) { |
76 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) | 76 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) |
77 | mNumber += Number.at(i); | 77 | mNumber += Number.at(i); |
78 | } | 78 | } |
79 | return ( mNumber.length() > 0 ); | 79 | return ( mNumber.length() > 0 ); |
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 | ||
122 | void PhoneNumber::setNumber( const QString &number ) | 117 | void PhoneNumber::setNumber( const QString &number ) |
123 | { | 118 | { |
124 | mNumber = number; | 119 | mNumber = number; |
125 | } | 120 | } |
126 | 121 | ||
127 | QString PhoneNumber::number() const | 122 | QString PhoneNumber::number() const |
128 | { | 123 | { |
129 | return mNumber; | 124 | return mNumber; |
130 | } | 125 | } |
131 | 126 | ||
132 | void PhoneNumber::setType( int type ) | 127 | void PhoneNumber::setType( int type ) |
133 | { | 128 | { |
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 |