-rw-r--r-- | kabc/addressee.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index fda62f1..e241281 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1,905 +1,909 @@ | |||
1 | /*** Warning! This file has been generated by the script makeaddressee ***/ | 1 | /*** Warning! This file has been generated by the script makeaddressee ***/ |
2 | /* | 2 | /* |
3 | This file is part of libkabc. | 3 | This file is part of libkabc. |
4 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* | 22 | /* |
23 | Enhanced Version of the file for platform independent KDE tools. | 23 | Enhanced Version of the file for platform independent KDE tools. |
24 | Copyright (c) 2004 Ulf Schenk | 24 | Copyright (c) 2004 Ulf Schenk |
25 | 25 | ||
26 | $Id$ | 26 | $Id$ |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | 30 | ||
31 | #include <ksharedptr.h> | 31 | #include <ksharedptr.h> |
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <kapplication.h> | 33 | #include <kapplication.h> |
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kidmanager.h> | 35 | #include <kidmanager.h> |
36 | //US | 36 | //US |
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | #include <libkcal/syncdefines.h> | 38 | #include <libkcal/syncdefines.h> |
39 | 39 | ||
40 | //US #include "resource.h" | 40 | //US #include "resource.h" |
41 | #include "addressee.h" | 41 | #include "addressee.h" |
42 | 42 | ||
43 | using namespace KABC; | 43 | using namespace KABC; |
44 | 44 | ||
45 | static bool matchBinaryPattern( int value, int pattern ); | 45 | static bool matchBinaryPattern( int value, int pattern ); |
46 | 46 | ||
47 | struct Addressee::AddresseeData : public KShared | 47 | struct Addressee::AddresseeData : public KShared |
48 | { | 48 | { |
49 | QString uid; | 49 | QString uid; |
50 | QString name; | 50 | QString name; |
51 | QString formattedName; | 51 | QString formattedName; |
52 | QString familyName; | 52 | QString familyName; |
53 | QString givenName; | 53 | QString givenName; |
54 | QString additionalName; | 54 | QString additionalName; |
55 | QString prefix; | 55 | QString prefix; |
56 | QString suffix; | 56 | QString suffix; |
57 | QString nickName; | 57 | QString nickName; |
58 | QDateTime birthday; | 58 | QDateTime birthday; |
59 | QString mailer; | 59 | QString mailer; |
60 | TimeZone timeZone; | 60 | TimeZone timeZone; |
61 | Geo geo; | 61 | Geo geo; |
62 | QString title; | 62 | QString title; |
63 | QString role; | 63 | QString role; |
64 | QString organization; | 64 | QString organization; |
65 | QString note; | 65 | QString note; |
66 | QString productId; | 66 | QString productId; |
67 | QDateTime revision; | 67 | QDateTime revision; |
68 | QString sortString; | 68 | QString sortString; |
69 | QString externalUID; | 69 | QString externalUID; |
70 | QString originalExternalUID; | 70 | QString originalExternalUID; |
71 | KURL url; | 71 | KURL url; |
72 | Secrecy secrecy; | 72 | Secrecy secrecy; |
73 | Picture logo; | 73 | Picture logo; |
74 | Picture photo; | 74 | Picture photo; |
75 | Sound sound; | 75 | Sound sound; |
76 | Agent agent; | 76 | Agent agent; |
77 | QString mExternalId; | 77 | QString mExternalId; |
78 | PhoneNumber::List phoneNumbers; | 78 | PhoneNumber::List phoneNumbers; |
79 | Address::List addresses; | 79 | Address::List addresses; |
80 | Key::List keys; | 80 | Key::List keys; |
81 | QStringList emails; | 81 | QStringList emails; |
82 | QStringList categories; | 82 | QStringList categories; |
83 | QStringList custom; | 83 | QStringList custom; |
84 | int mTempSyncStat; | 84 | int mTempSyncStat; |
85 | Resource *resource; | 85 | Resource *resource; |
86 | 86 | ||
87 | bool empty :1; | 87 | bool empty :1; |
88 | bool changed :1; | 88 | bool changed :1; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | Addressee::Addressee() | 91 | Addressee::Addressee() |
92 | { | 92 | { |
93 | mData = new AddresseeData; | 93 | mData = new AddresseeData; |
94 | mData->empty = true; | 94 | mData->empty = true; |
95 | mData->changed = false; | 95 | mData->changed = false; |
96 | mData->resource = 0; | 96 | mData->resource = 0; |
97 | mData->mExternalId = ":"; | 97 | mData->mExternalId = ":"; |
98 | mData->revision = QDateTime ( QDate( 2004,1,1)); | 98 | mData->revision = QDateTime ( QDate( 2003,1,1)); |
99 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; | 99 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; |
100 | } | 100 | } |
101 | 101 | ||
102 | Addressee::~Addressee() | 102 | Addressee::~Addressee() |
103 | { | 103 | { |
104 | } | 104 | } |
105 | 105 | ||
106 | Addressee::Addressee( const Addressee &a ) | 106 | Addressee::Addressee( const Addressee &a ) |
107 | { | 107 | { |
108 | mData = a.mData; | 108 | mData = a.mData; |
109 | } | 109 | } |
110 | 110 | ||
111 | Addressee &Addressee::operator=( const Addressee &a ) | 111 | Addressee &Addressee::operator=( const Addressee &a ) |
112 | { | 112 | { |
113 | mData = a.mData; | 113 | mData = a.mData; |
114 | return (*this); | 114 | return (*this); |
115 | } | 115 | } |
116 | 116 | ||
117 | Addressee Addressee::copy() | 117 | Addressee Addressee::copy() |
118 | { | 118 | { |
119 | Addressee a; | 119 | Addressee a; |
120 | *(a.mData) = *mData; | 120 | *(a.mData) = *mData; |
121 | return a; | 121 | return a; |
122 | } | 122 | } |
123 | 123 | ||
124 | void Addressee::detach() | 124 | void Addressee::detach() |
125 | { | 125 | { |
126 | if ( mData.count() == 1 ) return; | 126 | if ( mData.count() == 1 ) return; |
127 | *this = copy(); | 127 | *this = copy(); |
128 | } | 128 | } |
129 | 129 | ||
130 | bool Addressee::operator==( const Addressee &a ) const | 130 | bool Addressee::operator==( const Addressee &a ) const |
131 | { | 131 | { |
132 | if ( uid() != a.uid() ) return false; | 132 | if ( uid() != a.uid() ) return false; |
133 | if ( mData->name != a.mData->name ) return false; | 133 | if ( mData->name != a.mData->name ) return false; |
134 | if ( mData->formattedName != a.mData->formattedName ) return false; | 134 | if ( mData->formattedName != a.mData->formattedName ) return false; |
135 | if ( mData->familyName != a.mData->familyName ) return false; | 135 | if ( mData->familyName != a.mData->familyName ) return false; |
136 | if ( mData->givenName != a.mData->givenName ) return false; | 136 | if ( mData->givenName != a.mData->givenName ) return false; |
137 | if ( mData->additionalName != a.mData->additionalName ) return false; | 137 | if ( mData->additionalName != a.mData->additionalName ) return false; |
138 | if ( mData->prefix != a.mData->prefix ) return false; | 138 | if ( mData->prefix != a.mData->prefix ) return false; |
139 | if ( mData->suffix != a.mData->suffix ) return false; | 139 | if ( mData->suffix != a.mData->suffix ) return false; |
140 | if ( mData->nickName != a.mData->nickName ) return false; | 140 | if ( mData->nickName != a.mData->nickName ) return false; |
141 | if ( mData->birthday != a.mData->birthday ) return false; | 141 | if ( mData->birthday != a.mData->birthday ) return false; |
142 | if ( mData->mailer != a.mData->mailer ) return false; | 142 | if ( mData->mailer != a.mData->mailer ) return false; |
143 | if ( mData->timeZone != a.mData->timeZone ) return false; | 143 | if ( mData->timeZone != a.mData->timeZone ) return false; |
144 | if ( mData->geo != a.mData->geo ) return false; | 144 | if ( mData->geo != a.mData->geo ) return false; |
145 | if ( mData->title != a.mData->title ) return false; | 145 | if ( mData->title != a.mData->title ) return false; |
146 | if ( mData->role != a.mData->role ) return false; | 146 | if ( mData->role != a.mData->role ) return false; |
147 | if ( mData->organization != a.mData->organization ) return false; | 147 | if ( mData->organization != a.mData->organization ) return false; |
148 | if ( mData->note != a.mData->note ) return false; | 148 | if ( mData->note != a.mData->note ) return false; |
149 | if ( mData->productId != a.mData->productId ) return false; | 149 | if ( mData->productId != a.mData->productId ) return false; |
150 | //if ( mData->revision != a.mData->revision ) return false; | 150 | //if ( mData->revision != a.mData->revision ) return false; |
151 | if ( mData->sortString != a.mData->sortString ) return false; | 151 | if ( mData->sortString != a.mData->sortString ) return false; |
152 | if ( mData->secrecy != a.mData->secrecy ) return false; | 152 | if ( mData->secrecy != a.mData->secrecy ) return false; |
153 | if ( mData->logo != a.mData->logo ) return false; | 153 | if ( mData->logo != a.mData->logo ) return false; |
154 | if ( mData->photo != a.mData->photo ) return false; | 154 | if ( mData->photo != a.mData->photo ) return false; |
155 | if ( mData->sound != a.mData->sound ) return false; | 155 | if ( mData->sound != a.mData->sound ) return false; |
156 | if ( mData->agent != a.mData->agent ) return false; | 156 | if ( mData->agent != a.mData->agent ) return false; |
157 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && | 157 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && |
158 | ( mData->url != a.mData->url ) ) return false; | 158 | ( mData->url != a.mData->url ) ) return false; |
159 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; | 159 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; |
160 | if ( mData->addresses != a.mData->addresses ) return false; | 160 | if ( mData->addresses != a.mData->addresses ) return false; |
161 | if ( mData->keys != a.mData->keys ) return false; | 161 | if ( mData->keys != a.mData->keys ) return false; |
162 | if ( mData->emails != a.mData->emails ) return false; | 162 | if ( mData->emails != a.mData->emails ) return false; |
163 | if ( mData->categories != a.mData->categories ) return false; | 163 | if ( mData->categories != a.mData->categories ) return false; |
164 | if ( mData->custom != a.mData->custom ) return false; | 164 | if ( mData->custom != a.mData->custom ) return false; |
165 | 165 | ||
166 | return true; | 166 | return true; |
167 | } | 167 | } |
168 | 168 | ||
169 | bool Addressee::operator!=( const Addressee &a ) const | 169 | bool Addressee::operator!=( const Addressee &a ) const |
170 | { | 170 | { |
171 | return !( a == *this ); | 171 | return !( a == *this ); |
172 | } | 172 | } |
173 | 173 | ||
174 | bool Addressee::isEmpty() const | 174 | bool Addressee::isEmpty() const |
175 | { | 175 | { |
176 | return mData->empty; | 176 | return mData->empty; |
177 | } | 177 | } |
178 | ulong Addressee::getCsum4List( const QStringList & attList) | 178 | ulong Addressee::getCsum4List( const QStringList & attList) |
179 | { | 179 | { |
180 | int max = attList.count(); | 180 | int max = attList.count(); |
181 | ulong cSum = 0; | 181 | ulong cSum = 0; |
182 | int j,k,i; | 182 | int j,k,i; |
183 | int add; | 183 | int add; |
184 | for ( i = 0; i < max ; ++i ) { | 184 | for ( i = 0; i < max ; ++i ) { |
185 | QString s = attList[i]; | 185 | QString s = attList[i]; |
186 | if ( ! s.isEmpty() ){ | 186 | if ( ! s.isEmpty() ){ |
187 | j = s.length(); | 187 | j = s.length(); |
188 | for ( k = 0; k < j; ++k ) { | 188 | for ( k = 0; k < j; ++k ) { |
189 | int mul = k +1; | 189 | int mul = k +1; |
190 | add = s[k].unicode (); | 190 | add = s[k].unicode (); |
191 | if ( k < 16 ) | 191 | if ( k < 16 ) |
192 | mul = mul * mul; | 192 | mul = mul * mul; |
193 | int ii = i+1; | 193 | int ii = i+1; |
194 | add = add * mul *ii*ii*ii; | 194 | add = add * mul *ii*ii*ii; |
195 | cSum += add; | 195 | cSum += add; |
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | } | 199 | } |
200 | //QString dump = attList.join(","); | 200 | //QString dump = attList.join(","); |
201 | //qDebug("csum: %d %s", cSum,dump.latin1()); | 201 | //qDebug("csum: %d %s", cSum,dump.latin1()); |
202 | 202 | ||
203 | return cSum; | 203 | return cSum; |
204 | 204 | ||
205 | } | 205 | } |
206 | void Addressee::computeCsum(const QString &dev) | 206 | void Addressee::computeCsum(const QString &dev) |
207 | { | 207 | { |
208 | QStringList l; | 208 | QStringList l; |
209 | if ( !mData->name.isEmpty() ) l.append(mData->name); | 209 | if ( !mData->name.isEmpty() ) l.append(mData->name); |
210 | if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); | 210 | if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); |
211 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); | 211 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); |
212 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); | 212 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); |
213 | if ( !mData->additionalName ) l.append( mData->additionalName ); | 213 | if ( !mData->additionalName ) l.append( mData->additionalName ); |
214 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); | 214 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); |
215 | if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); | 215 | if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); |
216 | if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); | 216 | if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); |
217 | if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); | 217 | if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); |
218 | if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); | 218 | if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); |
219 | if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); | 219 | if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); |
220 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); | 220 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); |
221 | if ( !mData->title .isEmpty() ) l.append( mData->title ); | 221 | if ( !mData->title .isEmpty() ) l.append( mData->title ); |
222 | if ( !mData->role.isEmpty() ) l.append( mData->role ); | 222 | if ( !mData->role.isEmpty() ) l.append( mData->role ); |
223 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); | 223 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); |
224 | if ( !mData->note.isEmpty() ) l.append( mData->note ); | 224 | if ( !mData->note.isEmpty() ) l.append( mData->note ); |
225 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); | 225 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); |
226 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); | 226 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); |
227 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); | 227 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); |
228 | // if ( !mData->logo.isEmpty() ) l.append( ); | 228 | // if ( !mData->logo.isEmpty() ) l.append( ); |
229 | //if ( !mData->photo.isEmpty() ) l.append( ); | 229 | //if ( !mData->photo.isEmpty() ) l.append( ); |
230 | //if ( !mData->sound.isEmpty() ) l.append( ); | 230 | //if ( !mData->sound.isEmpty() ) l.append( ); |
231 | //if ( !mData->agent.isEmpty() ) l.append( ); | 231 | //if ( !mData->agent.isEmpty() ) l.append( ); |
232 | //if ( mData->url.isValid() ) l.append( ); | 232 | //if ( mData->url.isValid() ) l.append( ); |
233 | #if 0 | 233 | #if 0 |
234 | if ( !mData->phoneNumbers.isEmpty() ) l.append( ); | 234 | if ( !mData->phoneNumbers.isEmpty() ) l.append( ); |
235 | if ( !mData->addresses.isEmpty() ) l.append( ); | 235 | if ( !mData->addresses.isEmpty() ) l.append( ); |
236 | //if ( !mData->keys.isEmpty() ) l.append( ); | 236 | //if ( !mData->keys.isEmpty() ) l.append( ); |
237 | if ( !mData->emails.isEmpty() ) l.append( ); | 237 | if ( !mData->emails.isEmpty() ) l.append( ); |
238 | if ( !mData->categories .isEmpty() ) l.append( ); | 238 | if ( !mData->categories .isEmpty() ) l.append( ); |
239 | if ( !mData->custom.isEmpty() ) l.append( ); | 239 | if ( !mData->custom.isEmpty() ) l.append( ); |
240 | #endif | 240 | #endif |
241 | KABC::PhoneNumber::List phoneNumbers; | 241 | KABC::PhoneNumber::List phoneNumbers; |
242 | KABC::PhoneNumber::List::Iterator phoneIter; | 242 | KABC::PhoneNumber::List::Iterator phoneIter; |
243 | 243 | ||
244 | QStringList t; | 244 | QStringList t; |
245 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 245 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
246 | ++phoneIter ) | 246 | ++phoneIter ) |
247 | t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); | 247 | t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); |
248 | t.sort(); | 248 | t.sort(); |
249 | uint iii; | 249 | uint iii; |
250 | for ( iii = 0; iii < t.count(); ++iii) | 250 | for ( iii = 0; iii < t.count(); ++iii) |
251 | l.append( t[iii] ); | 251 | l.append( t[iii] ); |
252 | t = mData->emails; | 252 | t = mData->emails; |
253 | t.sort(); | 253 | t.sort(); |
254 | for ( iii = 0; iii < t.count(); ++iii) | 254 | for ( iii = 0; iii < t.count(); ++iii) |
255 | l.append( t[iii] ); | 255 | l.append( t[iii] ); |
256 | t = mData->categories; | 256 | t = mData->categories; |
257 | t.sort(); | 257 | t.sort(); |
258 | for ( iii = 0; iii < t.count(); ++iii) | 258 | for ( iii = 0; iii < t.count(); ++iii) |
259 | l.append( t[iii] ); | 259 | l.append( t[iii] ); |
260 | t = mData->custom; | 260 | t = mData->custom; |
261 | t.sort(); | 261 | t.sort(); |
262 | for ( iii = 0; iii < t.count(); ++iii) | 262 | for ( iii = 0; iii < t.count(); ++iii) |
263 | l.append( t[iii] ); | 263 | l.append( t[iii] ); |
264 | KABC::Address::List::Iterator addressIter; | 264 | KABC::Address::List::Iterator addressIter; |
265 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); | 265 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); |
266 | ++addressIter ) { | 266 | ++addressIter ) { |
267 | t = (*addressIter).asList(); | 267 | t = (*addressIter).asList(); |
268 | t.sort(); | 268 | t.sort(); |
269 | for ( iii = 0; iii < t.count(); ++iii) | 269 | for ( iii = 0; iii < t.count(); ++iii) |
270 | l.append( t[iii] ); | 270 | l.append( t[iii] ); |
271 | } | 271 | } |
272 | uint cs = getCsum4List(l); | 272 | uint cs = getCsum4List(l); |
273 | // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); | 273 | // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); |
274 | setCsum( dev, QString::number (cs )); | 274 | setCsum( dev, QString::number (cs )); |
275 | } | 275 | } |
276 | 276 | ||
277 | void Addressee::mergeContact( const Addressee& ad ) | 277 | void Addressee::mergeContact( const Addressee& ad ) |
278 | { | 278 | { |
279 | 279 | ||
280 | detach(); | 280 | detach(); |
281 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; | 281 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; |
282 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; | 282 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; |
283 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; | 283 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; |
284 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; | 284 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; |
285 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; | 285 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; |
286 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; | 286 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; |
287 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; | 287 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; |
288 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; | 288 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; |
289 | if ( !mData->birthday.isValid() ) | 289 | if ( !mData->birthday.isValid() ) |
290 | if ( ad.mData->birthday.isValid()) | 290 | if ( ad.mData->birthday.isValid()) |
291 | mData->birthday = ad.mData->birthday; | 291 | mData->birthday = ad.mData->birthday; |
292 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; | 292 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; |
293 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; | 293 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; |
294 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; | 294 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; |
295 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; | 295 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; |
296 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; | 296 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; |
297 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | 297 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; |
298 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | 298 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; |
299 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; | 299 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
300 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; | 300 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
301 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | 301 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; |
302 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; | 302 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; |
303 | 303 | ||
304 | // pending: | 304 | // pending: |
305 | // merging phonenumbers | 305 | // merging phonenumbers |
306 | // merging addresses | 306 | // merging addresses |
307 | // merging emails; | 307 | // merging emails; |
308 | // merging categories; | 308 | // merging categories; |
309 | // merging custom; | 309 | // merging custom; |
310 | // merging keys | 310 | // merging keys |
311 | qDebug("merge contact %s ", ad.uid().latin1()); | ||
312 | setUid( ad.uid() ); | ||
311 | } | 313 | } |
312 | 314 | ||
313 | void Addressee::removeID(const QString &prof) | 315 | void Addressee::removeID(const QString &prof) |
314 | { | 316 | { |
315 | detach(); | 317 | detach(); |
316 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 318 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); |
317 | 319 | ||
318 | } | 320 | } |
319 | void Addressee::setID( const QString & prof , const QString & id ) | 321 | void Addressee::setID( const QString & prof , const QString & id ) |
320 | { | 322 | { |
321 | detach(); | 323 | detach(); |
322 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 324 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
323 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 325 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
324 | } | 326 | } |
325 | void Addressee::setTempSyncStat( int id ) | 327 | void Addressee::setTempSyncStat( int id ) |
326 | { | 328 | { |
327 | if ( mData->mTempSyncStat == id ) return; | 329 | if ( mData->mTempSyncStat == id ) return; |
328 | detach(); | 330 | detach(); |
329 | mData->mTempSyncStat = id; | 331 | mData->mTempSyncStat = id; |
330 | } | 332 | } |
331 | int Addressee::tempSyncStat() const | 333 | int Addressee::tempSyncStat() const |
332 | { | 334 | { |
333 | return mData->mTempSyncStat; | 335 | return mData->mTempSyncStat; |
334 | } | 336 | } |
335 | 337 | ||
336 | QString Addressee::getID( const QString & prof) | 338 | QString Addressee::getID( const QString & prof) |
337 | { | 339 | { |
338 | return KIdManager::getId ( mData->mExternalId, prof ); | 340 | return KIdManager::getId ( mData->mExternalId, prof ); |
339 | } | 341 | } |
340 | 342 | ||
341 | void Addressee::setCsum( const QString & prof , const QString & id ) | 343 | void Addressee::setCsum( const QString & prof , const QString & id ) |
342 | { | 344 | { |
343 | detach(); | 345 | detach(); |
344 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 346 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
345 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); | 347 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); |
346 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); | 348 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); |
347 | } | 349 | } |
348 | 350 | ||
349 | QString Addressee::getCsum( const QString & prof) | 351 | QString Addressee::getCsum( const QString & prof) |
350 | { | 352 | { |
351 | return KIdManager::getCsum ( mData->mExternalId, prof ); | 353 | return KIdManager::getCsum ( mData->mExternalId, prof ); |
352 | } | 354 | } |
353 | 355 | ||
354 | void Addressee::setIDStr( const QString & s ) | 356 | void Addressee::setIDStr( const QString & s ) |
355 | { | 357 | { |
356 | detach(); | 358 | detach(); |
357 | mData->mExternalId = s; | 359 | mData->mExternalId = s; |
358 | } | 360 | } |
359 | 361 | ||
360 | QString Addressee::IDStr() const | 362 | QString Addressee::IDStr() const |
361 | { | 363 | { |
362 | return mData->mExternalId; | 364 | return mData->mExternalId; |
363 | } | 365 | } |
364 | 366 | ||
365 | void Addressee::setExternalUID( const QString &id ) | 367 | void Addressee::setExternalUID( const QString &id ) |
366 | { | 368 | { |
367 | if ( id == mData->externalUID ) return; | 369 | if ( id == mData->externalUID ) return; |
368 | detach(); | 370 | detach(); |
369 | mData->empty = false; | 371 | mData->empty = false; |
370 | mData->externalUID = id; | 372 | mData->externalUID = id; |
371 | } | 373 | } |
372 | 374 | ||
373 | QString Addressee::externalUID() const | 375 | QString Addressee::externalUID() const |
374 | { | 376 | { |
375 | return mData->externalUID; | 377 | return mData->externalUID; |
376 | } | 378 | } |
377 | void Addressee::setOriginalExternalUID( const QString &id ) | 379 | void Addressee::setOriginalExternalUID( const QString &id ) |
378 | { | 380 | { |
379 | if ( id == mData->originalExternalUID ) return; | 381 | if ( id == mData->originalExternalUID ) return; |
380 | detach(); | 382 | detach(); |
381 | mData->empty = false; | 383 | mData->empty = false; |
384 | qDebug("*******Set orig uid %s ", id.latin1()); | ||
382 | mData->originalExternalUID = id; | 385 | mData->originalExternalUID = id; |
383 | } | 386 | } |
384 | 387 | ||
385 | QString Addressee::originalExternalUID() const | 388 | QString Addressee::originalExternalUID() const |
386 | { | 389 | { |
387 | return mData->originalExternalUID; | 390 | return mData->originalExternalUID; |
388 | } | 391 | } |
389 | 392 | ||
390 | void Addressee::setUid( const QString &id ) | 393 | void Addressee::setUid( const QString &id ) |
391 | { | 394 | { |
392 | if ( id == mData->uid ) return; | 395 | if ( id == mData->uid ) return; |
393 | detach(); | 396 | detach(); |
397 | qDebug("****setuid %s ", id.latin1()); | ||
394 | mData->empty = false; | 398 | mData->empty = false; |
395 | mData->uid = id; | 399 | mData->uid = id; |
396 | } | 400 | } |
397 | 401 | ||
398 | QString Addressee::uid() const | 402 | QString Addressee::uid() const |
399 | { | 403 | { |
400 | if ( mData->uid.isEmpty() ) | 404 | if ( mData->uid.isEmpty() ) |
401 | mData->uid = KApplication::randomString( 10 ); | 405 | mData->uid = KApplication::randomString( 10 ); |
402 | 406 | ||
403 | return mData->uid; | 407 | return mData->uid; |
404 | } | 408 | } |
405 | 409 | ||
406 | QString Addressee::uidLabel() | 410 | QString Addressee::uidLabel() |
407 | { | 411 | { |
408 | return i18n("Unique Identifier"); | 412 | return i18n("Unique Identifier"); |
409 | } | 413 | } |
410 | 414 | ||
411 | void Addressee::setName( const QString &name ) | 415 | void Addressee::setName( const QString &name ) |
412 | { | 416 | { |
413 | if ( name == mData->name ) return; | 417 | if ( name == mData->name ) return; |
414 | detach(); | 418 | detach(); |
415 | mData->empty = false; | 419 | mData->empty = false; |
416 | mData->name = name; | 420 | mData->name = name; |
417 | } | 421 | } |
418 | 422 | ||
419 | QString Addressee::name() const | 423 | QString Addressee::name() const |
420 | { | 424 | { |
421 | return mData->name; | 425 | return mData->name; |
422 | } | 426 | } |
423 | 427 | ||
424 | QString Addressee::nameLabel() | 428 | QString Addressee::nameLabel() |
425 | { | 429 | { |
426 | return i18n("Name"); | 430 | return i18n("Name"); |
427 | } | 431 | } |
428 | 432 | ||
429 | 433 | ||
430 | void Addressee::setFormattedName( const QString &formattedName ) | 434 | void Addressee::setFormattedName( const QString &formattedName ) |
431 | { | 435 | { |
432 | if ( formattedName == mData->formattedName ) return; | 436 | if ( formattedName == mData->formattedName ) return; |
433 | detach(); | 437 | detach(); |
434 | mData->empty = false; | 438 | mData->empty = false; |
435 | mData->formattedName = formattedName; | 439 | mData->formattedName = formattedName; |
436 | } | 440 | } |
437 | 441 | ||
438 | QString Addressee::formattedName() const | 442 | QString Addressee::formattedName() const |
439 | { | 443 | { |
440 | return mData->formattedName; | 444 | return mData->formattedName; |
441 | } | 445 | } |
442 | 446 | ||
443 | QString Addressee::formattedNameLabel() | 447 | QString Addressee::formattedNameLabel() |
444 | { | 448 | { |
445 | return i18n("Formatted Name"); | 449 | return i18n("Formatted Name"); |
446 | } | 450 | } |
447 | 451 | ||
448 | 452 | ||
449 | void Addressee::setFamilyName( const QString &familyName ) | 453 | void Addressee::setFamilyName( const QString &familyName ) |
450 | { | 454 | { |
451 | if ( familyName == mData->familyName ) return; | 455 | if ( familyName == mData->familyName ) return; |
452 | detach(); | 456 | detach(); |
453 | mData->empty = false; | 457 | mData->empty = false; |
454 | mData->familyName = familyName; | 458 | mData->familyName = familyName; |
455 | } | 459 | } |
456 | 460 | ||
457 | QString Addressee::familyName() const | 461 | QString Addressee::familyName() const |
458 | { | 462 | { |
459 | return mData->familyName; | 463 | return mData->familyName; |
460 | } | 464 | } |
461 | 465 | ||
462 | QString Addressee::familyNameLabel() | 466 | QString Addressee::familyNameLabel() |
463 | { | 467 | { |
464 | return i18n("Family Name"); | 468 | return i18n("Family Name"); |
465 | } | 469 | } |
466 | 470 | ||
467 | 471 | ||
468 | void Addressee::setGivenName( const QString &givenName ) | 472 | void Addressee::setGivenName( const QString &givenName ) |
469 | { | 473 | { |
470 | if ( givenName == mData->givenName ) return; | 474 | if ( givenName == mData->givenName ) return; |
471 | detach(); | 475 | detach(); |
472 | mData->empty = false; | 476 | mData->empty = false; |
473 | mData->givenName = givenName; | 477 | mData->givenName = givenName; |
474 | } | 478 | } |
475 | 479 | ||
476 | QString Addressee::givenName() const | 480 | QString Addressee::givenName() const |
477 | { | 481 | { |
478 | return mData->givenName; | 482 | return mData->givenName; |
479 | } | 483 | } |
480 | 484 | ||
481 | QString Addressee::givenNameLabel() | 485 | QString Addressee::givenNameLabel() |
482 | { | 486 | { |
483 | return i18n("Given Name"); | 487 | return i18n("Given Name"); |
484 | } | 488 | } |
485 | 489 | ||
486 | 490 | ||
487 | void Addressee::setAdditionalName( const QString &additionalName ) | 491 | void Addressee::setAdditionalName( const QString &additionalName ) |
488 | { | 492 | { |
489 | if ( additionalName == mData->additionalName ) return; | 493 | if ( additionalName == mData->additionalName ) return; |
490 | detach(); | 494 | detach(); |
491 | mData->empty = false; | 495 | mData->empty = false; |
492 | mData->additionalName = additionalName; | 496 | mData->additionalName = additionalName; |
493 | } | 497 | } |
494 | 498 | ||
495 | QString Addressee::additionalName() const | 499 | QString Addressee::additionalName() const |
496 | { | 500 | { |
497 | return mData->additionalName; | 501 | return mData->additionalName; |
498 | } | 502 | } |
499 | 503 | ||
500 | QString Addressee::additionalNameLabel() | 504 | QString Addressee::additionalNameLabel() |
501 | { | 505 | { |
502 | return i18n("Additional Names"); | 506 | return i18n("Additional Names"); |
503 | } | 507 | } |
504 | 508 | ||
505 | 509 | ||
506 | void Addressee::setPrefix( const QString &prefix ) | 510 | void Addressee::setPrefix( const QString &prefix ) |
507 | { | 511 | { |
508 | if ( prefix == mData->prefix ) return; | 512 | if ( prefix == mData->prefix ) return; |
509 | detach(); | 513 | detach(); |
510 | mData->empty = false; | 514 | mData->empty = false; |
511 | mData->prefix = prefix; | 515 | mData->prefix = prefix; |
512 | } | 516 | } |
513 | 517 | ||
514 | QString Addressee::prefix() const | 518 | QString Addressee::prefix() const |
515 | { | 519 | { |
516 | return mData->prefix; | 520 | return mData->prefix; |
517 | } | 521 | } |
518 | 522 | ||
519 | QString Addressee::prefixLabel() | 523 | QString Addressee::prefixLabel() |
520 | { | 524 | { |
521 | return i18n("Honorific Prefixes"); | 525 | return i18n("Honorific Prefixes"); |
522 | } | 526 | } |
523 | 527 | ||
524 | 528 | ||
525 | void Addressee::setSuffix( const QString &suffix ) | 529 | void Addressee::setSuffix( const QString &suffix ) |
526 | { | 530 | { |
527 | if ( suffix == mData->suffix ) return; | 531 | if ( suffix == mData->suffix ) return; |
528 | detach(); | 532 | detach(); |
529 | mData->empty = false; | 533 | mData->empty = false; |
530 | mData->suffix = suffix; | 534 | mData->suffix = suffix; |
531 | } | 535 | } |
532 | 536 | ||
533 | QString Addressee::suffix() const | 537 | QString Addressee::suffix() const |
534 | { | 538 | { |
535 | return mData->suffix; | 539 | return mData->suffix; |
536 | } | 540 | } |
537 | 541 | ||
538 | QString Addressee::suffixLabel() | 542 | QString Addressee::suffixLabel() |
539 | { | 543 | { |
540 | return i18n("Honorific Suffixes"); | 544 | return i18n("Honorific Suffixes"); |
541 | } | 545 | } |
542 | 546 | ||
543 | 547 | ||
544 | void Addressee::setNickName( const QString &nickName ) | 548 | void Addressee::setNickName( const QString &nickName ) |
545 | { | 549 | { |
546 | if ( nickName == mData->nickName ) return; | 550 | if ( nickName == mData->nickName ) return; |
547 | detach(); | 551 | detach(); |
548 | mData->empty = false; | 552 | mData->empty = false; |
549 | mData->nickName = nickName; | 553 | mData->nickName = nickName; |
550 | } | 554 | } |
551 | 555 | ||
552 | QString Addressee::nickName() const | 556 | QString Addressee::nickName() const |
553 | { | 557 | { |
554 | return mData->nickName; | 558 | return mData->nickName; |
555 | } | 559 | } |
556 | 560 | ||
557 | QString Addressee::nickNameLabel() | 561 | QString Addressee::nickNameLabel() |
558 | { | 562 | { |
559 | return i18n("Nick Name"); | 563 | return i18n("Nick Name"); |
560 | } | 564 | } |
561 | 565 | ||
562 | 566 | ||
563 | void Addressee::setBirthday( const QDateTime &birthday ) | 567 | void Addressee::setBirthday( const QDateTime &birthday ) |
564 | { | 568 | { |
565 | if ( birthday == mData->birthday ) return; | 569 | if ( birthday == mData->birthday ) return; |
566 | detach(); | 570 | detach(); |
567 | mData->empty = false; | 571 | mData->empty = false; |
568 | mData->birthday = birthday; | 572 | mData->birthday = birthday; |
569 | } | 573 | } |
570 | 574 | ||
571 | QDateTime Addressee::birthday() const | 575 | QDateTime Addressee::birthday() const |
572 | { | 576 | { |
573 | return mData->birthday; | 577 | return mData->birthday; |
574 | } | 578 | } |
575 | 579 | ||
576 | QString Addressee::birthdayLabel() | 580 | QString Addressee::birthdayLabel() |
577 | { | 581 | { |
578 | return i18n("Birthday"); | 582 | return i18n("Birthday"); |
579 | } | 583 | } |
580 | 584 | ||
581 | 585 | ||
582 | QString Addressee::homeAddressStreetLabel() | 586 | QString Addressee::homeAddressStreetLabel() |
583 | { | 587 | { |
584 | return i18n("Home Address Street"); | 588 | return i18n("Home Address Street"); |
585 | } | 589 | } |
586 | 590 | ||
587 | 591 | ||
588 | QString Addressee::homeAddressLocalityLabel() | 592 | QString Addressee::homeAddressLocalityLabel() |
589 | { | 593 | { |
590 | return i18n("Home Address Locality"); | 594 | return i18n("Home Address Locality"); |
591 | } | 595 | } |
592 | 596 | ||
593 | 597 | ||
594 | QString Addressee::homeAddressRegionLabel() | 598 | QString Addressee::homeAddressRegionLabel() |
595 | { | 599 | { |
596 | return i18n("Home Address Region"); | 600 | return i18n("Home Address Region"); |
597 | } | 601 | } |
598 | 602 | ||
599 | 603 | ||
600 | QString Addressee::homeAddressPostalCodeLabel() | 604 | QString Addressee::homeAddressPostalCodeLabel() |
601 | { | 605 | { |
602 | return i18n("Home Address Postal Code"); | 606 | return i18n("Home Address Postal Code"); |
603 | } | 607 | } |
604 | 608 | ||
605 | 609 | ||
606 | QString Addressee::homeAddressCountryLabel() | 610 | QString Addressee::homeAddressCountryLabel() |
607 | { | 611 | { |
608 | return i18n("Home Address Country"); | 612 | return i18n("Home Address Country"); |
609 | } | 613 | } |
610 | 614 | ||
611 | 615 | ||
612 | QString Addressee::homeAddressLabelLabel() | 616 | QString Addressee::homeAddressLabelLabel() |
613 | { | 617 | { |
614 | return i18n("Home Address Label"); | 618 | return i18n("Home Address Label"); |
615 | } | 619 | } |
616 | 620 | ||
617 | 621 | ||
618 | QString Addressee::businessAddressStreetLabel() | 622 | QString Addressee::businessAddressStreetLabel() |
619 | { | 623 | { |
620 | return i18n("Business Address Street"); | 624 | return i18n("Business Address Street"); |
621 | } | 625 | } |
622 | 626 | ||
623 | 627 | ||
624 | QString Addressee::businessAddressLocalityLabel() | 628 | QString Addressee::businessAddressLocalityLabel() |
625 | { | 629 | { |
626 | return i18n("Business Address Locality"); | 630 | return i18n("Business Address Locality"); |
627 | } | 631 | } |
628 | 632 | ||
629 | 633 | ||
630 | QString Addressee::businessAddressRegionLabel() | 634 | QString Addressee::businessAddressRegionLabel() |
631 | { | 635 | { |
632 | return i18n("Business Address Region"); | 636 | return i18n("Business Address Region"); |
633 | } | 637 | } |
634 | 638 | ||
635 | 639 | ||
636 | QString Addressee::businessAddressPostalCodeLabel() | 640 | QString Addressee::businessAddressPostalCodeLabel() |
637 | { | 641 | { |
638 | return i18n("Business Address Postal Code"); | 642 | return i18n("Business Address Postal Code"); |
639 | } | 643 | } |
640 | 644 | ||
641 | 645 | ||
642 | QString Addressee::businessAddressCountryLabel() | 646 | QString Addressee::businessAddressCountryLabel() |
643 | { | 647 | { |
644 | return i18n("Business Address Country"); | 648 | return i18n("Business Address Country"); |
645 | } | 649 | } |
646 | 650 | ||
647 | 651 | ||
648 | QString Addressee::businessAddressLabelLabel() | 652 | QString Addressee::businessAddressLabelLabel() |
649 | { | 653 | { |
650 | return i18n("Business Address Label"); | 654 | return i18n("Business Address Label"); |
651 | } | 655 | } |
652 | 656 | ||
653 | 657 | ||
654 | QString Addressee::homePhoneLabel() | 658 | QString Addressee::homePhoneLabel() |
655 | { | 659 | { |
656 | return i18n("Home Phone"); | 660 | return i18n("Home Phone"); |
657 | } | 661 | } |
658 | 662 | ||
659 | 663 | ||
660 | QString Addressee::businessPhoneLabel() | 664 | QString Addressee::businessPhoneLabel() |
661 | { | 665 | { |
662 | return i18n("Business Phone"); | 666 | return i18n("Business Phone"); |
663 | } | 667 | } |
664 | 668 | ||
665 | 669 | ||
666 | QString Addressee::mobilePhoneLabel() | 670 | QString Addressee::mobilePhoneLabel() |
667 | { | 671 | { |
668 | return i18n("Mobile Phone"); | 672 | return i18n("Mobile Phone"); |
669 | } | 673 | } |
670 | 674 | ||
671 | 675 | ||
672 | QString Addressee::homeFaxLabel() | 676 | QString Addressee::homeFaxLabel() |
673 | { | 677 | { |
674 | return i18n("Home Fax"); | 678 | return i18n("Home Fax"); |
675 | } | 679 | } |
676 | 680 | ||
677 | 681 | ||
678 | QString Addressee::businessFaxLabel() | 682 | QString Addressee::businessFaxLabel() |
679 | { | 683 | { |
680 | return i18n("Business Fax"); | 684 | return i18n("Business Fax"); |
681 | } | 685 | } |
682 | 686 | ||
683 | 687 | ||
684 | QString Addressee::carPhoneLabel() | 688 | QString Addressee::carPhoneLabel() |
685 | { | 689 | { |
686 | return i18n("Car Phone"); | 690 | return i18n("Car Phone"); |
687 | } | 691 | } |
688 | 692 | ||
689 | 693 | ||
690 | QString Addressee::isdnLabel() | 694 | QString Addressee::isdnLabel() |
691 | { | 695 | { |
692 | return i18n("ISDN"); | 696 | return i18n("ISDN"); |
693 | } | 697 | } |
694 | 698 | ||
695 | 699 | ||
696 | QString Addressee::pagerLabel() | 700 | QString Addressee::pagerLabel() |
697 | { | 701 | { |
698 | return i18n("Pager"); | 702 | return i18n("Pager"); |
699 | } | 703 | } |
700 | 704 | ||
701 | QString Addressee::sipLabel() | 705 | QString Addressee::sipLabel() |
702 | { | 706 | { |
703 | return i18n("SIP"); | 707 | return i18n("SIP"); |
704 | } | 708 | } |
705 | 709 | ||
706 | QString Addressee::emailLabel() | 710 | QString Addressee::emailLabel() |
707 | { | 711 | { |
708 | return i18n("Email Address"); | 712 | return i18n("Email Address"); |
709 | } | 713 | } |
710 | 714 | ||
711 | 715 | ||
712 | void Addressee::setMailer( const QString &mailer ) | 716 | void Addressee::setMailer( const QString &mailer ) |
713 | { | 717 | { |
714 | if ( mailer == mData->mailer ) return; | 718 | if ( mailer == mData->mailer ) return; |
715 | detach(); | 719 | detach(); |
716 | mData->empty = false; | 720 | mData->empty = false; |
717 | mData->mailer = mailer; | 721 | mData->mailer = mailer; |
718 | } | 722 | } |
719 | 723 | ||
720 | QString Addressee::mailer() const | 724 | QString Addressee::mailer() const |
721 | { | 725 | { |
722 | return mData->mailer; | 726 | return mData->mailer; |
723 | } | 727 | } |
724 | 728 | ||
725 | QString Addressee::mailerLabel() | 729 | QString Addressee::mailerLabel() |
726 | { | 730 | { |
727 | return i18n("Mail Client"); | 731 | return i18n("Mail Client"); |
728 | } | 732 | } |
729 | 733 | ||
730 | 734 | ||
731 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 735 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
732 | { | 736 | { |
733 | if ( timeZone == mData->timeZone ) return; | 737 | if ( timeZone == mData->timeZone ) return; |
734 | detach(); | 738 | detach(); |
735 | mData->empty = false; | 739 | mData->empty = false; |
736 | mData->timeZone = timeZone; | 740 | mData->timeZone = timeZone; |
737 | } | 741 | } |
738 | 742 | ||
739 | TimeZone Addressee::timeZone() const | 743 | TimeZone Addressee::timeZone() const |
740 | { | 744 | { |
741 | return mData->timeZone; | 745 | return mData->timeZone; |
742 | } | 746 | } |
743 | 747 | ||
744 | QString Addressee::timeZoneLabel() | 748 | QString Addressee::timeZoneLabel() |
745 | { | 749 | { |
746 | return i18n("Time Zone"); | 750 | return i18n("Time Zone"); |
747 | } | 751 | } |
748 | 752 | ||
749 | 753 | ||
750 | void Addressee::setGeo( const Geo &geo ) | 754 | void Addressee::setGeo( const Geo &geo ) |
751 | { | 755 | { |
752 | if ( geo == mData->geo ) return; | 756 | if ( geo == mData->geo ) return; |
753 | detach(); | 757 | detach(); |
754 | mData->empty = false; | 758 | mData->empty = false; |
755 | mData->geo = geo; | 759 | mData->geo = geo; |
756 | } | 760 | } |
757 | 761 | ||
758 | Geo Addressee::geo() const | 762 | Geo Addressee::geo() const |
759 | { | 763 | { |
760 | return mData->geo; | 764 | return mData->geo; |
761 | } | 765 | } |
762 | 766 | ||
763 | QString Addressee::geoLabel() | 767 | QString Addressee::geoLabel() |
764 | { | 768 | { |
765 | return i18n("Geographic Position"); | 769 | return i18n("Geographic Position"); |
766 | } | 770 | } |
767 | 771 | ||
768 | 772 | ||
769 | void Addressee::setTitle( const QString &title ) | 773 | void Addressee::setTitle( const QString &title ) |
770 | { | 774 | { |
771 | if ( title == mData->title ) return; | 775 | if ( title == mData->title ) return; |
772 | detach(); | 776 | detach(); |
773 | mData->empty = false; | 777 | mData->empty = false; |
774 | mData->title = title; | 778 | mData->title = title; |
775 | } | 779 | } |
776 | 780 | ||
777 | QString Addressee::title() const | 781 | QString Addressee::title() const |
778 | { | 782 | { |
779 | return mData->title; | 783 | return mData->title; |
780 | } | 784 | } |
781 | 785 | ||
782 | QString Addressee::titleLabel() | 786 | QString Addressee::titleLabel() |
783 | { | 787 | { |
784 | return i18n("Title"); | 788 | return i18n("Title"); |
785 | } | 789 | } |
786 | 790 | ||
787 | 791 | ||
788 | void Addressee::setRole( const QString &role ) | 792 | void Addressee::setRole( const QString &role ) |
789 | { | 793 | { |
790 | if ( role == mData->role ) return; | 794 | if ( role == mData->role ) return; |
791 | detach(); | 795 | detach(); |
792 | mData->empty = false; | 796 | mData->empty = false; |
793 | mData->role = role; | 797 | mData->role = role; |
794 | } | 798 | } |
795 | 799 | ||
796 | QString Addressee::role() const | 800 | QString Addressee::role() const |
797 | { | 801 | { |
798 | return mData->role; | 802 | return mData->role; |
799 | } | 803 | } |
800 | 804 | ||
801 | QString Addressee::roleLabel() | 805 | QString Addressee::roleLabel() |
802 | { | 806 | { |
803 | return i18n("Role"); | 807 | return i18n("Role"); |
804 | } | 808 | } |
805 | 809 | ||
806 | 810 | ||
807 | void Addressee::setOrganization( const QString &organization ) | 811 | void Addressee::setOrganization( const QString &organization ) |
808 | { | 812 | { |
809 | if ( organization == mData->organization ) return; | 813 | if ( organization == mData->organization ) return; |
810 | detach(); | 814 | detach(); |
811 | mData->empty = false; | 815 | mData->empty = false; |
812 | mData->organization = organization; | 816 | mData->organization = organization; |
813 | } | 817 | } |
814 | 818 | ||
815 | QString Addressee::organization() const | 819 | QString Addressee::organization() const |
816 | { | 820 | { |
817 | return mData->organization; | 821 | return mData->organization; |
818 | } | 822 | } |
819 | 823 | ||
820 | QString Addressee::organizationLabel() | 824 | QString Addressee::organizationLabel() |
821 | { | 825 | { |
822 | return i18n("Organization"); | 826 | return i18n("Organization"); |
823 | } | 827 | } |
824 | 828 | ||
825 | 829 | ||
826 | void Addressee::setNote( const QString ¬e ) | 830 | void Addressee::setNote( const QString ¬e ) |
827 | { | 831 | { |
828 | if ( note == mData->note ) return; | 832 | if ( note == mData->note ) return; |
829 | detach(); | 833 | detach(); |
830 | mData->empty = false; | 834 | mData->empty = false; |
831 | mData->note = note; | 835 | mData->note = note; |
832 | } | 836 | } |
833 | 837 | ||
834 | QString Addressee::note() const | 838 | QString Addressee::note() const |
835 | { | 839 | { |
836 | return mData->note; | 840 | return mData->note; |
837 | } | 841 | } |
838 | 842 | ||
839 | QString Addressee::noteLabel() | 843 | QString Addressee::noteLabel() |
840 | { | 844 | { |
841 | return i18n("Note"); | 845 | return i18n("Note"); |
842 | } | 846 | } |
843 | 847 | ||
844 | 848 | ||
845 | void Addressee::setProductId( const QString &productId ) | 849 | void Addressee::setProductId( const QString &productId ) |
846 | { | 850 | { |
847 | if ( productId == mData->productId ) return; | 851 | if ( productId == mData->productId ) return; |
848 | detach(); | 852 | detach(); |
849 | mData->empty = false; | 853 | mData->empty = false; |
850 | mData->productId = productId; | 854 | mData->productId = productId; |
851 | } | 855 | } |
852 | 856 | ||
853 | QString Addressee::productId() const | 857 | QString Addressee::productId() const |
854 | { | 858 | { |
855 | return mData->productId; | 859 | return mData->productId; |
856 | } | 860 | } |
857 | 861 | ||
858 | QString Addressee::productIdLabel() | 862 | QString Addressee::productIdLabel() |
859 | { | 863 | { |
860 | return i18n("Product Identifier"); | 864 | return i18n("Product Identifier"); |
861 | } | 865 | } |
862 | 866 | ||
863 | 867 | ||
864 | void Addressee::setRevision( const QDateTime &revision ) | 868 | void Addressee::setRevision( const QDateTime &revision ) |
865 | { | 869 | { |
866 | if ( revision == mData->revision ) return; | 870 | if ( revision == mData->revision ) return; |
867 | detach(); | 871 | detach(); |
868 | mData->empty = false; | 872 | mData->empty = false; |
869 | mData->revision = revision; | 873 | mData->revision = revision; |
870 | } | 874 | } |
871 | 875 | ||
872 | QDateTime Addressee::revision() const | 876 | QDateTime Addressee::revision() const |
873 | { | 877 | { |
874 | return mData->revision; | 878 | return mData->revision; |
875 | } | 879 | } |
876 | 880 | ||
877 | QString Addressee::revisionLabel() | 881 | QString Addressee::revisionLabel() |
878 | { | 882 | { |
879 | return i18n("Revision Date"); | 883 | return i18n("Revision Date"); |
880 | } | 884 | } |
881 | 885 | ||
882 | 886 | ||
883 | void Addressee::setSortString( const QString &sortString ) | 887 | void Addressee::setSortString( const QString &sortString ) |
884 | { | 888 | { |
885 | if ( sortString == mData->sortString ) return; | 889 | if ( sortString == mData->sortString ) return; |
886 | detach(); | 890 | detach(); |
887 | mData->empty = false; | 891 | mData->empty = false; |
888 | mData->sortString = sortString; | 892 | mData->sortString = sortString; |
889 | } | 893 | } |
890 | 894 | ||
891 | QString Addressee::sortString() const | 895 | QString Addressee::sortString() const |
892 | { | 896 | { |
893 | return mData->sortString; | 897 | return mData->sortString; |
894 | } | 898 | } |
895 | 899 | ||
896 | QString Addressee::sortStringLabel() | 900 | QString Addressee::sortStringLabel() |
897 | { | 901 | { |
898 | return i18n("Sort String"); | 902 | return i18n("Sort String"); |
899 | } | 903 | } |
900 | 904 | ||
901 | 905 | ||
902 | void Addressee::setUrl( const KURL &url ) | 906 | void Addressee::setUrl( const KURL &url ) |
903 | { | 907 | { |
904 | if ( url == mData->url ) return; | 908 | if ( url == mData->url ) return; |
905 | detach(); | 909 | detach(); |