author | zautrix <zautrix> | 2004-09-19 20:14:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-19 20:14:28 (UTC) |
commit | afa28a62314117555d6b32291188eedd1a576284 (patch) (unidiff) | |
tree | ea97a247de30a7a34480bc395e1996ab99247361 /kabc/addressee.cpp | |
parent | e0d8e062c9d8092e47dcadd88b30614ebff43c0c (diff) | |
download | kdepimpi-afa28a62314117555d6b32291188eedd1a576284.zip kdepimpi-afa28a62314117555d6b32291188eedd1a576284.tar.gz kdepimpi-afa28a62314117555d6b32291188eedd1a576284.tar.bz2 |
more AB sync
-rw-r--r-- | kabc/addressee.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 3a2dc5f..fda62f1 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1,759 +1,772 @@ | |||
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 | KURL url; | 71 | KURL url; |
71 | Secrecy secrecy; | 72 | Secrecy secrecy; |
72 | Picture logo; | 73 | Picture logo; |
73 | Picture photo; | 74 | Picture photo; |
74 | Sound sound; | 75 | Sound sound; |
75 | Agent agent; | 76 | Agent agent; |
76 | QString mExternalId; | 77 | QString mExternalId; |
77 | PhoneNumber::List phoneNumbers; | 78 | PhoneNumber::List phoneNumbers; |
78 | Address::List addresses; | 79 | Address::List addresses; |
79 | Key::List keys; | 80 | Key::List keys; |
80 | QStringList emails; | 81 | QStringList emails; |
81 | QStringList categories; | 82 | QStringList categories; |
82 | QStringList custom; | 83 | QStringList custom; |
83 | int mTempSyncStat; | 84 | int mTempSyncStat; |
84 | Resource *resource; | 85 | Resource *resource; |
85 | 86 | ||
86 | bool empty :1; | 87 | bool empty :1; |
87 | bool changed :1; | 88 | bool changed :1; |
88 | }; | 89 | }; |
89 | 90 | ||
90 | Addressee::Addressee() | 91 | Addressee::Addressee() |
91 | { | 92 | { |
92 | mData = new AddresseeData; | 93 | mData = new AddresseeData; |
93 | mData->empty = true; | 94 | mData->empty = true; |
94 | mData->changed = false; | 95 | mData->changed = false; |
95 | mData->resource = 0; | 96 | mData->resource = 0; |
96 | mData->mExternalId = ":"; | 97 | mData->mExternalId = ":"; |
97 | mData->revision = QDateTime ( QDate( 2004,1,1)); | 98 | mData->revision = QDateTime ( QDate( 2004,1,1)); |
98 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; | 99 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; |
99 | } | 100 | } |
100 | 101 | ||
101 | Addressee::~Addressee() | 102 | Addressee::~Addressee() |
102 | { | 103 | { |
103 | } | 104 | } |
104 | 105 | ||
105 | Addressee::Addressee( const Addressee &a ) | 106 | Addressee::Addressee( const Addressee &a ) |
106 | { | 107 | { |
107 | mData = a.mData; | 108 | mData = a.mData; |
108 | } | 109 | } |
109 | 110 | ||
110 | Addressee &Addressee::operator=( const Addressee &a ) | 111 | Addressee &Addressee::operator=( const Addressee &a ) |
111 | { | 112 | { |
112 | mData = a.mData; | 113 | mData = a.mData; |
113 | return (*this); | 114 | return (*this); |
114 | } | 115 | } |
115 | 116 | ||
116 | Addressee Addressee::copy() | 117 | Addressee Addressee::copy() |
117 | { | 118 | { |
118 | Addressee a; | 119 | Addressee a; |
119 | *(a.mData) = *mData; | 120 | *(a.mData) = *mData; |
120 | return a; | 121 | return a; |
121 | } | 122 | } |
122 | 123 | ||
123 | void Addressee::detach() | 124 | void Addressee::detach() |
124 | { | 125 | { |
125 | if ( mData.count() == 1 ) return; | 126 | if ( mData.count() == 1 ) return; |
126 | *this = copy(); | 127 | *this = copy(); |
127 | } | 128 | } |
128 | 129 | ||
129 | bool Addressee::operator==( const Addressee &a ) const | 130 | bool Addressee::operator==( const Addressee &a ) const |
130 | { | 131 | { |
131 | if ( uid() != a.uid() ) return false; | 132 | if ( uid() != a.uid() ) return false; |
132 | if ( mData->name != a.mData->name ) return false; | 133 | if ( mData->name != a.mData->name ) return false; |
133 | if ( mData->formattedName != a.mData->formattedName ) return false; | 134 | if ( mData->formattedName != a.mData->formattedName ) return false; |
134 | if ( mData->familyName != a.mData->familyName ) return false; | 135 | if ( mData->familyName != a.mData->familyName ) return false; |
135 | if ( mData->givenName != a.mData->givenName ) return false; | 136 | if ( mData->givenName != a.mData->givenName ) return false; |
136 | if ( mData->additionalName != a.mData->additionalName ) return false; | 137 | if ( mData->additionalName != a.mData->additionalName ) return false; |
137 | if ( mData->prefix != a.mData->prefix ) return false; | 138 | if ( mData->prefix != a.mData->prefix ) return false; |
138 | if ( mData->suffix != a.mData->suffix ) return false; | 139 | if ( mData->suffix != a.mData->suffix ) return false; |
139 | if ( mData->nickName != a.mData->nickName ) return false; | 140 | if ( mData->nickName != a.mData->nickName ) return false; |
140 | if ( mData->birthday != a.mData->birthday ) return false; | 141 | if ( mData->birthday != a.mData->birthday ) return false; |
141 | if ( mData->mailer != a.mData->mailer ) return false; | 142 | if ( mData->mailer != a.mData->mailer ) return false; |
142 | if ( mData->timeZone != a.mData->timeZone ) return false; | 143 | if ( mData->timeZone != a.mData->timeZone ) return false; |
143 | if ( mData->geo != a.mData->geo ) return false; | 144 | if ( mData->geo != a.mData->geo ) return false; |
144 | if ( mData->title != a.mData->title ) return false; | 145 | if ( mData->title != a.mData->title ) return false; |
145 | if ( mData->role != a.mData->role ) return false; | 146 | if ( mData->role != a.mData->role ) return false; |
146 | if ( mData->organization != a.mData->organization ) return false; | 147 | if ( mData->organization != a.mData->organization ) return false; |
147 | if ( mData->note != a.mData->note ) return false; | 148 | if ( mData->note != a.mData->note ) return false; |
148 | if ( mData->productId != a.mData->productId ) return false; | 149 | if ( mData->productId != a.mData->productId ) return false; |
149 | //if ( mData->revision != a.mData->revision ) return false; | 150 | //if ( mData->revision != a.mData->revision ) return false; |
150 | if ( mData->sortString != a.mData->sortString ) return false; | 151 | if ( mData->sortString != a.mData->sortString ) return false; |
151 | if ( mData->secrecy != a.mData->secrecy ) return false; | 152 | if ( mData->secrecy != a.mData->secrecy ) return false; |
152 | if ( mData->logo != a.mData->logo ) return false; | 153 | if ( mData->logo != a.mData->logo ) return false; |
153 | if ( mData->photo != a.mData->photo ) return false; | 154 | if ( mData->photo != a.mData->photo ) return false; |
154 | if ( mData->sound != a.mData->sound ) return false; | 155 | if ( mData->sound != a.mData->sound ) return false; |
155 | if ( mData->agent != a.mData->agent ) return false; | 156 | if ( mData->agent != a.mData->agent ) return false; |
156 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && | 157 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && |
157 | ( mData->url != a.mData->url ) ) return false; | 158 | ( mData->url != a.mData->url ) ) return false; |
158 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; | 159 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; |
159 | if ( mData->addresses != a.mData->addresses ) return false; | 160 | if ( mData->addresses != a.mData->addresses ) return false; |
160 | if ( mData->keys != a.mData->keys ) return false; | 161 | if ( mData->keys != a.mData->keys ) return false; |
161 | if ( mData->emails != a.mData->emails ) return false; | 162 | if ( mData->emails != a.mData->emails ) return false; |
162 | if ( mData->categories != a.mData->categories ) return false; | 163 | if ( mData->categories != a.mData->categories ) return false; |
163 | if ( mData->custom != a.mData->custom ) return false; | 164 | if ( mData->custom != a.mData->custom ) return false; |
164 | 165 | ||
165 | return true; | 166 | return true; |
166 | } | 167 | } |
167 | 168 | ||
168 | bool Addressee::operator!=( const Addressee &a ) const | 169 | bool Addressee::operator!=( const Addressee &a ) const |
169 | { | 170 | { |
170 | return !( a == *this ); | 171 | return !( a == *this ); |
171 | } | 172 | } |
172 | 173 | ||
173 | bool Addressee::isEmpty() const | 174 | bool Addressee::isEmpty() const |
174 | { | 175 | { |
175 | return mData->empty; | 176 | return mData->empty; |
176 | } | 177 | } |
177 | ulong Addressee::getCsum4List( const QStringList & attList) | 178 | ulong Addressee::getCsum4List( const QStringList & attList) |
178 | { | 179 | { |
179 | int max = attList.count(); | 180 | int max = attList.count(); |
180 | ulong cSum = 0; | 181 | ulong cSum = 0; |
181 | int j,k,i; | 182 | int j,k,i; |
182 | int add; | 183 | int add; |
183 | for ( i = 0; i < max ; ++i ) { | 184 | for ( i = 0; i < max ; ++i ) { |
184 | QString s = attList[i]; | 185 | QString s = attList[i]; |
185 | if ( ! s.isEmpty() ){ | 186 | if ( ! s.isEmpty() ){ |
186 | j = s.length(); | 187 | j = s.length(); |
187 | for ( k = 0; k < j; ++k ) { | 188 | for ( k = 0; k < j; ++k ) { |
188 | int mul = k +1; | 189 | int mul = k +1; |
189 | add = s[k].unicode (); | 190 | add = s[k].unicode (); |
190 | if ( k < 16 ) | 191 | if ( k < 16 ) |
191 | mul = mul * mul; | 192 | mul = mul * mul; |
192 | int ii = i+1; | 193 | int ii = i+1; |
193 | add = add * mul *ii*ii*ii; | 194 | add = add * mul *ii*ii*ii; |
194 | cSum += add; | 195 | cSum += add; |
195 | } | 196 | } |
196 | } | 197 | } |
197 | 198 | ||
198 | } | 199 | } |
199 | //QString dump = attList.join(","); | 200 | //QString dump = attList.join(","); |
200 | //qDebug("csum: %d %s", cSum,dump.latin1()); | 201 | //qDebug("csum: %d %s", cSum,dump.latin1()); |
201 | 202 | ||
202 | return cSum; | 203 | return cSum; |
203 | 204 | ||
204 | } | 205 | } |
205 | void Addressee::computeCsum(const QString &dev) | 206 | void Addressee::computeCsum(const QString &dev) |
206 | { | 207 | { |
207 | QStringList l; | 208 | QStringList l; |
208 | if ( !mData->name.isEmpty() ) l.append(mData->name); | 209 | if ( !mData->name.isEmpty() ) l.append(mData->name); |
209 | if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); | 210 | if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); |
210 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); | 211 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); |
211 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); | 212 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); |
212 | if ( !mData->additionalName ) l.append( mData->additionalName ); | 213 | if ( !mData->additionalName ) l.append( mData->additionalName ); |
213 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); | 214 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); |
214 | if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); | 215 | if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); |
215 | if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); | 216 | if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); |
216 | if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); | 217 | if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); |
217 | if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); | 218 | if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); |
218 | if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); | 219 | if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); |
219 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); | 220 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); |
220 | if ( !mData->title .isEmpty() ) l.append( mData->title ); | 221 | if ( !mData->title .isEmpty() ) l.append( mData->title ); |
221 | if ( !mData->role.isEmpty() ) l.append( mData->role ); | 222 | if ( !mData->role.isEmpty() ) l.append( mData->role ); |
222 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); | 223 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); |
223 | if ( !mData->note.isEmpty() ) l.append( mData->note ); | 224 | if ( !mData->note.isEmpty() ) l.append( mData->note ); |
224 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); | 225 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); |
225 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); | 226 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); |
226 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); | 227 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); |
227 | // if ( !mData->logo.isEmpty() ) l.append( ); | 228 | // if ( !mData->logo.isEmpty() ) l.append( ); |
228 | //if ( !mData->photo.isEmpty() ) l.append( ); | 229 | //if ( !mData->photo.isEmpty() ) l.append( ); |
229 | //if ( !mData->sound.isEmpty() ) l.append( ); | 230 | //if ( !mData->sound.isEmpty() ) l.append( ); |
230 | //if ( !mData->agent.isEmpty() ) l.append( ); | 231 | //if ( !mData->agent.isEmpty() ) l.append( ); |
231 | //if ( mData->url.isValid() ) l.append( ); | 232 | //if ( mData->url.isValid() ) l.append( ); |
232 | #if 0 | 233 | #if 0 |
233 | if ( !mData->phoneNumbers.isEmpty() ) l.append( ); | 234 | if ( !mData->phoneNumbers.isEmpty() ) l.append( ); |
234 | if ( !mData->addresses.isEmpty() ) l.append( ); | 235 | if ( !mData->addresses.isEmpty() ) l.append( ); |
235 | //if ( !mData->keys.isEmpty() ) l.append( ); | 236 | //if ( !mData->keys.isEmpty() ) l.append( ); |
236 | if ( !mData->emails.isEmpty() ) l.append( ); | 237 | if ( !mData->emails.isEmpty() ) l.append( ); |
237 | if ( !mData->categories .isEmpty() ) l.append( ); | 238 | if ( !mData->categories .isEmpty() ) l.append( ); |
238 | if ( !mData->custom.isEmpty() ) l.append( ); | 239 | if ( !mData->custom.isEmpty() ) l.append( ); |
239 | #endif | 240 | #endif |
240 | KABC::PhoneNumber::List phoneNumbers; | 241 | KABC::PhoneNumber::List phoneNumbers; |
241 | KABC::PhoneNumber::List::Iterator phoneIter; | 242 | KABC::PhoneNumber::List::Iterator phoneIter; |
242 | 243 | ||
243 | QStringList t; | 244 | QStringList t; |
244 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 245 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
245 | ++phoneIter ) | 246 | ++phoneIter ) |
246 | t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); | 247 | t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); |
247 | t.sort(); | 248 | t.sort(); |
248 | uint iii; | 249 | uint iii; |
249 | for ( iii = 0; iii < t.count(); ++iii) | 250 | for ( iii = 0; iii < t.count(); ++iii) |
250 | l.append( t[iii] ); | 251 | l.append( t[iii] ); |
251 | t = mData->emails; | 252 | t = mData->emails; |
252 | t.sort(); | 253 | t.sort(); |
253 | for ( iii = 0; iii < t.count(); ++iii) | 254 | for ( iii = 0; iii < t.count(); ++iii) |
254 | l.append( t[iii] ); | 255 | l.append( t[iii] ); |
255 | t = mData->categories; | 256 | t = mData->categories; |
256 | t.sort(); | 257 | t.sort(); |
257 | for ( iii = 0; iii < t.count(); ++iii) | 258 | for ( iii = 0; iii < t.count(); ++iii) |
258 | l.append( t[iii] ); | 259 | l.append( t[iii] ); |
259 | t = mData->custom; | 260 | t = mData->custom; |
260 | t.sort(); | 261 | t.sort(); |
261 | for ( iii = 0; iii < t.count(); ++iii) | 262 | for ( iii = 0; iii < t.count(); ++iii) |
262 | l.append( t[iii] ); | 263 | l.append( t[iii] ); |
263 | KABC::Address::List::Iterator addressIter; | 264 | KABC::Address::List::Iterator addressIter; |
264 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); | 265 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); |
265 | ++addressIter ) { | 266 | ++addressIter ) { |
266 | t = (*addressIter).asList(); | 267 | t = (*addressIter).asList(); |
267 | t.sort(); | 268 | t.sort(); |
268 | for ( iii = 0; iii < t.count(); ++iii) | 269 | for ( iii = 0; iii < t.count(); ++iii) |
269 | l.append( t[iii] ); | 270 | l.append( t[iii] ); |
270 | } | 271 | } |
271 | uint cs = getCsum4List(l); | 272 | uint cs = getCsum4List(l); |
272 | // 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() ); |
273 | setCsum( dev, QString::number (cs )); | 274 | setCsum( dev, QString::number (cs )); |
274 | } | 275 | } |
275 | 276 | ||
276 | void Addressee::mergeContact( const Addressee& ad ) | 277 | void Addressee::mergeContact( const Addressee& ad ) |
277 | { | 278 | { |
278 | 279 | ||
279 | detach(); | 280 | detach(); |
280 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; | 281 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; |
281 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; | 282 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; |
282 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; | 283 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; |
283 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; | 284 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; |
284 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; | 285 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; |
285 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; | 286 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; |
286 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; | 287 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; |
287 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; | 288 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; |
288 | if ( !mData->birthday.isValid() ) | 289 | if ( !mData->birthday.isValid() ) |
289 | if ( ad.mData->birthday.isValid()) | 290 | if ( ad.mData->birthday.isValid()) |
290 | mData->birthday = ad.mData->birthday; | 291 | mData->birthday = ad.mData->birthday; |
291 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; | 292 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; |
292 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; | 293 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; |
293 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; | 294 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; |
294 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; | 295 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; |
295 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; | 296 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; |
296 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | 297 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; |
297 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | 298 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; |
298 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; | 299 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
299 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; | 300 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
300 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | 301 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; |
301 | 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 ; |
302 | 303 | ||
303 | // pending: | 304 | // pending: |
304 | // merging phonenumbers | 305 | // merging phonenumbers |
305 | // merging addresses | 306 | // merging addresses |
306 | // merging emails; | 307 | // merging emails; |
307 | // merging categories; | 308 | // merging categories; |
308 | // merging custom; | 309 | // merging custom; |
309 | // merging keys | 310 | // merging keys |
310 | } | 311 | } |
311 | 312 | ||
312 | void Addressee::removeID(const QString &prof) | 313 | void Addressee::removeID(const QString &prof) |
313 | { | 314 | { |
314 | detach(); | 315 | detach(); |
315 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 316 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); |
316 | 317 | ||
317 | } | 318 | } |
318 | void Addressee::setID( const QString & prof , const QString & id ) | 319 | void Addressee::setID( const QString & prof , const QString & id ) |
319 | { | 320 | { |
320 | detach(); | 321 | detach(); |
321 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 322 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
322 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 323 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
323 | } | 324 | } |
324 | void Addressee::setTempSyncStat( int id ) | 325 | void Addressee::setTempSyncStat( int id ) |
325 | { | 326 | { |
326 | if ( mData->mTempSyncStat == id ) return; | 327 | if ( mData->mTempSyncStat == id ) return; |
327 | detach(); | 328 | detach(); |
328 | mData->mTempSyncStat = id; | 329 | mData->mTempSyncStat = id; |
329 | } | 330 | } |
330 | int Addressee::tempSyncStat() const | 331 | int Addressee::tempSyncStat() const |
331 | { | 332 | { |
332 | return mData->mTempSyncStat; | 333 | return mData->mTempSyncStat; |
333 | } | 334 | } |
334 | 335 | ||
335 | QString Addressee::getID( const QString & prof) | 336 | QString Addressee::getID( const QString & prof) |
336 | { | 337 | { |
337 | return KIdManager::getId ( mData->mExternalId, prof ); | 338 | return KIdManager::getId ( mData->mExternalId, prof ); |
338 | } | 339 | } |
339 | 340 | ||
340 | void Addressee::setCsum( const QString & prof , const QString & id ) | 341 | void Addressee::setCsum( const QString & prof , const QString & id ) |
341 | { | 342 | { |
342 | detach(); | 343 | detach(); |
343 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 344 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
344 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); | 345 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); |
345 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); | 346 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); |
346 | } | 347 | } |
347 | 348 | ||
348 | QString Addressee::getCsum( const QString & prof) | 349 | QString Addressee::getCsum( const QString & prof) |
349 | { | 350 | { |
350 | return KIdManager::getCsum ( mData->mExternalId, prof ); | 351 | return KIdManager::getCsum ( mData->mExternalId, prof ); |
351 | } | 352 | } |
352 | 353 | ||
353 | void Addressee::setIDStr( const QString & s ) | 354 | void Addressee::setIDStr( const QString & s ) |
354 | { | 355 | { |
355 | detach(); | 356 | detach(); |
356 | mData->mExternalId = s; | 357 | mData->mExternalId = s; |
357 | } | 358 | } |
358 | 359 | ||
359 | QString Addressee::IDStr() const | 360 | QString Addressee::IDStr() const |
360 | { | 361 | { |
361 | return mData->mExternalId; | 362 | return mData->mExternalId; |
362 | } | 363 | } |
363 | 364 | ||
364 | void Addressee::setExternalUID( const QString &id ) | 365 | void Addressee::setExternalUID( const QString &id ) |
365 | { | 366 | { |
366 | if ( id == mData->externalUID ) return; | 367 | if ( id == mData->externalUID ) return; |
367 | detach(); | 368 | detach(); |
368 | mData->empty = false; | 369 | mData->empty = false; |
369 | mData->externalUID = id; | 370 | mData->externalUID = id; |
370 | } | 371 | } |
371 | 372 | ||
372 | QString Addressee::externalUID() const | 373 | QString Addressee::externalUID() const |
373 | { | 374 | { |
374 | return mData->externalUID; | 375 | return mData->externalUID; |
375 | } | 376 | } |
377 | void Addressee::setOriginalExternalUID( const QString &id ) | ||
378 | { | ||
379 | if ( id == mData->originalExternalUID ) return; | ||
380 | detach(); | ||
381 | mData->empty = false; | ||
382 | mData->originalExternalUID = id; | ||
383 | } | ||
384 | |||
385 | QString Addressee::originalExternalUID() const | ||
386 | { | ||
387 | return mData->originalExternalUID; | ||
388 | } | ||
376 | 389 | ||
377 | void Addressee::setUid( const QString &id ) | 390 | void Addressee::setUid( const QString &id ) |
378 | { | 391 | { |
379 | if ( id == mData->uid ) return; | 392 | if ( id == mData->uid ) return; |
380 | detach(); | 393 | detach(); |
381 | mData->empty = false; | 394 | mData->empty = false; |
382 | mData->uid = id; | 395 | mData->uid = id; |
383 | } | 396 | } |
384 | 397 | ||
385 | QString Addressee::uid() const | 398 | QString Addressee::uid() const |
386 | { | 399 | { |
387 | if ( mData->uid.isEmpty() ) | 400 | if ( mData->uid.isEmpty() ) |
388 | mData->uid = KApplication::randomString( 10 ); | 401 | mData->uid = KApplication::randomString( 10 ); |
389 | 402 | ||
390 | return mData->uid; | 403 | return mData->uid; |
391 | } | 404 | } |
392 | 405 | ||
393 | QString Addressee::uidLabel() | 406 | QString Addressee::uidLabel() |
394 | { | 407 | { |
395 | return i18n("Unique Identifier"); | 408 | return i18n("Unique Identifier"); |
396 | } | 409 | } |
397 | 410 | ||
398 | void Addressee::setName( const QString &name ) | 411 | void Addressee::setName( const QString &name ) |
399 | { | 412 | { |
400 | if ( name == mData->name ) return; | 413 | if ( name == mData->name ) return; |
401 | detach(); | 414 | detach(); |
402 | mData->empty = false; | 415 | mData->empty = false; |
403 | mData->name = name; | 416 | mData->name = name; |
404 | } | 417 | } |
405 | 418 | ||
406 | QString Addressee::name() const | 419 | QString Addressee::name() const |
407 | { | 420 | { |
408 | return mData->name; | 421 | return mData->name; |
409 | } | 422 | } |
410 | 423 | ||
411 | QString Addressee::nameLabel() | 424 | QString Addressee::nameLabel() |
412 | { | 425 | { |
413 | return i18n("Name"); | 426 | return i18n("Name"); |
414 | } | 427 | } |
415 | 428 | ||
416 | 429 | ||
417 | void Addressee::setFormattedName( const QString &formattedName ) | 430 | void Addressee::setFormattedName( const QString &formattedName ) |
418 | { | 431 | { |
419 | if ( formattedName == mData->formattedName ) return; | 432 | if ( formattedName == mData->formattedName ) return; |
420 | detach(); | 433 | detach(); |
421 | mData->empty = false; | 434 | mData->empty = false; |
422 | mData->formattedName = formattedName; | 435 | mData->formattedName = formattedName; |
423 | } | 436 | } |
424 | 437 | ||
425 | QString Addressee::formattedName() const | 438 | QString Addressee::formattedName() const |
426 | { | 439 | { |
427 | return mData->formattedName; | 440 | return mData->formattedName; |
428 | } | 441 | } |
429 | 442 | ||
430 | QString Addressee::formattedNameLabel() | 443 | QString Addressee::formattedNameLabel() |
431 | { | 444 | { |
432 | return i18n("Formatted Name"); | 445 | return i18n("Formatted Name"); |
433 | } | 446 | } |
434 | 447 | ||
435 | 448 | ||
436 | void Addressee::setFamilyName( const QString &familyName ) | 449 | void Addressee::setFamilyName( const QString &familyName ) |
437 | { | 450 | { |
438 | if ( familyName == mData->familyName ) return; | 451 | if ( familyName == mData->familyName ) return; |
439 | detach(); | 452 | detach(); |
440 | mData->empty = false; | 453 | mData->empty = false; |
441 | mData->familyName = familyName; | 454 | mData->familyName = familyName; |
442 | } | 455 | } |
443 | 456 | ||
444 | QString Addressee::familyName() const | 457 | QString Addressee::familyName() const |
445 | { | 458 | { |
446 | return mData->familyName; | 459 | return mData->familyName; |
447 | } | 460 | } |
448 | 461 | ||
449 | QString Addressee::familyNameLabel() | 462 | QString Addressee::familyNameLabel() |
450 | { | 463 | { |
451 | return i18n("Family Name"); | 464 | return i18n("Family Name"); |
452 | } | 465 | } |
453 | 466 | ||
454 | 467 | ||
455 | void Addressee::setGivenName( const QString &givenName ) | 468 | void Addressee::setGivenName( const QString &givenName ) |
456 | { | 469 | { |
457 | if ( givenName == mData->givenName ) return; | 470 | if ( givenName == mData->givenName ) return; |
458 | detach(); | 471 | detach(); |
459 | mData->empty = false; | 472 | mData->empty = false; |
460 | mData->givenName = givenName; | 473 | mData->givenName = givenName; |
461 | } | 474 | } |
462 | 475 | ||
463 | QString Addressee::givenName() const | 476 | QString Addressee::givenName() const |
464 | { | 477 | { |
465 | return mData->givenName; | 478 | return mData->givenName; |
466 | } | 479 | } |
467 | 480 | ||
468 | QString Addressee::givenNameLabel() | 481 | QString Addressee::givenNameLabel() |
469 | { | 482 | { |
470 | return i18n("Given Name"); | 483 | return i18n("Given Name"); |
471 | } | 484 | } |
472 | 485 | ||
473 | 486 | ||
474 | void Addressee::setAdditionalName( const QString &additionalName ) | 487 | void Addressee::setAdditionalName( const QString &additionalName ) |
475 | { | 488 | { |
476 | if ( additionalName == mData->additionalName ) return; | 489 | if ( additionalName == mData->additionalName ) return; |
477 | detach(); | 490 | detach(); |
478 | mData->empty = false; | 491 | mData->empty = false; |
479 | mData->additionalName = additionalName; | 492 | mData->additionalName = additionalName; |
480 | } | 493 | } |
481 | 494 | ||
482 | QString Addressee::additionalName() const | 495 | QString Addressee::additionalName() const |
483 | { | 496 | { |
484 | return mData->additionalName; | 497 | return mData->additionalName; |
485 | } | 498 | } |
486 | 499 | ||
487 | QString Addressee::additionalNameLabel() | 500 | QString Addressee::additionalNameLabel() |
488 | { | 501 | { |
489 | return i18n("Additional Names"); | 502 | return i18n("Additional Names"); |
490 | } | 503 | } |
491 | 504 | ||
492 | 505 | ||
493 | void Addressee::setPrefix( const QString &prefix ) | 506 | void Addressee::setPrefix( const QString &prefix ) |
494 | { | 507 | { |
495 | if ( prefix == mData->prefix ) return; | 508 | if ( prefix == mData->prefix ) return; |
496 | detach(); | 509 | detach(); |
497 | mData->empty = false; | 510 | mData->empty = false; |
498 | mData->prefix = prefix; | 511 | mData->prefix = prefix; |
499 | } | 512 | } |
500 | 513 | ||
501 | QString Addressee::prefix() const | 514 | QString Addressee::prefix() const |
502 | { | 515 | { |
503 | return mData->prefix; | 516 | return mData->prefix; |
504 | } | 517 | } |
505 | 518 | ||
506 | QString Addressee::prefixLabel() | 519 | QString Addressee::prefixLabel() |
507 | { | 520 | { |
508 | return i18n("Honorific Prefixes"); | 521 | return i18n("Honorific Prefixes"); |
509 | } | 522 | } |
510 | 523 | ||
511 | 524 | ||
512 | void Addressee::setSuffix( const QString &suffix ) | 525 | void Addressee::setSuffix( const QString &suffix ) |
513 | { | 526 | { |
514 | if ( suffix == mData->suffix ) return; | 527 | if ( suffix == mData->suffix ) return; |
515 | detach(); | 528 | detach(); |
516 | mData->empty = false; | 529 | mData->empty = false; |
517 | mData->suffix = suffix; | 530 | mData->suffix = suffix; |
518 | } | 531 | } |
519 | 532 | ||
520 | QString Addressee::suffix() const | 533 | QString Addressee::suffix() const |
521 | { | 534 | { |
522 | return mData->suffix; | 535 | return mData->suffix; |
523 | } | 536 | } |
524 | 537 | ||
525 | QString Addressee::suffixLabel() | 538 | QString Addressee::suffixLabel() |
526 | { | 539 | { |
527 | return i18n("Honorific Suffixes"); | 540 | return i18n("Honorific Suffixes"); |
528 | } | 541 | } |
529 | 542 | ||
530 | 543 | ||
531 | void Addressee::setNickName( const QString &nickName ) | 544 | void Addressee::setNickName( const QString &nickName ) |
532 | { | 545 | { |
533 | if ( nickName == mData->nickName ) return; | 546 | if ( nickName == mData->nickName ) return; |
534 | detach(); | 547 | detach(); |
535 | mData->empty = false; | 548 | mData->empty = false; |
536 | mData->nickName = nickName; | 549 | mData->nickName = nickName; |
537 | } | 550 | } |
538 | 551 | ||
539 | QString Addressee::nickName() const | 552 | QString Addressee::nickName() const |
540 | { | 553 | { |
541 | return mData->nickName; | 554 | return mData->nickName; |
542 | } | 555 | } |
543 | 556 | ||
544 | QString Addressee::nickNameLabel() | 557 | QString Addressee::nickNameLabel() |
545 | { | 558 | { |
546 | return i18n("Nick Name"); | 559 | return i18n("Nick Name"); |
547 | } | 560 | } |
548 | 561 | ||
549 | 562 | ||
550 | void Addressee::setBirthday( const QDateTime &birthday ) | 563 | void Addressee::setBirthday( const QDateTime &birthday ) |
551 | { | 564 | { |
552 | if ( birthday == mData->birthday ) return; | 565 | if ( birthday == mData->birthday ) return; |
553 | detach(); | 566 | detach(); |
554 | mData->empty = false; | 567 | mData->empty = false; |
555 | mData->birthday = birthday; | 568 | mData->birthday = birthday; |
556 | } | 569 | } |
557 | 570 | ||
558 | QDateTime Addressee::birthday() const | 571 | QDateTime Addressee::birthday() const |
559 | { | 572 | { |
560 | return mData->birthday; | 573 | return mData->birthday; |
561 | } | 574 | } |
562 | 575 | ||
563 | QString Addressee::birthdayLabel() | 576 | QString Addressee::birthdayLabel() |
564 | { | 577 | { |
565 | return i18n("Birthday"); | 578 | return i18n("Birthday"); |
566 | } | 579 | } |
567 | 580 | ||
568 | 581 | ||
569 | QString Addressee::homeAddressStreetLabel() | 582 | QString Addressee::homeAddressStreetLabel() |
570 | { | 583 | { |
571 | return i18n("Home Address Street"); | 584 | return i18n("Home Address Street"); |
572 | } | 585 | } |
573 | 586 | ||
574 | 587 | ||
575 | QString Addressee::homeAddressLocalityLabel() | 588 | QString Addressee::homeAddressLocalityLabel() |
576 | { | 589 | { |
577 | return i18n("Home Address Locality"); | 590 | return i18n("Home Address Locality"); |
578 | } | 591 | } |
579 | 592 | ||
580 | 593 | ||
581 | QString Addressee::homeAddressRegionLabel() | 594 | QString Addressee::homeAddressRegionLabel() |
582 | { | 595 | { |
583 | return i18n("Home Address Region"); | 596 | return i18n("Home Address Region"); |
584 | } | 597 | } |
585 | 598 | ||
586 | 599 | ||
587 | QString Addressee::homeAddressPostalCodeLabel() | 600 | QString Addressee::homeAddressPostalCodeLabel() |
588 | { | 601 | { |
589 | return i18n("Home Address Postal Code"); | 602 | return i18n("Home Address Postal Code"); |
590 | } | 603 | } |
591 | 604 | ||
592 | 605 | ||
593 | QString Addressee::homeAddressCountryLabel() | 606 | QString Addressee::homeAddressCountryLabel() |
594 | { | 607 | { |
595 | return i18n("Home Address Country"); | 608 | return i18n("Home Address Country"); |
596 | } | 609 | } |
597 | 610 | ||
598 | 611 | ||
599 | QString Addressee::homeAddressLabelLabel() | 612 | QString Addressee::homeAddressLabelLabel() |
600 | { | 613 | { |
601 | return i18n("Home Address Label"); | 614 | return i18n("Home Address Label"); |
602 | } | 615 | } |
603 | 616 | ||
604 | 617 | ||
605 | QString Addressee::businessAddressStreetLabel() | 618 | QString Addressee::businessAddressStreetLabel() |
606 | { | 619 | { |
607 | return i18n("Business Address Street"); | 620 | return i18n("Business Address Street"); |
608 | } | 621 | } |
609 | 622 | ||
610 | 623 | ||
611 | QString Addressee::businessAddressLocalityLabel() | 624 | QString Addressee::businessAddressLocalityLabel() |
612 | { | 625 | { |
613 | return i18n("Business Address Locality"); | 626 | return i18n("Business Address Locality"); |
614 | } | 627 | } |
615 | 628 | ||
616 | 629 | ||
617 | QString Addressee::businessAddressRegionLabel() | 630 | QString Addressee::businessAddressRegionLabel() |
618 | { | 631 | { |
619 | return i18n("Business Address Region"); | 632 | return i18n("Business Address Region"); |
620 | } | 633 | } |
621 | 634 | ||
622 | 635 | ||
623 | QString Addressee::businessAddressPostalCodeLabel() | 636 | QString Addressee::businessAddressPostalCodeLabel() |
624 | { | 637 | { |
625 | return i18n("Business Address Postal Code"); | 638 | return i18n("Business Address Postal Code"); |
626 | } | 639 | } |
627 | 640 | ||
628 | 641 | ||
629 | QString Addressee::businessAddressCountryLabel() | 642 | QString Addressee::businessAddressCountryLabel() |
630 | { | 643 | { |
631 | return i18n("Business Address Country"); | 644 | return i18n("Business Address Country"); |
632 | } | 645 | } |
633 | 646 | ||
634 | 647 | ||
635 | QString Addressee::businessAddressLabelLabel() | 648 | QString Addressee::businessAddressLabelLabel() |
636 | { | 649 | { |
637 | return i18n("Business Address Label"); | 650 | return i18n("Business Address Label"); |
638 | } | 651 | } |
639 | 652 | ||
640 | 653 | ||
641 | QString Addressee::homePhoneLabel() | 654 | QString Addressee::homePhoneLabel() |
642 | { | 655 | { |
643 | return i18n("Home Phone"); | 656 | return i18n("Home Phone"); |
644 | } | 657 | } |
645 | 658 | ||
646 | 659 | ||
647 | QString Addressee::businessPhoneLabel() | 660 | QString Addressee::businessPhoneLabel() |
648 | { | 661 | { |
649 | return i18n("Business Phone"); | 662 | return i18n("Business Phone"); |
650 | } | 663 | } |
651 | 664 | ||
652 | 665 | ||
653 | QString Addressee::mobilePhoneLabel() | 666 | QString Addressee::mobilePhoneLabel() |
654 | { | 667 | { |
655 | return i18n("Mobile Phone"); | 668 | return i18n("Mobile Phone"); |
656 | } | 669 | } |
657 | 670 | ||
658 | 671 | ||
659 | QString Addressee::homeFaxLabel() | 672 | QString Addressee::homeFaxLabel() |
660 | { | 673 | { |
661 | return i18n("Home Fax"); | 674 | return i18n("Home Fax"); |
662 | } | 675 | } |
663 | 676 | ||
664 | 677 | ||
665 | QString Addressee::businessFaxLabel() | 678 | QString Addressee::businessFaxLabel() |
666 | { | 679 | { |
667 | return i18n("Business Fax"); | 680 | return i18n("Business Fax"); |
668 | } | 681 | } |
669 | 682 | ||
670 | 683 | ||
671 | QString Addressee::carPhoneLabel() | 684 | QString Addressee::carPhoneLabel() |
672 | { | 685 | { |
673 | return i18n("Car Phone"); | 686 | return i18n("Car Phone"); |
674 | } | 687 | } |
675 | 688 | ||
676 | 689 | ||
677 | QString Addressee::isdnLabel() | 690 | QString Addressee::isdnLabel() |
678 | { | 691 | { |
679 | return i18n("ISDN"); | 692 | return i18n("ISDN"); |
680 | } | 693 | } |
681 | 694 | ||
682 | 695 | ||
683 | QString Addressee::pagerLabel() | 696 | QString Addressee::pagerLabel() |
684 | { | 697 | { |
685 | return i18n("Pager"); | 698 | return i18n("Pager"); |
686 | } | 699 | } |
687 | 700 | ||
688 | QString Addressee::sipLabel() | 701 | QString Addressee::sipLabel() |
689 | { | 702 | { |
690 | return i18n("SIP"); | 703 | return i18n("SIP"); |
691 | } | 704 | } |
692 | 705 | ||
693 | QString Addressee::emailLabel() | 706 | QString Addressee::emailLabel() |
694 | { | 707 | { |
695 | return i18n("Email Address"); | 708 | return i18n("Email Address"); |
696 | } | 709 | } |
697 | 710 | ||
698 | 711 | ||
699 | void Addressee::setMailer( const QString &mailer ) | 712 | void Addressee::setMailer( const QString &mailer ) |
700 | { | 713 | { |
701 | if ( mailer == mData->mailer ) return; | 714 | if ( mailer == mData->mailer ) return; |
702 | detach(); | 715 | detach(); |
703 | mData->empty = false; | 716 | mData->empty = false; |
704 | mData->mailer = mailer; | 717 | mData->mailer = mailer; |
705 | } | 718 | } |
706 | 719 | ||
707 | QString Addressee::mailer() const | 720 | QString Addressee::mailer() const |
708 | { | 721 | { |
709 | return mData->mailer; | 722 | return mData->mailer; |
710 | } | 723 | } |
711 | 724 | ||
712 | QString Addressee::mailerLabel() | 725 | QString Addressee::mailerLabel() |
713 | { | 726 | { |
714 | return i18n("Mail Client"); | 727 | return i18n("Mail Client"); |
715 | } | 728 | } |
716 | 729 | ||
717 | 730 | ||
718 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 731 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
719 | { | 732 | { |
720 | if ( timeZone == mData->timeZone ) return; | 733 | if ( timeZone == mData->timeZone ) return; |
721 | detach(); | 734 | detach(); |
722 | mData->empty = false; | 735 | mData->empty = false; |
723 | mData->timeZone = timeZone; | 736 | mData->timeZone = timeZone; |
724 | } | 737 | } |
725 | 738 | ||
726 | TimeZone Addressee::timeZone() const | 739 | TimeZone Addressee::timeZone() const |
727 | { | 740 | { |
728 | return mData->timeZone; | 741 | return mData->timeZone; |
729 | } | 742 | } |
730 | 743 | ||
731 | QString Addressee::timeZoneLabel() | 744 | QString Addressee::timeZoneLabel() |
732 | { | 745 | { |
733 | return i18n("Time Zone"); | 746 | return i18n("Time Zone"); |
734 | } | 747 | } |
735 | 748 | ||
736 | 749 | ||
737 | void Addressee::setGeo( const Geo &geo ) | 750 | void Addressee::setGeo( const Geo &geo ) |
738 | { | 751 | { |
739 | if ( geo == mData->geo ) return; | 752 | if ( geo == mData->geo ) return; |
740 | detach(); | 753 | detach(); |
741 | mData->empty = false; | 754 | mData->empty = false; |
742 | mData->geo = geo; | 755 | mData->geo = geo; |
743 | } | 756 | } |
744 | 757 | ||
745 | Geo Addressee::geo() const | 758 | Geo Addressee::geo() const |
746 | { | 759 | { |
747 | return mData->geo; | 760 | return mData->geo; |
748 | } | 761 | } |
749 | 762 | ||
750 | QString Addressee::geoLabel() | 763 | QString Addressee::geoLabel() |
751 | { | 764 | { |
752 | return i18n("Geographic Position"); | 765 | return i18n("Geographic Position"); |
753 | } | 766 | } |
754 | 767 | ||
755 | 768 | ||
756 | void Addressee::setTitle( const QString &title ) | 769 | void Addressee::setTitle( const QString &title ) |
757 | { | 770 | { |
758 | if ( title == mData->title ) return; | 771 | if ( title == mData->title ) return; |
759 | detach(); | 772 | detach(); |