author | zautrix <zautrix> | 2005-10-28 21:15:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-28 21:15:00 (UTC) |
commit | 85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57 (patch) (unidiff) | |
tree | 8628f5cef407eaeee2d8b893f82d296d5dcd4787 | |
parent | 16e87ac5b81352c51343715cf1080191aaba9611 (diff) | |
download | kdepimpi-85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57.zip kdepimpi-85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57.tar.gz kdepimpi-85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57.tar.bz2 |
fixx
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 5 | ||||
-rw-r--r-- | kabc/addressee.cpp | 14 | ||||
-rw-r--r-- | kabc/addressee.h | 7 | ||||
-rw-r--r-- | kabc/field.cpp | 12 | ||||
-rw-r--r-- | kabc/phonenumber.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/xxport/csvimportdialog.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/xxport/csvimportdialog.h | 2 |
7 files changed, 10 insertions, 38 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index 06f25e9..3448dcc 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -1,837 +1,836 @@ | |||
1 | { "file","Datei" }, | 1 | { "file","Datei" }, |
2 | { "Choose one file","Wähle eine Datei" }, | 2 | { "Choose one file","Wähle eine Datei" }, |
3 | { "dir","Verzeichnis" }, | 3 | { "dir","Verzeichnis" }, |
4 | { "Choose a directory with may files","Wähle Verzeichnis" }, | 4 | { "Choose a directory with may files","Wähle Verzeichnis" }, |
5 | { "ldap","ldap" }, | 5 | { "ldap","ldap" }, |
6 | { "No description available","Keine Beschreibung verfügbar" }, | 6 | { "No description available","Keine Beschreibung verfügbar" }, |
7 | { "Library files for "%1" not found in paths","Bibliothek für "%1" nicht gefunden" }, | 7 | { "Library files for "%1" not found in paths","Bibliothek für "%1" nicht gefunden" }, |
8 | { "qtopia","qtopia" }, | 8 | { "qtopia","qtopia" }, |
9 | { "Qtopia PIM Addressbook.","Qtopia PIM Adressbuch." }, | 9 | { "Qtopia PIM Addressbook.","Qtopia PIM Adressbuch." }, |
10 | { "vCard","vCard" }, | 10 | { "vCard","vCard" }, |
11 | { "vCard Format","vCard Format" }, | 11 | { "vCard Format","vCard Format" }, |
12 | { "microkabcformat_binary","microkabcformat_binary" }, | 12 | { "microkabcformat_binary","microkabcformat_binary" }, |
13 | { "Binary","Binary" }, | 13 | { "Binary","Binary" }, |
14 | { "No description available.","Keine Beschreibung verfügbar." }, | 14 | { "No description available.","Keine Beschreibung verfügbar." }, |
15 | { "Department","Abteilung" }, | 15 | { "Department","Abteilung" }, |
16 | { "Profession","Beruf" }, | 16 | { "Profession","Beruf" }, |
17 | { "Assistant's Name","Name d.Assistenten" }, | 17 | { "Assistant's Name","Name d.Assistenten" }, |
18 | { "Manager's Name","Name d.Manager's" }, | 18 | { "Manager's Name","Name d.Manager's" }, |
19 | { "Spouse's Name","Name d.Ehegatten" }, | 19 | { "Spouse's Name","Name d.Ehegatten" }, |
20 | { "Office","Büro" }, | 20 | { "Office","Büro" }, |
21 | { "IM Address","IM Adresse" }, | 21 | { "IM Address","IM Adresse" }, |
22 | { "Anniversary","Jahrestag" }, | 22 | { "Anniversary","Jahrestag" }, |
23 | { "Gender","Geschlecht" }, | 23 | { "Gender","Geschlecht" }, |
24 | { "Children","Kinder" }, | 24 | { "Children","Kinder" }, |
25 | { "FreeBusyUrl","FreeBusyUrl" }, | 25 | { "FreeBusyUrl","FreeBusyUrl" }, |
26 | { "ExternalID","ExternalID" }, | 26 | { "ExternalID","ExternalID" }, |
27 | { "Resource loaded: '%1'","Resource geladen: '%1'" }, | 27 | { "Resource loaded: '%1'","Resource geladen: '%1'" }, |
28 | { "Select View","Ansicht wählen" }, | 28 | { "Select View","Ansicht wählen" }, |
29 | { "Modify View...","Ansicht ändern..." }, | 29 | { "Modify View...","Ansicht ändern..." }, |
30 | { "Add View...","Ansicht hinzufügen..." }, | 30 | { "Add View...","Ansicht hinzufügen..." }, |
31 | { "Delete View","Ansicht löschen" }, | 31 | { "Delete View","Ansicht löschen" }, |
32 | { "Refresh View","Ansicht aktualisieren" }, | 32 | { "Refresh View","Ansicht aktualisieren" }, |
33 | { "Edit &Filters...","Bearbeite &Filter..." }, | 33 | { "Edit &Filters...","Bearbeite &Filter..." }, |
34 | { "Select Filter","Filter wählen" }, | 34 | { "Select Filter","Filter wählen" }, |
35 | { "Style:","Stil:" }, | 35 | { "Style:","Stil:" }, |
36 | { "HTML table style.","HTML tabellen stil." }, | 36 | { "HTML table style.","HTML tabellen stil." }, |
37 | { "Default Table View","Standard Tabellen Ansicht" }, | 37 | { "Default Table View","Standard Tabellen Ansicht" }, |
38 | { "Show Extension Bar","Zeige Extension Bar" }, | 38 | { "Show Extension Bar","Zeige Extension Bar" }, |
39 | { "None","Kein" }, | 39 | { "None","Kein" }, |
40 | { "Name...","Name..." }, | 40 | { "Name...","Name..." }, |
41 | { "Role:","Funktion:" }, | 41 | { "Role:","Funktion:" }, |
42 | { "Organization:","Firma:" }, | 42 | { "Organization:","Firma:" }, |
43 | { "Formatted name:","Formatt. Name:" }, | 43 | { "Formatted name:","Formatt. Name:" }, |
44 | { "Edit Phone Numbers...","Bearbeite Telefonnummern..." }, | 44 | { "Edit Phone Numbers...","Bearbeite Telefonnummern..." }, |
45 | { "Categories","Kategorien" }, | 45 | { "Categories","Kategorien" }, |
46 | { "Public","Öffentlich" }, | 46 | { "Public","Öffentlich" }, |
47 | { "Private","Privat" }, | 47 | { "Private","Privat" }, |
48 | { "Confidential","Vertraulich" }, | 48 | { "Confidential","Vertraulich" }, |
49 | { "&General","Allgemein" }, | 49 | { "&General","Allgemein" }, |
50 | { "&Edit Addresses...","B&earbeite Adressen..." }, | 50 | { "&Edit Addresses...","B&earbeite Adressen..." }, |
51 | { "Edit Email Addresses...","Bearbeite E-Mail Adressen..." }, | 51 | { "Edit Email Addresses...","Bearbeite E-Mail Adressen..." }, |
52 | { "Email:","Email:" }, | 52 | { "Email:","Email:" }, |
53 | { "URL:","URL:" }, | 53 | { "URL:","URL:" }, |
54 | { "&IM address:","&IM address:" }, | 54 | { "&IM address:","&IM address:" }, |
55 | { "&Address","&Adresse" }, | 55 | { "&Address","&Adresse" }, |
56 | { "Department:","Abteilung:" }, | 56 | { "Department:","Abteilung:" }, |
57 | { "Office:","Büro:" }, | 57 | { "Office:","Büro:" }, |
58 | { "Profession:","Beruf:" }, | 58 | { "Profession:","Beruf:" }, |
59 | { "Manager's name:","N.d.Manager's:" }, | 59 | { "Manager's name:","N.d.Manager's:" }, |
60 | { "Assistant's name:","N.d.Assistenten:" }, | 60 | { "Assistant's name:","N.d.Assistenten:" }, |
61 | { "Nick name:","Spitzname:" }, | 61 | { "Nick name:","Spitzname:" }, |
62 | { "Spouse's name:","N.d.Ehegatten:" }, | 62 | { "Spouse's name:","N.d.Ehegatten:" }, |
63 | { "Children's names:","N.d.Kinder:" }, | 63 | { "Children's names:","N.d.Kinder:" }, |
64 | { "Birthday:","Geburtstag:" }, | 64 | { "Birthday:","Geburtstag:" }, |
65 | { " Local Time","Ortszeit" }, | 65 | { " Local Time","Ortszeit" }, |
66 | { "Mon","Mo" }, | 66 | { "Mon","Mo" }, |
67 | { "Tue","Di" }, | 67 | { "Tue","Di" }, |
68 | { "Wed","Mi" }, | 68 | { "Wed","Mi" }, |
69 | { "Thu","Do" }, | 69 | { "Thu","Do" }, |
70 | { "Fri","Fr" }, | 70 | { "Fri","Fr" }, |
71 | { "Sat","Sa" }, | 71 | { "Sat","Sa" }, |
72 | { "Sun","So" }, | 72 | { "Sun","So" }, |
73 | { "January","Januar" }, | 73 | { "January","Januar" }, |
74 | { "February","Februar" }, | 74 | { "February","Februar" }, |
75 | { "March","März" }, | 75 | { "March","März" }, |
76 | { "April","April" }, | 76 | { "April","April" }, |
77 | { "May","Mai" }, | 77 | { "May","Mai" }, |
78 | { "June","Juni" }, | 78 | { "June","Juni" }, |
79 | { "July","July" }, | 79 | { "July","July" }, |
80 | { "August","August" }, | 80 | { "August","August" }, |
81 | { "September","September" }, | 81 | { "September","September" }, |
82 | { "October","October" }, | 82 | { "October","October" }, |
83 | { "November","November" }, | 83 | { "November","November" }, |
84 | { "December","Dezember" }, | 84 | { "December","Dezember" }, |
85 | { "tomorrow","Morgen" }, | 85 | { "tomorrow","Morgen" }, |
86 | { "today","Heute" }, | 86 | { "today","Heute" }, |
87 | { "yesterday","Gestern" }, | 87 | { "yesterday","Gestern" }, |
88 | { "Monday","Montag" }, | 88 | { "Monday","Montag" }, |
89 | { "Tuesday","Dienstag" }, | 89 | { "Tuesday","Dienstag" }, |
90 | { "Wednesday","Mittwoch" }, | 90 | { "Wednesday","Mittwoch" }, |
91 | { "Thursday","Donnerstag" }, | 91 | { "Thursday","Donnerstag" }, |
92 | { "Friday","Freitag" }, | 92 | { "Friday","Freitag" }, |
93 | { "Saturday","Samstag" }, | 93 | { "Saturday","Samstag" }, |
94 | { "Sunday","Sonntag" }, | 94 | { "Sunday","Sonntag" }, |
95 | { "Anniversary:","Jahrestag:" }, | 95 | { "Anniversary:","Jahrestag:" }, |
96 | { "Gender:","Geschlecht:" }, | 96 | { "Gender:","Geschlecht:" }, |
97 | { "ALIEN (undefined)","ALIEN (undefiniert)" }, | 97 | { "ALIEN (undefined)","ALIEN (undefiniert)" }, |
98 | { "female","weiblich" }, | 98 | { "female","weiblich" }, |
99 | { "male","männlich" }, | 99 | { "male","männlich" }, |
100 | { "&Details","&Details" }, | 100 | { "&Details","&Details" }, |
101 | { "Note:","Notiz:" }, | 101 | { "Note:","Notiz:" }, |
102 | { "&Notes","&Notizen" }, | 102 | { "&Notes","&Notizen" }, |
103 | { "Use geo data","Benutze geo Daten" }, | 103 | { "Use geo data","Benutze geo Daten" }, |
104 | { "Latitude:","Breitengrad:" }, | 104 | { "Latitude:","Breitengrad:" }, |
105 | { "Longitude:","Längengrad:" }, | 105 | { "Longitude:","Längengrad:" }, |
106 | { "Edit Geo Data...","Edit geo Daten..." }, | 106 | { "Edit Geo Data...","Edit geo Daten..." }, |
107 | { "Keys:","Schlüssel:" }, | 107 | { "Keys:","Schlüssel:" }, |
108 | { "Add","Hinzu" }, | 108 | { "Add","Hinzu" }, |
109 | { "Remove","Entf." }, | 109 | { "Remove","Entf." }, |
110 | { "Export","Exportiere" }, | 110 | { "Export","Exportiere" }, |
111 | { "&Misc","Verschiedenes" }, | 111 | { "&Misc","Verschiedenes" }, |
112 | { "Photo","Foto" }, | 112 | { "Photo","Foto" }, |
113 | { "Store as URL","Speichere als URL" }, | 113 | { "Store as URL","Speichere als URL" }, |
114 | { "Logo","Logo" }, | 114 | { "Logo","Logo" }, |
115 | { "&Images","B&ilder" }, | 115 | { "&Images","B&ilder" }, |
116 | { "Home","Privat" }, | 116 | { "Home","Privat" }, |
117 | { "Work","Arbeit" }, | 117 | { "Work","Arbeit" }, |
118 | { "Mobile","Handy" }, | 118 | { "Mobile","Handy" }, |
119 | { "Fax","Fax" }, | 119 | { "Fax","Fax" }, |
120 | { "Contact Editor","Bearbeite Kontakt" }, | 120 | { "Contact Editor","Bearbeite Kontakt" }, |
121 | { "&Mail...","&Mail..." }, | 121 | { "&Mail...","&Mail..." }, |
122 | { "&Print...","Drucken..." }, | 122 | { "&Print...","Drucken..." }, |
123 | { "&Save","&Speichern" }, | 123 | { "&Save","&Speichern" }, |
124 | { "&New Contact...","&Neuer Kontakt..." }, | 124 | { "&New Contact...","&Neuer Kontakt..." }, |
125 | { "Mail &vCard...","Mail &vCard..." }, | 125 | { "Mail &vCard...","Mail &vCard..." }, |
126 | { "Selected to phone","Auswahl zum Telefon" }, | 126 | { "Selected to phone","Auswahl zum Telefon" }, |
127 | { "Beam selected v&Card(s)","Beame ausgewählte v&Card(s)" }, | 127 | { "Beam selected v&Card(s)","Beame ausgewählte v&Card(s)" }, |
128 | { "&Beam personal vCard","Beame persönliche vCard" }, | 128 | { "&Beam personal vCard","Beame persönliche vCard" }, |
129 | { "&Edit Contact...","Bearbeite Kontakt..." }, | 129 | { "&Edit Contact...","Bearbeite Kontakt..." }, |
130 | { "&Exit","B&eenden" }, | 130 | { "&Exit","B&eenden" }, |
131 | { "&Copy","Kopieren" }, | 131 | { "&Copy","Kopieren" }, |
132 | { "Cu&t","Ausschneiden" }, | 132 | { "Cu&t","Ausschneiden" }, |
133 | { "&Paste","Einfügen" }, | 133 | { "&Paste","Einfügen" }, |
134 | { "Select &All","Alles auswählen" }, | 134 | { "Select &All","Alles auswählen" }, |
135 | { "&Undo","Rückgängig machen" }, | 135 | { "&Undo","Rückgängig machen" }, |
136 | { "Re&do","Wiederherstellen" }, | 136 | { "Re&do","Wiederherstellen" }, |
137 | { "&Delete Contact","Lösche Kontakt" }, | 137 | { "&Delete Contact","Lösche Kontakt" }, |
138 | { "Configure &Resources...","Konfiguriere &Resourcen..." }, | 138 | { "Configure &Resources...","Konfiguriere &Resourcen..." }, |
139 | { "&Configure %1...","Konfiguriere %1..." }, | 139 | { "&Configure %1...","Konfiguriere %1..." }, |
140 | { "Configure S&hortcuts...","Konfiguriere S&hortcuts..." }, | 140 | { "Configure S&hortcuts...","Konfiguriere S&hortcuts..." }, |
141 | { "Show Jump Bar","Zeige Jump Bar" }, | 141 | { "Show Jump Bar","Zeige Jump Bar" }, |
142 | { "Show Details","Zeige Details" }, | 142 | { "Show Details","Zeige Details" }, |
143 | { "Beam receive enabled","Beam (IR) Empfang AN" }, | 143 | { "Beam receive enabled","Beam (IR) Empfang AN" }, |
144 | { "Set Who Am I","Setze "wer bin ich"" }, | 144 | { "Set Who Am I","Setze "wer bin ich"" }, |
145 | { "Set Categories for Contacts...","Setze Kategorien für Kontakte..." }, | 145 | { "Set Categories for Contacts...","Setze Kategorien für Kontakte..." }, |
146 | { "Edit Category List...","Editiere Kategorieliste..." }, | 146 | { "Edit Category List...","Editiere Kategorieliste..." }, |
147 | { "Remove "voice"...","Entferne "voice"..." }, | 147 | { "Remove "voice"...","Entferne "voice"..." }, |
148 | { "Import from Outlook...","Importiere aus Outlook..." }, | 148 | { "Import from Outlook...","Importiere aus Outlook..." }, |
149 | { "Licence","Lizenz" }, | 149 | { "Licence","Lizenz" }, |
150 | { "Faq","Fragen + Antworten" }, | 150 | { "Faq","Fragen + Antworten" }, |
151 | { "What's New?","Was ist neu?" }, | 151 | { "What's New?","Was ist neu?" }, |
152 | { "Sync HowTo","Sync Anleitung" }, | 152 | { "Sync HowTo","Sync Anleitung" }, |
153 | { "&About KAddressBook","Über KAdressBuch" }, | 153 | { "&About KAddressBook","Über KAdressBuch" }, |
154 | { "Select Incremental Search Field","Selektiere Such Feld" }, | 154 | { "Select Incremental Search Field","Selektiere Such Feld" }, |
155 | { "Synchronize","Synchronisieren" }, | 155 | { "Synchronize","Synchronisieren" }, |
156 | { "Configure...","Konfigurieren..." }, | 156 | { "Configure...","Konfigurieren..." }, |
157 | { "Enable Pi-Sync","Aktiviere Pi-Sync" }, | 157 | { "Enable Pi-Sync","Aktiviere Pi-Sync" }, |
158 | { "Multiple sync","Multi Sync" }, | 158 | { "Multiple sync","Multi Sync" }, |
159 | { "Import CSV List...","Importiere CSV-Datei..." }, | 159 | { "Import CSV List...","Importiere CSV-Datei..." }, |
160 | { "Export CSV List...","Exportiere CSV-Datei..." }, | 160 | { "Export CSV List...","Exportiere CSV-Datei..." }, |
161 | { "Import KDE 2 Addressbook...","Importiere KDE 2 Adressbuch..." }, | 161 | { "Import KDE 2 Addressbook...","Importiere KDE 2 Adressbuch..." }, |
162 | { "Import vCard...","Importiere vCard..." }, | 162 | { "Import vCard...","Importiere vCard..." }, |
163 | { "Export vCard 3.0...","Exportiere vCard 3.0..." }, | 163 | { "Export vCard 3.0...","Exportiere vCard 3.0..." }, |
164 | { "Import Qtopia...","Importiere Qtopia..." }, | 164 | { "Import Qtopia...","Importiere Qtopia..." }, |
165 | { "Export Qtopia...","Exportiere Qtopia..." }, | 165 | { "Export Qtopia...","Exportiere Qtopia..." }, |
166 | { "Edit Contact","Bearbeite Kontakt" }, | 166 | { "Edit Contact","Bearbeite Kontakt" }, |
167 | { "Ok","Ok" }, | 167 | { "Ok","Ok" }, |
168 | { "Apply","Anwenden" }, | 168 | { "Apply","Anwenden" }, |
169 | { "Cancel","Abbrechen" }, | 169 | { "Cancel","Abbrechen" }, |
170 | { "KAddressbook/Pi","KAdressbuch/Pi" }, | 170 | { "KAddressbook/Pi","KAdressbuch/Pi" }, |
171 | { "No Filter","Kein Filter" }, | 171 | { "No Filter","Kein Filter" }, |
172 | { "Given Name","Vorname" }, | 172 | { "Given Name","Vorname" }, |
173 | { "Family Name","Nachname" }, | 173 | { "Family Name","Nachname" }, |
174 | { "Email Address","E-Mail Adresse" }, | 174 | { "Email Address","E-Mail Adresse" }, |
175 | { "All Fields","Alle Felder" }, | 175 | { "All Fields","Alle Felder" }, |
176 | { "Question","Frage" }, | 176 | { "Question","Frage" }, |
177 | { "After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?","After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?" }, | 177 | { "After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?","After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?" }, |
178 | { "No","Nein" }, | 178 | { "No","Nein" }, |
179 | { "Yes","Ja" }, | 179 | { "Yes","Ja" }, |
180 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile" }, | 180 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile" }, |
181 | { "Local device name:","Name dieses Gerätes:" }, | 181 | { "Local device name:","Name dieses Gerätes:" }, |
182 | { "New profile","Neues Profil" }, | 182 | { "New profile","Neues Profil" }, |
183 | { "Clone profile","Klone Profil" }, | 183 | { "Clone profile","Klone Profil" }, |
184 | { "Delete profile","Lösche Profil" }, | 184 | { "Delete profile","Lösche Profil" }, |
185 | { "Profile:","Profil:" }, | 185 | { "Profile:","Profil:" }, |
186 | { "Ask for every entry on conflict","Frage bei Konflikten nach"}, | 186 | { "Ask for every entry on conflict","Frage bei Konflikten nach"}, |
187 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, | 187 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, |
188 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, | 188 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, |
189 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" } | 189 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" } |
190 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, | 190 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, |
191 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, | 191 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, |
192 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, | 192 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, |
193 | { "Write back file","Schreibe Datei zurück" }, | 193 | { "Write back file","Schreibe Datei zurück" }, |
194 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, | 194 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, |
195 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, | 195 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, |
196 | { "Local device name:","Name dieses Gerätes:" }, | 196 | { "Local device name:","Name dieses Gerätes:" }, |
197 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, | 197 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, |
198 | { "Sync preferences","Synchronisations Einstellungen" }, | 198 | { "Sync preferences","Synchronisations Einstellungen" }, |
199 | { "Profile kind","Profil Art" }, | 199 | { "Profile kind","Profil Art" }, |
200 | { "Local file","Lokale Datei" }, | 200 | { "Local file","Lokale Datei" }, |
201 | { "Local file:","Lokale Datei:" }, | 201 | { "Local file:","Lokale Datei:" }, |
202 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, | 202 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, |
203 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, | 203 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, |
204 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, | 204 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, |
205 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, | 205 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, |
206 | { "Device","Gerät:" }, | 206 | { "Device","Gerät:" }, |
207 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, | 207 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, |
208 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, | 208 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, |
209 | { "Synchronization successful","Synchronisation erfolgreich" }, | 209 | { "Synchronization successful","Synchronisation erfolgreich" }, |
210 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, | 210 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, |
211 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, | 211 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, |
212 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, | 212 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, |
213 | { "Enter password","Passwort eingeben" }, | 213 | { "Enter password","Passwort eingeben" }, |
214 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, | 214 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, |
215 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, | 215 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, |
216 | { "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, | 216 | { "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, |
217 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, | 217 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, |
218 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, | 218 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, |
219 | { "Used %1 Client","Benutzter %1 Client" }, | 219 | { "Used %1 Client","Benutzter %1 Client" }, |
220 | { "No email client installed","Kein Email Klient installiert" }, | 220 | { "No email client installed","Kein Email Klient installiert" }, |
221 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 221 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
222 | { "OM/Pi email client","OM/Pi Email Klient" }, | 222 | { "OM/Pi email client","OM/Pi Email Klient" }, |
223 | { "Include in multiple ","Beziehe in mehrfach " }, | 223 | { "Include in multiple ","Beziehe in mehrfach " }, |
224 | { "calendar ","Kalender " }, | 224 | { "calendar ","Kalender " }, |
225 | { "addressbook ","Adressbuch " }, | 225 | { "addressbook ","Adressbuch " }, |
226 | { "pwmanager","PWmanager" }, | 226 | { "pwmanager","PWmanager" }, |
227 | { " sync"," Sync ein" }, | 227 | { " sync"," Sync ein" }, |
228 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, | 228 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, |
229 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, | 229 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, |
230 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, | 230 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, |
231 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, | 231 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, |
232 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, | 232 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, |
233 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, | 233 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, |
234 | { "Help...","Hilfe..." }, | 234 | { "Help...","Hilfe..." }, |
235 | { "Local file Cal:","Lokale Datei Kal:" }, | 235 | { "Local file Cal:","Lokale Datei Kal:" }, |
236 | { "Local file ABook:","Lokale Datei ABuch:" }, | 236 | { "Local file ABook:","Lokale Datei ABuch:" }, |
237 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, | 237 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, |
238 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, | 238 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, |
239 | { "Calendar:","Kalender:" }, | 239 | { "Calendar:","Kalender:" }, |
240 | { "AddressBook:","AdressBuch:" }, | 240 | { "AddressBook:","AdressBuch:" }, |
241 | { "PWManager:","PWManager:" }, | 241 | { "PWManager:","PWManager:" }, |
242 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, | 242 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, |
243 | { "ssh/scp","ssh/scp" }, | 243 | { "ssh/scp","ssh/scp" }, |
244 | { "ftp","ftp" }, | 244 | { "ftp","ftp" }, |
245 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, | 245 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, |
246 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, | 246 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, |
247 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, | 247 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, |
248 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, | 248 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, |
249 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, | 249 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, |
250 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, | 250 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, |
251 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, | 251 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, |
252 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, | 252 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, |
253 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, | 253 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, |
254 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, | 254 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, |
255 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, | 255 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, |
256 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, | 256 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, |
257 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, | 257 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, |
258 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, | 258 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, |
259 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, | 259 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, |
260 | { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen "Multi-Syncen"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, | 260 | { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen "Multi-Syncen"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, |
261 | { "KDE-Pim Sync","KDE-Pim Sync" }, | 261 | { "KDE-Pim Sync","KDE-Pim Sync" }, |
262 | { "Multiple profiles","Multi-Sync Profile" }, | 262 | { "Multiple profiles","Multi-Sync Profile" }, |
263 | { "Device: ","Gerät: " }, | 263 | { "Device: ","Gerät: " }, |
264 | { "Multiple sync started.","Multi-Sync gestartet." }, | 264 | { "Multiple sync started.","Multi-Sync gestartet." }, |
265 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile selektiert für Multi-Sync" }, | 265 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile selektiert für Multi-Sync" }, |
266 | { "KDE-Pim sync config","KDE-Pim Sync Konfig" }, | 266 | { "KDE-Pim sync config","KDE-Pim Sync Konfig" }, |
267 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, | 267 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, |
268 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Modell\nautomatisch\erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, | 268 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Modell\nautomatisch\erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, |
269 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, | 269 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, |
270 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, | 270 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, |
271 | { "Edit Address Book Filters","Editiere Addressbuch Filter" }, | 271 | { "Edit Address Book Filters","Editiere Addressbuch Filter" }, |
272 | { "&Add...","Hinzufügen..." }, | 272 | { "&Add...","Hinzufügen..." }, |
273 | { "&Edit...","B&earbeiten..." }, | 273 | { "&Edit...","B&earbeiten..." }, |
274 | { "&Remove","Entfe&rne" }, | 274 | { "&Remove","Entfe&rne" }, |
275 | { "Modify View: ","Ansicht ändern: " }, | 275 | { "Modify View: ","Ansicht ändern: " }, |
276 | { "Fields","Felder" }, | 276 | { "Fields","Felder" }, |
277 | { "Select Fields to Display","Wähle anzuzeigende Felder" }, | 277 | { "Select Fields to Display","Wähle anzuzeigende Felder" }, |
278 | { "All","Alles" }, | 278 | { "All","Alles" }, |
279 | { "Frequent","Frequent" }, | 279 | { "Frequent","Frequent" }, |
280 | { "Address","Adresse" }, | 280 | { "Address","Adresse" }, |
281 | { "Email","E-Mail" }, | 281 | { "Email","E-Mail" }, |
282 | { "Personal","Persönl." }, | 282 | { "Personal","Persönl." }, |
283 | { "Organization","Organisation" }, | 283 | { "Organization","Organisation" }, |
284 | { "Custom","Benutzerdefiniert" }, | 284 | { "Custom","Benutzerdefiniert" }, |
285 | { "&Selected\nfields:","&Selektierte\nFelder:" }, | 285 | { "&Selected\nfields:","&Selektierte\nFelder:" }, |
286 | { "Formatted Name","Format. Name" }, | 286 | { "Formatted Name","Format. Name" }, |
287 | { "Additional Names","Mittelname" }, | 287 | { "Additional Names","Mittelname" }, |
288 | { "Honorific Prefixes","Namensprefix" }, | 288 | { "Honorific Prefixes","Namensprefix" }, |
289 | { "Honorific Suffixes","Namenssuffix" }, | 289 | { "Honorific Suffixes","Namenssuffix" }, |
290 | { "Nick Name","Spitzname" }, | 290 | { "Nick Name","Spitzname" }, |
291 | { "Birthday","Geburtstag" }, | 291 | { "Birthday","Geburtstag" }, |
292 | { "Home Address Street","Privat Adresse Strasse" }, | 292 | { "Home Address Street","Privat Adresse Strasse" }, |
293 | { "Home Address Locality","Privat Adresse Stadt" }, | 293 | { "Home Address Locality","Privat Adresse Stadt" }, |
294 | { "Home Address Region","Privat Adresse Bundesland" }, | 294 | { "Home Address Region","Privat Adresse Bundesland" }, |
295 | { "Home Address Postal Code","Privat Adresse PLZ" }, | 295 | { "Home Address Postal Code","Privat Adresse PLZ" }, |
296 | { "Home Address Country","Privat Adresse Land" }, | 296 | { "Home Address Country","Privat Adresse Land" }, |
297 | { "Home Address Label","Privat Adresse Label" }, | 297 | { "Home Address Label","Privat Adresse Label" }, |
298 | { "Business Address Street","Büro Adresse Strasse" }, | 298 | { "Business Address Street","Büro Adresse Strasse" }, |
299 | { "Business Address Locality","Büro Adresse Stadt" }, | 299 | { "Business Address Locality","Büro Adresse Stadt" }, |
300 | { "Business Address Region","Büro Adresse Bundesland" }, | 300 | { "Business Address Region","Büro Adresse Bundesland" }, |
301 | { "Business Address Postal Code","Büro Adresse PLZ" }, | 301 | { "Business Address Postal Code","Büro Adresse PLZ" }, |
302 | { "Business Address Country","Büro Adresse Land" }, | 302 | { "Business Address Country","Büro Adresse Land" }, |
303 | { "Business Address Label","Büro Adresse Label" }, | 303 | { "Business Address Label","Büro Adresse Label" }, |
304 | { "Home Phone","Privat Telefon" }, | 304 | { "Home Phone","Privat Telefon" }, |
305 | { "Business Phone","Arbeit Telefon" }, | 305 | { "Business Phone","Arbeit Telefon" }, |
306 | { "Mobile Phone","Handy" }, | 306 | { "Mobile Phone","Handy" }, |
307 | { "Home Fax","Privat Fax" }, | 307 | { "Home Fax","Privat Fax" }, |
308 | { "Business Fax","Arbeit Fax" }, | 308 | { "Business Fax","Arbeit Fax" }, |
309 | { "Car Phone","Autotelefon" }, | 309 | { "Car Phone","Autotelefon" }, |
310 | { "ISDN","ISDN" }, | 310 | { "ISDN","ISDN" }, |
311 | { "Pager","Pager" }, | 311 | { "Pager","Pager" }, |
312 | { "Mail Client","Mail Klient" }, | 312 | { "Mail Client","Mail Klient" }, |
313 | { "Title","Titel" }, | 313 | { "Title","Titel" }, |
314 | { "Role","Rolle" }, | 314 | { "Role","Rolle" }, |
315 | { "Note","Notiz" }, | 315 | { "Note","Notiz" }, |
316 | { "URL","URL" }, | 316 | { "URL","URL" }, |
317 | { "Resource","Resource" }, | 317 | { "Resource","Resource" }, |
318 | { "SIP","SIP" }, | 318 | { "SIP","SIP" }, |
319 | { "Default Filter","Default Filter" }, | 319 | { "Default Filter","Default Filter" }, |
320 | { "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, | 320 | { "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, |
321 | { "No default filter","Kein default Filter" }, | 321 | { "No default filter","Kein default Filter" }, |
322 | { "Use last active filter","Nutze letzen aktiven Filter" }, | 322 | { "Use last active filter","Nutze letzen aktiven Filter" }, |
323 | { "Use filter:","Nutze Filter:" }, | 323 | { "Use filter:","Nutze Filter:" }, |
324 | { "Look & Feel","Look & Feel" }, | 324 | { "Look & Feel","Look & Feel" }, |
325 | { "Row Separator","Reihen Separator" }, | 325 | { "Row Separator","Reihen Separator" }, |
326 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, | 326 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, |
327 | { "Single line","Einzelne Zeile" }, | 327 | { "Single line","Einzelne Zeile" }, |
328 | { "Enable background image:","Hintergrundbild:" }, | 328 | { "Enable background image:","Hintergrundbild:" }, |
329 | { "Enable contact tooltips","Contact Tooltips" }, | 329 | { "Enable contact tooltips","Contact Tooltips" }, |
330 | { "&Enable custom Colors","Benutzerdef. Farben" }, | 330 | { "&Enable custom Colors","Benutzerdef. Farben" }, |
331 | { "&Colors","Farben" }, | 331 | { "&Colors","Farben" }, |
332 | { "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, | 332 | { "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, |
333 | { "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, | 333 | { "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, |
334 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, | 334 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, |
335 | { "&Text font:","Textschriftart:" }, | 335 | { "&Text font:","Textschriftart:" }, |
336 | { "&Header font:","Titelschriftart:" }, | 336 | { "&Header font:","Titelschriftart:" }, |
337 | { "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, | 337 | { "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, |
338 | { "&Fonts","Schri&ften" }, | 338 | { "&Fonts","Schri&ften" }, |
339 | { "Background Color","Hintergrundfarbe" }, | 339 | { "Background Color","Hintergrundfarbe" }, |
340 | { "Text Color","Textfarbe" }, | 340 | { "Text Color","Textfarbe" }, |
341 | { "Header Background Color","Titel Hintergrundfarbe" }, | 341 | { "Header Background Color","Titel Hintergrundfarbe" }, |
342 | { "Header Text Color","Titel Farbe" }, | 342 | { "Header Text Color","Titel Farbe" }, |
343 | { "Highlight Color","Auswahlfarbe" }, | 343 | { "Highlight Color","Auswahlfarbe" }, |
344 | { "Highlighted Text Color","Auswahltextfarbe" }, | 344 | { "Highlighted Text Color","Auswahltextfarbe" }, |
345 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, | 345 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, |
346 | { "Postal","Post" }, | 346 | { "Postal","Post" }, |
347 | { "Dr.","Dr." }, | 347 | { "Dr.","Dr." }, |
348 | { "Miss","Frl." }, | 348 | { "Miss","Frl." }, |
349 | { "Mr.","Herr" }, | 349 | { "Mr.","Herr" }, |
350 | { "Mrs.","Frau" }, | 350 | { "Mrs.","Frau" }, |
351 | { "Ms.","Fr." }, | 351 | { "Ms.","Fr." }, |
352 | { "Prof.","Prof." }, | 352 | { "Prof.","Prof." }, |
353 | { "I","I" }, | 353 | { "I","I" }, |
354 | { "II","II" }, | 354 | { "II","II" }, |
355 | { "III","III" }, | 355 | { "III","III" }, |
356 | { "Jr.","Jr." }, | 356 | { "Jr.","Jr." }, |
357 | { "Sr.","Sr." }, | 357 | { "Sr.","Sr." }, |
358 | { "Name:","Name:" }, | 358 | { "Name:","Name:" }, |
359 | { "Documents","Dokumente" }, | 359 | { "Documents","Dokumente" }, |
360 | { "Files","Dateien" }, | 360 | { "Files","Dateien" }, |
361 | { "All Files","Alle Dateien" }, | 361 | { "All Files","Alle Dateien" }, |
362 | { "Name","Name" }, | 362 | { "Name","Name" }, |
363 | { "Size","Größe" }, | 363 | { "Size","Größe" }, |
364 | { "Date","Datum" }, | 364 | { "Date","Datum" }, |
365 | { "Mime Type","Mime Typ" }, | 365 | { "Mime Type","Mime Typ" }, |
366 | { "Geo Data Input","Geo Dateneingabe" }, | 366 | { "Geo Data Input","Geo Dateneingabe" }, |
367 | { "Sexagesimal","Sexagesimal" }, | 367 | { "Sexagesimal","Sexagesimal" }, |
368 | { "North","Nord" }, | 368 | { "North","Nord" }, |
369 | { "South","Süd" }, | 369 | { "South","Süd" }, |
370 | { "East","Ost" }, | 370 | { "East","Ost" }, |
371 | { "West","West" }, | 371 | { "West","West" }, |
372 | { "Undefined","Unbestimmt" }, | 372 | { "Undefined","Unbestimmt" }, |
373 | { "Edit Address","Bearbeite Adresse" }, | 373 | { "Edit Address","Bearbeite Adresse" }, |
374 | { "Street:","Strasse:" }, | 374 | { "Street:","Strasse:" }, |
375 | { "Post office box:","Postfach:" }, | 375 | { "Post office box:","Postfach:" }, |
376 | { "Locality:","Stadt:" }, | 376 | { "Locality:","Stadt:" }, |
377 | { "Region:","Region:" }, | 377 | { "Region:","Region:" }, |
378 | { "Postal code:","PLZ:" }, | 378 | { "Postal code:","PLZ:" }, |
379 | { "Country:","Staat:" }, | 379 | { "Country:","Staat:" }, |
380 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, | 380 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, |
381 | { "New...","Neu..." }, | 381 | { "New...","Neu..." }, |
382 | { "Change Type","Ändere Art" }, | 382 | { "Change Type","Ändere Art" }, |
383 | { "Edit Address Type","Ändere Address Art" }, | 383 | { "Edit Address Type","Ändere Address Art" }, |
384 | { "Address Types","Address Art" }, | 384 | { "Address Types","Address Art" }, |
385 | { "Domestic","Inland" }, | 385 | { "Domestic","Inland" }, |
386 | { "International","International" }, | 386 | { "International","International" }, |
387 | { "Parcel","Paket" }, | 387 | { "Parcel","Paket" }, |
388 | { "Edit Contact Name","Ändere Kontakt Name" }, | 388 | { "Edit Contact Name","Ändere Kontakt Name" }, |
389 | { "Honorific prefixes:","Namensprefixes:" }, | 389 | { "Honorific prefixes:","Namensprefixes:" }, |
390 | { "Given name:","Vorname:" }, | 390 | { "Given name:","Vorname:" }, |
391 | { "Additional names:","Mittelnamen:" }, | 391 | { "Additional names:","Mittelnamen:" }, |
392 | { "Family names:","Nachname:" }, | 392 | { "Family names:","Nachname:" }, |
393 | { "Honorific suffixes:","Namenssuffixe:" }, | 393 | { "Honorific suffixes:","Namenssuffixe:" }, |
394 | { "Parse name automatically","Setze Namen automatisch" }, | 394 | { "Parse name automatically","Setze Namen automatisch" }, |
395 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, | 395 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, |
396 | { "Number","Nummer" }, | 396 | { "Number","Nummer" }, |
397 | { "Type","Typ" }, | 397 | { "Type","Typ" }, |
398 | { "Edit Phone Number","Bearbeite Telefonnummer" }, | 398 | { "Edit Phone Number","Bearbeite Telefonnummer" }, |
399 | { "Number:","Nummer:" }, | 399 | { "Number:","Nummer:" }, |
400 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, | 400 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, |
401 | { "Types","Typen" }, | 401 | { "Types","Typen" }, |
402 | { "Messenger","Messenger" }, | 402 | { "Messenger","Messenger" }, |
403 | { "Other","Sonstiges" }, | 403 | { "Other","Sonstiges" }, |
404 | { "Video","Video" }, | 404 | { "Video","Video" }, |
405 | { "Mailbox","Mailbox" }, | 405 | { "Mailbox","Mailbox" }, |
406 | { "Modem","Modem" }, | 406 | { "Modem","Modem" }, |
407 | { "Car","Auto" }, | 407 | { "Car","Auto" }, |
408 | { "PCS","PCS" }, | 408 | { "PCS","PCS" }, |
409 | { "Category","Kategorie" }, | 409 | { "Category","Kategorie" }, |
410 | { "Select Categories","Wähle Kategorien" }, | 410 | { "Select Categories","Wähle Kategorien" }, |
411 | { " &Deselect All "," &Deselektiere alle " }, | 411 | { " &Deselect All "," &Deselektiere alle " }, |
412 | { " &Edit Categories "," B&earbeite Kategorien " }, | 412 | { " &Edit Categories "," B&earbeite Kategorien " }, |
413 | { "&OK","&OK" }, | 413 | { "&OK","&OK" }, |
414 | { "&Cancel","Abbre&chen" }, | 414 | { "&Cancel","Abbre&chen" }, |
415 | { "Configure","Konfiguriere" }, | 415 | { "Configure","Konfiguriere" }, |
416 | { "Default","Voreinstellungen" }, | 416 | { "Default","Voreinstellungen" }, |
417 | { "Addressbook","Adressbuch" }, | 417 | { "Addressbook","Adressbuch" }, |
418 | { "Details view font","Schriftart Detailansicht" }, | 418 | { "Details view font","Schriftart Detailansicht" }, |
419 | { "phone:123","phone:123" }, | 419 | { "phone:123","phone:123" }, |
420 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, | 420 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, |
421 | { "Show edit dialog on single click","Zeige Edit Dialog bei Einzelklick" }, | 421 | { "Show edit dialog on single click","Zeige Edit Dialog bei Einzelklick" }, |
422 | { "Automatic name parsing for new contacts","Automa. Name Parsen für neue Kontakte" }, | 422 | { "Automatic name parsing for new contacts","Automa. Name Parsen für neue Kontakte" }, |
423 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, | 423 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, |
424 | { "Show exit confirmation","Vor dem Beenden nachfragen" }, | 424 | { "Show exit confirmation","Vor dem Beenden nachfragen" }, |
425 | { "General","Allgemein" }, | 425 | { "General","Allgemein" }, |
426 | { "Extensions (restart)","Extensions (restart)" }, | 426 | { "Extensions (restart)","Extensions (restart)" }, |
427 | { "Description","Beschreibungen" }, | 427 | { "Description","Beschreibungen" }, |
428 | { "Extensions","Extensions" }, | 428 | { "Extensions","Extensions" }, |
429 | { "Prefixes","Prefixe" }, | 429 | { "Prefixes","Prefixe" }, |
430 | { "Inclusions","Inclusions" }, | 430 | { "Inclusions","Inclusions" }, |
431 | { "Suffixes","Suffixe" }, | 431 | { "Suffixes","Suffixe" }, |
432 | { "Default formatted name:","Default format. Name:" }, | 432 | { "Default formatted name:","Default format. Name:" }, |
433 | { "Empty","Leer" }, | 433 | { "Empty","Leer" }, |
434 | { "Simple Name","Einfacher Name" }, | 434 | { "Simple Name","Einfacher Name" }, |
435 | { "Full Name","Voller Name" }, | 435 | { "Full Name","Voller Name" }, |
436 | { "Reverse Name","Namen umdrehen" }, | 436 | { "Reverse Name","Namen umdrehen" }, |
437 | { "Contact","Kontakt" }, | 437 | { "Contact","Kontakt" }, |
438 | { "Global","Allgemein" }, | 438 | { "Global","Allgemein" }, |
439 | { "Phone","Telefon" }, | 439 | { "Phone","Telefon" }, |
440 | { "SMS","SMS" }, | 440 | { "SMS","SMS" }, |
441 | { "Language:(needs restart)","Sprache:(Neustart)" }, | 441 | { "Language:(needs restart)","Sprache:(Neustart)" }, |
442 | { "English","English" }, | 442 | { "English","English" }, |
443 | { "German","Deutsch" }, | 443 | { "German","Deutsch" }, |
444 | { "French","Französisch" }, | 444 | { "French","Französisch" }, |
445 | { "Italian","Italienisch" }, | 445 | { "Italian","Italienisch" }, |
446 | { "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, | 446 | { "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, |
447 | { "Time Format(nr):","Zeit Format(nr):" }, | 447 | { "Time Format(nr):","Zeit Format(nr):" }, |
448 | { "24:00","24:00" }, | 448 | { "24:00","24:00" }, |
449 | { "12:00am","12:00am" }, | 449 | { "12:00am","12:00am" }, |
450 | { "Week starts on Sunday","Woche beginnt Sonntags" }, | 450 | { "Week starts on Sunday","Woche beginnt Sonntags" }, |
451 | { "Locale","Locale" }, | 451 | { "Locale","Locale" }, |
452 | { "Date Format:","Datums Format:" }, | 452 | { "Date Format:","Datums Format:" }, |
453 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 453 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
454 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 454 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
455 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 455 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
456 | { "User defined","Benutzerdefiniert" }, | 456 | { "User defined","Benutzerdefiniert" }, |
457 | { "User long date:","Format langes Datum:" }, | 457 | { "User long date:","Format langes Datum:" }, |
458 | { "User short date:","Format kurzes Datum:" }, | 458 | { "User short date:","Format kurzes Datum:" }, |
459 | { "Daylight start:","Sommerzeit Start:" }, | 459 | { "Daylight start:","Sommerzeit Start:" }, |
460 | { "Daylight end:","Sommerzeit Ende:" }, | 460 | { "Daylight end:","Sommerzeit Ende:" }, |
461 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, | 461 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, |
462 | { "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, | 462 | { "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, |
463 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 463 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
464 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 464 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
465 | { "Date Format","Datums Format" }, | 465 | { "Date Format","Datums Format" }, |
466 | { "Timezone:","Zeitzone:" }, | 466 | { "Timezone:","Zeitzone:" }, |
467 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, | 467 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, |
468 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, | 468 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, |
469 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 469 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
470 | { "Used Mail Client","Benutzter Mail Client" }, | 470 | { "Used Mail Client","Benutzter Mail Client" }, |
471 | { "Channel:","Channel:" }, | 471 | { "Channel:","Channel:" }, |
472 | { "Message:","Message:" }, | 472 | { "Message:","Message:" }, |
473 | { "Parameters:","Parameter:" }, | 473 | { "Parameters:","Parameter:" }, |
474 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 474 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
475 | { "extra Message:","extra Message:" }, | 475 | { "extra Message:","extra Message:" }, |
476 | { "extra Parameters:","extra Parameter:" }, | 476 | { "extra Parameters:","extra Parameter:" }, |
477 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 477 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
478 | { "External Apps.","Externe Appl." }, | 478 | { "External Apps.","Externe Appl." }, |
479 | { "Used %1 Client","Benutzer %1 Client" }, | 479 | { "Used %1 Client","Benutzer %1 Client" }, |
480 | { "No email client installed","Keine Email Client installiert" }, | 480 | { "No email client installed","Keine Email Client installiert" }, |
481 | { "Userdefined email client","Benutzerdef. Email Client" }, | 481 | { "Userdefined email client","Benutzerdef. Email Client" }, |
482 | { "OM/Pi email client","OM/Pi Email Client" }, | 482 | { "OM/Pi email client","OM/Pi Email Client" }, |
483 | { "Close KA/Pi?","Schließe KA/Pi?" }, | 483 | { "Close KA/Pi?","Schließe KA/Pi?" }, |
484 | { "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, | 484 | { "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, |
485 | { "Yes!","Ja!" }, | 485 | { "Yes!","Ja!" }, |
486 | { "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " }, | 486 | { "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " }, |
487 | { "Saving addressbook ... ","Speichere Adressbuch ... " }, | 487 | { "Saving addressbook ... ","Speichere Adressbuch ... " }, |
488 | { "Addressbook saved!","Adressbuch gespeichert!" }, | 488 | { "Addressbook saved!","Adressbuch gespeichert!" }, |
489 | { "Default Table View","Default Tabellenansicht" }, | 489 | { "Default Table View","Default Tabellenansicht" }, |
490 | { "Merge and Remove","Zusammenfügen/entfernen" }, | 490 | { "Merge and Remove","Zusammenfügen/entfernen" }, |
491 | { "Merge","Zusammenfügen" }, | 491 | { "Merge","Zusammenfügen" }, |
492 | { "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, | 492 | { "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, |
493 | { "New List...","Neue Liste..." }, | 493 | { "New List...","Neue Liste..." }, |
494 | { "Rename List...","Ändere Namen..." }, | 494 | { "Rename List...","Ändere Namen..." }, |
495 | { "Remove List","Lösche Liste" }, | 495 | { "Remove List","Lösche Liste" }, |
496 | { "Add Contact","Kontakt hinzu" }, | 496 | { "Add Contact","Kontakt hinzu" }, |
497 | { "Change Email...","Ändere Email..." }, | 497 | { "Change Email...","Ändere Email..." }, |
498 | { "Remove Contact","Entferne Kontakt" }, | 498 | { "Remove Contact","Entferne Kontakt" }, |
499 | { "Use Preferred","Nutze Preferred" }, | 499 | { "Use Preferred","Nutze Preferred" }, |
500 | { "Distribution List Editor","Distribution List Editor" }, | 500 | { "Distribution List Editor","Distribution List Editor" }, |
501 | { "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, | 501 | { "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, |
502 | { "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, | 502 | { "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, |
503 | { "Contact Selection","Kontaktauswahl" }, | 503 | { "Contact Selection","Kontaktauswahl" }, |
504 | { "&All","&Alle" }, | 504 | { "&All","&Alle" }, |
505 | { "Export the entire address book","Exportiere das komplette Addressbuch" }, | 505 | { "Export the entire address book","Exportiere das komplette Addressbuch" }, |
506 | { "&Selected","Au&sgewählte" }, | 506 | { "&Selected","Au&sgewählte" }, |
507 | { "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." }, | 507 | { "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." }, |
508 | { "By matching &filter","Zutreffender &Filter" }, | 508 | { "By matching &filter","Zutreffender &Filter" }, |
509 | { "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" }, | 509 | { "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" }, |
510 | { "By Cate&gories","Kategorien" }, | 510 | { "By Cate&gories","Kategorien" }, |
511 | { "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." }, | 511 | { "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." }, |
512 | { "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, | 512 | { "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, |
513 | { "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, | 513 | { "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, |
514 | { "Sorting","Sortieren" }, | 514 | { "Sorting","Sortieren" }, |
515 | { "Criterion:","Merkmal:" }, | 515 | { "Criterion:","Merkmal:" }, |
516 | { "Order:","Reihenfolge:" }, | 516 | { "Order:","Reihenfolge:" }, |
517 | { "Ascending","Aufsteigend" }, | 517 | { "Ascending","Aufsteigend" }, |
518 | { "Descending","Absteigend" }, | 518 | { "Descending","Absteigend" }, |
519 | { "Save file","Datei speichern" }, | 519 | { "Save file","Datei speichern" }, |
520 | { "Error","Fehler" }, | 520 | { "Error","Fehler" }, |
521 | { "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, | 521 | { "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, |
522 | { "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, | 522 | { "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, |
523 | { "Manage new categories...","Verwalte neue Kategorien..." }, | 523 | { "Manage new categories...","Verwalte neue Kategorien..." }, |
524 | { "&File","Datei" }, | 524 | { "&File","Datei" }, |
525 | { "&Edit","Bearbeite" }, | 525 | { "&Edit","Bearbeite" }, |
526 | { "&View","Ansichten" }, | 526 | { "&View","Ansichten" }, |
527 | { "&Settings","Konfiguration" }, | 527 | { "&Settings","Konfiguration" }, |
528 | { "&Change selected","Ändere Selekt." }, | 528 | { "&Change selected","Ändere Selekt." }, |
529 | { "&Help","Hilfe" }, | 529 | { "&Help","Hilfe" }, |
530 | { "Remove sync info","Entferne Sync Info" }, | 530 | { "Remove sync info","Entferne Sync Info" }, |
531 | { "For all profiles","Für alle Profile" }, | 531 | { "For all profiles","Für alle Profile" }, |
532 | { "&Change","Ändere" }, | 532 | { "&Change","Ändere" }, |
533 | { "Import xml (Qtopia)...","Importiere xml (Qtopia)..." }, | 533 | { "Import xml (Qtopia)...","Importiere xml (Qtopia)..." }, |
534 | { "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." }, | 534 | { "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." }, |
535 | { "Export to phone","Exportiere aufs Handy..." }, | 535 | { "Export to phone","Exportiere aufs Handy..." }, |
536 | { "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" }, | 536 | { "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" }, |
537 | { "&Modify","Ändere" }, | 537 | { "&Modify","Ändere" }, |
538 | { "Choose which contacts to select","Bitte Kontakte auswählen!" }, | 538 | { "Choose which contacts to select","Bitte Kontakte auswählen!" }, |
539 | { "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, | 539 | { "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, |
540 | { "Manage new Categories","Verwalte neue Kategorien" }, | 540 | { "Manage new Categories","Verwalte neue Kategorien" }, |
541 | { "Add to category list","Füge zur Kategorieliste hinzu" }, | 541 | { "Add to category list","Füge zur Kategorieliste hinzu" }, |
542 | { "Remove from addressees","Entferne von den Kontakten" }, | 542 | { "Remove from addressees","Entferne von den Kontakten" }, |
543 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, | 543 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, |
544 | { "A&dd","Hinzufügen" }, | 544 | { "A&dd","Hinzufügen" }, |
545 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, | 545 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, |
546 | { "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" }, | 546 | { "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" }, |
547 | { "Export to mobile phone!","Exportiere auf das Handy!" }, | 547 | { "Export to mobile phone!","Exportiere auf das Handy!" }, |
548 | { "Export to phone options","Export ans Handy Optionen" }, | 548 | { "Export to phone options","Export ans Handy Optionen" }, |
549 | { "Writing to phone...","Sende Daten ans Handy..." }, | 549 | { "Writing to phone...","Sende Daten ans Handy..." }, |
550 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, | 550 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, |
551 | { "Retry","Nochmal versuchen" }, | 551 | { "Retry","Nochmal versuchen" }, |
552 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, | 552 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, |
553 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, | 553 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, |
554 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, | 554 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, |
555 | { "&Print View","Drucke Ansicht" }, | 555 | { "&Print View","Drucke Ansicht" }, |
556 | { "&Print Details","Drucke Details" }, | 556 | { "&Print Details","Drucke Details" }, |
557 | { "Beam v&Card(s)...","Beame v&Card(s)..." }, | 557 | { "Beam v&Card(s)...","Beame v&Card(s)..." }, |
558 | { "Set formatted name...","Setze formatierten Namen..." }, | 558 | { "Set formatted name...","Setze formatierten Namen..." }, |
559 | { "Kde Sync HowTo","Kde Sync HowTo" }, | 559 | { "Kde Sync HowTo","Kde Sync HowTo" }, |
560 | { "Multi Sync HowTo","Multi Sync HowTo" }, | 560 | { "Multi Sync HowTo","Multi Sync HowTo" }, |
561 | { "&Beam","&Beame" }, | 561 | { "&Beam","&Beame" }, |
562 | { "Edit Email Addresses","Editiere Email Adressen" }, | 562 | { "Edit Email Addresses","Editiere Email Adressen" }, |
563 | { "Email address:","Email Adresse:" }, | 563 | { "Email address:","Email Adresse:" }, |
564 | { "Change","Ändere" }, | 564 | { "Change","Ändere" }, |
565 | { "Set Standard","Setze Standard" }, | 565 | { "Set Standard","Setze Standard" }, |
566 | { "New Contact","Neuer Contact" }, | 566 | { "New Contact","Neuer Contact" }, |
567 | { "Undo %1","Rückgängig %1" }, | 567 | { "Undo %1","Rückgängig %1" }, |
568 | { "Redo","Wiederholen" }, | 568 | { "Redo","Wiederholen" }, |
569 | { "Saving ... please wait! ","Am Speichern ... bitte warten! " }, | 569 | { "Saving ... please wait! ","Am Speichern ... bitte warten! " }, |
570 | { "CSV Import Dialog","CSV Import Dialog" }, | 570 | { "CSV Import Dialog","CSV Import Dialog" }, |
571 | { "File to import:","Datei zum Import:" }, | 571 | { "File to import:","Datei zum Import:" }, |
572 | { "Delimiter","Trennzeichen" }, | 572 | { "Delimiter","Trennzeichen" }, |
573 | { "Comma","Komma" }, | 573 | { "Comma","Komma" }, |
574 | { "Semicolon","Semikolon" }, | 574 | { "Semicolon","Semikolon" }, |
575 | { "Tabulator","Tabulator" }, | 575 | { "Tabulator","Tabulator" }, |
576 | { "Space","Leerzeichen" }, | 576 | { "Space","Leerzeichen" }, |
577 | { "1","1" }, | 577 | { "1","1" }, |
578 | { """,""" }, | 578 | { """,""" }, |
579 | { "'","'" }, | 579 | { "'","'" }, |
580 | { "Start at line:","Beginne mit Zeile:" }, | 580 | { "Start at line:","Beginne mit Zeile:" }, |
581 | { "Textquote:","Textquote:" }, | 581 | { "Textquote:","Textquote:" }, |
582 | { "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" }, | 582 | { "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" }, |
583 | { "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" }, | 583 | { "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" }, |
584 | { "Override previously imported entries?","Überschreibe bereits importierte Einträge?" }, | 584 | { "Override previously imported entries?","Überschreibe bereits importierte Einträge?" }, |
585 | { "Select vCard to Import","Selektiere zu importierende vCard" }, | 585 | { "Select vCard to Import","Selektiere zu importierende vCard" }, |
586 | { "Information","Information" }, | 586 | { "Information","Information" }, |
587 | { "Import xml file","Importiere xml Datei" }, | 587 | { "Import xml file","Importiere xml Datei" }, |
588 | { "Choose contact selection","Wähle Kontakt Auswahl" }, | 588 | { "Choose contact selection","Wähle Kontakt Auswahl" }, |
589 | { "Select the entire address book","Wähle das ganze Adressbuch" }, | 589 | { "Select the entire address book","Wähle das ganze Adressbuch" }, |
590 | { "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." }, | 590 | { "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." }, |
591 | { "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." }, | 591 | { "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." }, |
592 | { "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." }, | 592 | { "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." }, |
593 | { "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." }, | 593 | { "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." }, |
594 | { "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." }, | 594 | { "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." }, |
595 | { "I/O device: ","I/O device: " }, | 595 | { "I/O device: ","I/O device: " }, |
596 | { "Connection: ","Connection: " }, | 596 | { "Connection: ","Connection: " }, |
597 | { "Model(opt.): ","Model(opt.): " }, | 597 | { "Model(opt.): ","Model(opt.): " }, |
598 | { "Exporting to phone...","Exportiere aufs Handy..." }, | 598 | { "Exporting to phone...","Exportiere aufs Handy..." }, |
599 | { "Error exporting to phone","Fehler beim Export aufs Handy" }, | 599 | { "Error exporting to phone","Fehler beim Export aufs Handy" }, |
600 | { "contacts successfully exported.","Kontakte erfolgreich exportiert." }, | 600 | { "contacts successfully exported.","Kontakte erfolgreich exportiert." }, |
601 | { "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, | 601 | { "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, |
602 | { "Set formatted name","Setze formatierten Namen" }, | 602 | { "Set formatted name","Setze formatierten Namen" }, |
603 | { "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." }, | 603 | { "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." }, |
604 | { "Set formatted name to:","Setze formatierten Name auf:" }, | 604 | { "Set formatted name to:","Setze formatierten Name auf:" }, |
605 | { "Simple: James Bond","Einfach: James Bond" }, | 605 | { "Simple: James Bond","Einfach: James Bond" }, |
606 | { "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" }, | 606 | { "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" }, |
607 | { "Reverse: Bond, James","Umgekehrt: Bond, James" }, | 607 | { "Reverse: Bond, James","Umgekehrt: Bond, James" }, |
608 | { "Organization: MI6","Organisation: MI6" }, | 608 | { "Organization: MI6","Organisation: MI6" }, |
609 | { "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." }, | 609 | { "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." }, |
610 | { "Select contact list","Selektiere Kontakt Liste" }, | 610 | { "Select contact list","Selektiere Kontakt Liste" }, |
611 | { "Changing contact #%1","Ändere Kontakt #%1" }, | 611 | { "Changing contact #%1","Ändere Kontakt #%1" }, |
612 | { "Refreshing view...","Lade Ansicht neu..." }, | 612 | { "Refreshing view...","Lade Ansicht neu..." }, |
613 | { "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" }, | 613 | { "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" }, |
614 | { "Removing voice...","Entferne voice..." }, | 614 | { "Removing voice...","Entferne voice..." }, |
615 | { "Remove voice completed!","Entferne voice beendet!" }, | 615 | { "Remove voice completed!","Entferne voice beendet!" }, |
616 | { "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" }, | 616 | { "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" }, |
617 | { "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" }, | 617 | { "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" }, |
618 | { "Setting categories completed!","Setzen der Kategorien beendet!" }, | 618 | { "Setting categories completed!","Setzen der Kategorien beendet!" }, |
619 | { "OK","OK" }, | 619 | { "OK","OK" }, |
620 | { "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." }, | 620 | { "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." }, |
621 | { "Processing contact #%1","Bearbeite Kontakt #%1" }, | 621 | { "Processing contact #%1","Bearbeite Kontakt #%1" }, |
622 | { " categories added to list! "," Kategorien zur Liste hinzugefügt! " }, | 622 | { " categories added to list! "," Kategorien zur Liste hinzugefügt! " }, |
623 | { "%1: %2","%1: %2" }, | 623 | { "%1: %2","%1: %2" }, |
624 | { "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" }, | 624 | { "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" }, |
625 | { "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" }, | 625 | { "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" }, |
626 | { "Cut","Ausschneiden" }, | 626 | { "Cut","Ausschneiden" }, |
627 | { "Paste","Einfügen" }, | 627 | { "Paste","Einfügen" }, |
628 | { "Delete","Löschen" }, | 628 | { "Delete","Löschen" }, |
629 | { "Choose...","Wähle..." }, | 629 | { "Choose...","Wähle..." }, |
630 | { "Add View","Ansicht hinzufügen" }, | 630 | { "Add View","Ansicht hinzufügen" }, |
631 | { "View name:","Ansicht Name:" }, | 631 | { "View name:","Ansicht Name:" }, |
632 | { "View Type","Typ der Ansicht" }, | 632 | { "View Type","Typ der Ansicht" }, |
633 | { "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." }, | 633 | { "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." }, |
634 | { "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." }, | 634 | { "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." }, |
635 | { "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." }, | 635 | { "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." }, |
636 | { "Draw &separators","Zeichne &Trennlinie" }, | 636 | { "Draw &separators","Zeichne &Trennlinie" }, |
637 | { "Separator &width:","Trennlinien &Breite:" }, | 637 | { "Separator &width:","Trennlinien &Breite:" }, |
638 | { "&Padding:","Füllung:" }, | 638 | { "&Padding:","Füllung:" }, |
639 | { "Cards","Karten" }, | 639 | { "Cards","Karten" }, |
640 | { "&Margin:","&Rand:" }, | 640 | { "&Margin:","&Rand:" }, |
641 | { "Draw &borders","Zeichne Ränder" }, | 641 | { "Draw &borders","Zeichne Ränder" }, |
642 | { "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." }, | 642 | { "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." }, |
643 | { "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." }, | 643 | { "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." }, |
644 | { "Sets the width of column separators","Sets the width of column separators" }, | 644 | { "Sets the width of column separators","Sets the width of column separators" }, |
645 | { "&Layout","&Layout" }, | 645 | { "&Layout","&Layout" }, |
646 | { "Show &empty fields","Zeige leere Felder" }, | 646 | { "Show &empty fields","Zeige leere Felder" }, |
647 | { "Show field &labels","Zeige Feld Label" }, | 647 | { "Show field &labels","Zeige Feld Label" }, |
648 | { "Be&havior","Ver&halten" }, | 648 | { "Be&havior","Ver&halten" }, |
649 | { "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" }, | 649 | { "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" }, |
650 | { "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" }, | 650 | { "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" }, |
651 | { "Confirm Delete","Bestätige Löschen" }, | 651 | { "Confirm Delete","Bestätige Löschen" }, |
652 | { "Edit Address Book Filter","Editiere Adressbuch Filter" }, | 652 | { "Edit Address Book Filter","Editiere Adressbuch Filter" }, |
653 | { "Category rule","Kategorie Regel" }, | 653 | { "Category rule","Kategorie Regel" }, |
654 | { "Include categories","Inklusive" }, | 654 | { "Include categories","Inklusive" }, |
655 | { "Exclude categories","Exclusive" }, | 655 | { "Exclude categories","Exclusive" }, |
656 | { "Include contacts, that are:","Schließe folgende Kontakte ein:" }, | 656 | { "Include contacts, that are:","Schließe folgende Kontakte ein:" }, |
657 | { "public","Öffentlich" }, | 657 | { "public","Öffentlich" }, |
658 | { "private","Privat" }, | 658 | { "private","Privat" }, |
659 | { "confidential","Vertraulich" }, | 659 | { "confidential","Vertraulich" }, |
660 | { "Configure Resources","Konfiguriere Resourcen" }, | 660 | { "Configure Resources","Konfiguriere Resourcen" }, |
661 | { "Resource Configuration","Resource Konfiguration" }, | 661 | { "Resource Configuration","Resource Konfiguration" }, |
662 | { "Resources","Resourcen" }, | 662 | { "Resources","Resourcen" }, |
663 | { "Standard","Standard" }, | 663 | { "Standard","Standard" }, |
664 | { "&Use as Standard","Setze als Standard" }, | 664 | { "&Use as Standard","Setze als Standard" }, |
665 | { "Select type of the new resource:","Selektiere Typ der neuen Resource:" }, | 665 | { "Select type of the new resource:","Selektiere Typ der neuen Resource:" }, |
666 | { "General Settings","Allgemeine Einstellungen" }, | 666 | { "General Settings","Allgemeine Einstellungen" }, |
667 | { "Read-only","Nur-Lesen" }, | 667 | { "Read-only","Nur-Lesen" }, |
668 | { "Include in sync","Schließe in Sync mit ein" }, | 668 | { "Include in sync","Schließe in Sync mit ein" }, |
669 | { "%1 Resource Settings","%1 Resource Einstellungen" }, | 669 | { "%1 Resource Settings","%1 Resource Einstellungen" }, |
670 | { "Format:","Format:" }, | 670 | { "Format:","Format:" }, |
671 | { "Location:","Ort:" }, | 671 | { "Location:","Ort:" }, |
672 | { "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" }, | 672 | { "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" }, |
673 | { "Language","Sprache" }, | 673 | { "Language","Sprache" }, |
674 | { "Time Format","Zeit Format" }, | 674 | { "Time Format","Zeit Format" }, |
675 | { "Time Zone","Zeit Zone" }, | 675 | { "Time Zone","Zeit Zone" }, |
676 | { "Data storage path","Daten Speicherpfad" }, | 676 | { "Data storage path","Daten Speicherpfad" }, |
677 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, | 677 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, |
678 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 678 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
679 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 679 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
680 | { "Save settings","Speichere Einstellungen" }, | 680 | { "Save settings","Speichere Einstellungen" }, |
681 | { "Save standard","Speichere Standard" }, | 681 | { "Save standard","Speichere Standard" }, |
682 | { "Save","Speichern" }, | 682 | { "Save","Speichern" }, |
683 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 683 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
684 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 684 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
685 | { "Multiple Sync options","Multi Sync Optionen" }, | 685 | { "Multiple Sync options","Multi Sync Optionen" }, |
686 | { "Sync algo options","Sync Ablauf Optionen" }, | 686 | { "Sync algo options","Sync Ablauf Optionen" }, |
687 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 687 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
688 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 688 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
689 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 689 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
690 | { "Write back options","Optionen zum Zurückschreiben" }, | 690 | { "Write back options","Optionen zum Zurückschreiben" }, |
691 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 691 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
692 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 692 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
693 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 693 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
694 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 694 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
695 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 695 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
696 | { "Time period","Zeitspanne" }, | 696 | { "Time period","Zeitspanne" }, |
697 | { "From ","Von " }, | 697 | { "From ","Von " }, |
698 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 698 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
699 | { " weeks in the future "," Wochen in der Zukunft " }, | 699 | { " weeks in the future "," Wochen in der Zukunft " }, |
700 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 700 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
701 | { "Local temp file:","Lokale temp Datei:" }, | 701 | { "Local temp file:","Lokale temp Datei:" }, |
702 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 702 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
703 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 703 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
704 | { "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." }, | 704 | { "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." }, |
705 | { "Sorry","Tut mir leid" }, | 705 | { "Sorry","Tut mir leid" }, |
706 | { "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, | 706 | { "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, |
707 | { "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" }, | 707 | { "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" }, |
708 | { "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" }, | 708 | { "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" }, |
709 | { "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, | 709 | { "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, |
710 | { "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, | 710 | { "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, |
711 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 711 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
712 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 712 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
713 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 713 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
714 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, | 714 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, |
715 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 715 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
716 | { "Error","Fehler" }, | 716 | { "Error","Fehler" }, |
717 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 717 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
718 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 718 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
719 | { "Warning","Warnung" }, | 719 | { "Warning","Warnung" }, |
720 | { "Select week number","Wähle Wochen Nummer" }, | 720 | { "Select week number","Wähle Wochen Nummer" }, |
721 | { "Februar","Februar" }, | 721 | { "Februar","Februar" }, |
722 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 722 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
723 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 723 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
724 | { "Remote IP address:","Ferne IP Adresse:" }, | 724 | { "Remote IP address:","Ferne IP Adresse:" }, |
725 | { "Remote port number:","Ferne Port Nummer:" }, | 725 | { "Remote port number:","Ferne Port Nummer:" }, |
726 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 726 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
727 | { "Remote from: ","Fern von: " }, | 727 | { "Remote from: ","Fern von: " }, |
728 | { "Local from: ","Lokal von: " }, | 728 | { "Local from: ","Lokal von: " }, |
729 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, | 729 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, |
730 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 730 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
731 | { "Write back","Schreibe zurück" }, | 731 | { "Write back","Schreibe zurück" }, |
732 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 732 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
733 | { "Received sync request","Sync Anfrage erhalten" }, | 733 | { "Received sync request","Sync Anfrage erhalten" }, |
734 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 734 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
735 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 735 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
736 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 736 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
737 | { "Sending file...","Sende Datei..." }, | 737 | { "Sending file...","Sende Datei..." }, |
738 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 738 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
739 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 739 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
740 | { "Received %1 bytes","%1 Bytes erhalten" }, | 740 | { "Received %1 bytes","%1 Bytes erhalten" }, |
741 | { "Writing file to disk...","Speichere Datei..." }, | 741 | { "Writing file to disk...","Speichere Datei..." }, |
742 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 742 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
743 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 743 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
744 | { "Synchronize!","Synchronisiere!" }, | 744 | { "Synchronize!","Synchronisiere!" }, |
745 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 745 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
746 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 746 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
747 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 747 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
748 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, | 748 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, |
749 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, | 749 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, |
750 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, | 750 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, |
751 | { "Edit new contact","Bearbeite neuen Kontakt" }, | 751 | { "Edit new contact","Bearbeite neuen Kontakt" }, |
752 | { "Edit ","Bearbeite " }, | 752 | { "Edit ","Bearbeite " }, |
753 | { "No contact changed!","Kein Kontakt verändert" }, | 753 | { "No contact changed!","Kein Kontakt verändert" }, |
754 | { "%1 contacts changed!","%1 Kontakte geändert!" }, | 754 | { "%1 contacts changed!","%1 Kontakte geändert!" }, |
755 | { "Mobile (home)","Handy (Privat)" }, | 755 | { "Mobile (home)","Handy (Privat)" }, |
756 | { "Mobile (work)","Handy (Arbeit)" }, | 756 | { "Mobile (work)","Handy (Arbeit)" }, |
757 | { "Def.Formatted Name","Def. Format. Name" }, | 757 | { "Def.Formatted Name","Def. Format. Name" }, |
758 | { "Colors","Farben" }, | 758 | { "Colors","Farben" }, |
759 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 759 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
760 | { "Backup enabled","Backup angeschaltet" }, | 760 | { "Backup enabled","Backup angeschaltet" }, |
761 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 761 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
762 | { "Number of Backups:","Anzahl der Backups" }, | 762 | { "Number of Backups:","Anzahl der Backups" }, |
763 | { "Make backup every ","Mache ein Backup alle " }, | 763 | { "Make backup every ","Mache ein Backup alle " }, |
764 | { " days"," Tage" }, | 764 | { " days"," Tage" }, |
765 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, | 765 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, |
766 | { "Backup Failed!","Backup Problem!" }, | 766 | { "Backup Failed!","Backup Problem!" }, |
767 | { "Try again now","Versuche jetzt nochmal" }, | 767 | { "Try again now","Versuche jetzt nochmal" }, |
768 | { "Try again later","Versuche später nochmal" }, | 768 | { "Try again later","Versuche später nochmal" }, |
769 | { "Try again tomorrow","Versuche morgen nochmal" }, | 769 | { "Try again tomorrow","Versuche morgen nochmal" }, |
770 | { "Disable backup","Schalte Backup ab" }, | 770 | { "Disable backup","Schalte Backup ab" }, |
771 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 771 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
772 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 772 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
773 | { "Choose action","Wähle Aktion" }, | 773 | { "Choose action","Wähle Aktion" }, |
774 | { "&Configure KA/Pi...","Konfiguriere KA/Pi..." }, | 774 | { "&Configure KA/Pi...","Konfiguriere KA/Pi..." }, |
775 | { "Global Settings...","Globale Einstellungen..." }, | 775 | { "Global Settings...","Globale Einstellungen..." }, |
776 | { "Spouse","Ehegatte" }, | 776 | { "Spouse","Ehegatte" }, |
777 | { "Notes","Notizen" }, | 777 | { "Notes","Notizen" }, |
778 | { "Messanger","Messanger" }, | 778 | { "Messanger","Messanger" }, |
779 | { "Assistant","Assistent" }, | 779 | { "Assistant","Assistent" }, |
780 | { "Manager","Manager" }, | 780 | { "Manager","Manager" }, |
781 | { "Secrecy","Sichtbar" }, | 781 | { "Secrecy","Sichtbar" }, |
782 | { "male","männlich" }, | 782 | { "male","männlich" }, |
783 | { "female","weiblich" }, | 783 | { "female","weiblich" }, |
784 | { "Hide!","Verbergen!" }, | 784 | { "Hide!","Verbergen!" }, |
785 | { "Show!","Anzeigen!" }, | 785 | { "Show!","Anzeigen!" }, |
786 | { "Details","Details" }, | 786 | { "Details","Details" }, |
787 | { "Search:","Suche:" }, | 787 | { "Search:","Suche:" }, |
788 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, | 788 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, |
789 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, | 789 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, |
790 | { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, | 790 | { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, |
791 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, | 791 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, |
792 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, | 792 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, |
793 | { "Pi-Sync Error","Pi-Sync Fehler" }, | 793 | { "Pi-Sync Error","Pi-Sync Fehler" }, |
794 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, | 794 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, |
795 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, | 795 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, |
796 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, | 796 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, |
797 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, | 797 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, |
798 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 798 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
799 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 799 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
800 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 800 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
801 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 801 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
802 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 802 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, |
803 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, | 803 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, |
804 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 804 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
805 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 805 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
806 | { "Writing back file ...","Schreibe Datei zurück..." }, | 806 | { "Writing back file ...","Schreibe Datei zurück..." }, |
807 | { "Sending back file ...","Sende Datei zurück..." }, | 807 | { "Sending back file ...","Sende Datei zurück..." }, |
808 | { "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" }, | 808 | { "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" }, |
809 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, | 809 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, |
810 | { "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" }, | 810 | { "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" }, |
811 | { "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" }, | 811 | { "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" }, |
812 | { "%1 contacts\nsuccessfully\nimported.","%1 Kontakte\nerfolgreich\nimportiert." }, | 812 | { "%1 contacts\nsuccessfully\nimported.","%1 Kontakte\nerfolgreich\nimportiert." }, |
813 | { "Import this contact?","Importiere diesen Kontakt?" }, | 813 | { "Import this contact?","Importiere diesen Kontakt?" }, |
814 | { "Import all!","Importiere alle!" }, | 814 | { "Import all!","Importiere alle!" }, |
815 | { "Loading addressbook data ... please wait","Lade Adressbuchdaten ... bitte warten" }, | 815 | { "Loading addressbook data ... please wait","Lade Adressbuchdaten ... bitte warten" }, |
816 | { "Import Format","Import Format" }, | 816 | { "Import Format","Import Format" }, |
817 | { "Select import format!\nDefault and standard is Utf8.\nLatin1 may be the right\nfor some West Europian languages.","Wähle Import Format!\nDefault und Standard ist Utf8.\nLatin1 kann das richtige für\nWesteuropäische Sprachen sein." }, | 817 | { "Select import format!\nDefault and standard is Utf8.\nLatin1 may be the right\nfor some West Europian languages.","Wähle Import Format!\nDefault und Standard ist Utf8.\nLatin1 kann das richtige für\nWesteuropäische Sprachen sein." }, |
818 | { "Home2","Privat2" }, | 818 | { "Home2","Privat2" }, |
819 | { "Work2","Arbeit2" }, | 819 | { "Work2","Arbeit2" }, |
820 | { "Fax (Work)","Fax (Arbeit)" }, | 820 | { "Fax (Work)","Fax (Arbeit)" }, |
821 | { "Fax (Home)","Fax (Privat)" }, | 821 | { "Fax (Home)","Fax (Privat)" }, |
822 | { "Assistent","Sekretär(in)" }, | 822 | { "Assistent","Sekretär(in)" }, |
823 | { "Company","Firma" }, | 823 | { "Company","Firma" }, |
824 | { "Mobile2 (Work)","Handy2 (Arbeit)" }, | 824 | { "Mobile2","Handy2" }, |
825 | { "Mobile2 (Car)","Handy2 (Auto)" }, | ||
826 | { "Callback","Rückruf" }, | 825 | { "Callback","Rückruf" }, |
827 | { "Fax (Other)","Fax (Sonst.)" }, | 826 | { "Fax (Other)","Fax (Sonst.)" }, |
828 | { "Primary","Bevorzugt" }, | 827 | { "Primary","Bevorzugt" }, |
829 | { "Mobile (Home)","Handy (Privat)" }, | 828 | { "Mobile","Handy" }, |
830 | { "Unfiled","Nicht zugeordnet" }, | 829 | { "Unfiled","Nicht zugeordnet" }, |
831 | { "Format.n.:","Format.N.:" }, | 830 | { "Format.n.:","Format.N.:" }, |
832 | { "Other Phone","Sonst. Telefon" }, | 831 | { "Other Phone","Sonst. Telefon" }, |
833 | { "","" }, | 832 | { "","" }, |
834 | { "","" }, | 833 | { "","" }, |
835 | { "","" }, | 834 | { "","" }, |
836 | { "","" }, | 835 | { "","" }, |
837 | { "","" }, \ No newline at end of file | 836 | { "","" }, \ No newline at end of file |
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 0d8e8e8..2f4a9af 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1,2296 +1,2286 @@ | |||
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 | static bool matchBinaryPatternA( int value, int pattern ); | 46 | static bool matchBinaryPatternA( int value, int pattern ); |
47 | static bool matchBinaryPatternP( int value, int pattern ); | 47 | static bool matchBinaryPatternP( int value, int pattern ); |
48 | 48 | ||
49 | struct Addressee::AddresseeData : public KShared | 49 | struct Addressee::AddresseeData : public KShared |
50 | { | 50 | { |
51 | QString uid; | 51 | QString uid; |
52 | QString name; | 52 | QString name; |
53 | QString formattedName; | 53 | QString formattedName; |
54 | QString familyName; | 54 | QString familyName; |
55 | QString givenName; | 55 | QString givenName; |
56 | QString additionalName; | 56 | QString additionalName; |
57 | QString prefix; | 57 | QString prefix; |
58 | QString suffix; | 58 | QString suffix; |
59 | QString nickName; | 59 | QString nickName; |
60 | QDateTime birthday; | 60 | QDateTime birthday; |
61 | QString mailer; | 61 | QString mailer; |
62 | TimeZone timeZone; | 62 | TimeZone timeZone; |
63 | Geo geo; | 63 | Geo geo; |
64 | QString title; | 64 | QString title; |
65 | QString role; | 65 | QString role; |
66 | QString organization; | 66 | QString organization; |
67 | QString note; | 67 | QString note; |
68 | QString productId; | 68 | QString productId; |
69 | QDateTime revision; | 69 | QDateTime revision; |
70 | QString sortString; | 70 | QString sortString; |
71 | QString externalUID; | 71 | QString externalUID; |
72 | QString originalExternalUID; | 72 | QString originalExternalUID; |
73 | KURL url; | 73 | KURL url; |
74 | Secrecy secrecy; | 74 | Secrecy secrecy; |
75 | Picture logo; | 75 | Picture logo; |
76 | Picture photo; | 76 | Picture photo; |
77 | Sound sound; | 77 | Sound sound; |
78 | Agent agent; | 78 | Agent agent; |
79 | QString mExternalId; | 79 | QString mExternalId; |
80 | PhoneNumber::List phoneNumbers; | 80 | PhoneNumber::List phoneNumbers; |
81 | Address::List addresses; | 81 | Address::List addresses; |
82 | Key::List keys; | 82 | Key::List keys; |
83 | QStringList emails; | 83 | QStringList emails; |
84 | QStringList categories; | 84 | QStringList categories; |
85 | QStringList custom; | 85 | QStringList custom; |
86 | int mTempSyncStat; | 86 | int mTempSyncStat; |
87 | Resource *resource; | 87 | Resource *resource; |
88 | 88 | ||
89 | bool empty :1; | 89 | bool empty :1; |
90 | bool changed :1; | 90 | bool changed :1; |
91 | bool tagged :1; | 91 | bool tagged :1; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | Addressee::Addressee() | 94 | Addressee::Addressee() |
95 | { | 95 | { |
96 | mData = new AddresseeData; | 96 | mData = new AddresseeData; |
97 | mData->empty = true; | 97 | mData->empty = true; |
98 | mData->changed = false; | 98 | mData->changed = false; |
99 | mData->resource = 0; | 99 | mData->resource = 0; |
100 | mData->mExternalId = ":"; | 100 | mData->mExternalId = ":"; |
101 | mData->revision = QDateTime ( QDate( 2003,1,1)); | 101 | mData->revision = QDateTime ( QDate( 2003,1,1)); |
102 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; | 102 | mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; |
103 | } | 103 | } |
104 | 104 | ||
105 | Addressee::~Addressee() | 105 | Addressee::~Addressee() |
106 | { | 106 | { |
107 | } | 107 | } |
108 | 108 | ||
109 | Addressee::Addressee( const Addressee &a ) | 109 | Addressee::Addressee( const Addressee &a ) |
110 | { | 110 | { |
111 | mData = a.mData; | 111 | mData = a.mData; |
112 | } | 112 | } |
113 | 113 | ||
114 | Addressee &Addressee::operator=( const Addressee &a ) | 114 | Addressee &Addressee::operator=( const Addressee &a ) |
115 | { | 115 | { |
116 | mData = a.mData; | 116 | mData = a.mData; |
117 | return (*this); | 117 | return (*this); |
118 | } | 118 | } |
119 | 119 | ||
120 | Addressee Addressee::copy() | 120 | Addressee Addressee::copy() |
121 | { | 121 | { |
122 | Addressee a; | 122 | Addressee a; |
123 | *(a.mData) = *mData; | 123 | *(a.mData) = *mData; |
124 | return a; | 124 | return a; |
125 | } | 125 | } |
126 | 126 | ||
127 | void Addressee::detach() | 127 | void Addressee::detach() |
128 | { | 128 | { |
129 | if ( mData.count() == 1 ) return; | 129 | if ( mData.count() == 1 ) return; |
130 | *this = copy(); | 130 | *this = copy(); |
131 | } | 131 | } |
132 | 132 | ||
133 | bool Addressee::operator==( const Addressee &a ) const | 133 | bool Addressee::operator==( const Addressee &a ) const |
134 | { | 134 | { |
135 | if ( uid() != a.uid() ) return false; | 135 | if ( uid() != a.uid() ) return false; |
136 | if ( mData->name != a.mData->name ) return false; | 136 | if ( mData->name != a.mData->name ) return false; |
137 | if ( mData->formattedName != a.mData->formattedName ) return false; | 137 | if ( mData->formattedName != a.mData->formattedName ) return false; |
138 | if ( mData->familyName != a.mData->familyName ) return false; | 138 | if ( mData->familyName != a.mData->familyName ) return false; |
139 | if ( mData->givenName != a.mData->givenName ) return false; | 139 | if ( mData->givenName != a.mData->givenName ) return false; |
140 | if ( mData->additionalName != a.mData->additionalName ) return false; | 140 | if ( mData->additionalName != a.mData->additionalName ) return false; |
141 | if ( mData->prefix != a.mData->prefix ) return false; | 141 | if ( mData->prefix != a.mData->prefix ) return false; |
142 | if ( mData->suffix != a.mData->suffix ) return false; | 142 | if ( mData->suffix != a.mData->suffix ) return false; |
143 | if ( mData->nickName != a.mData->nickName ) return false; | 143 | if ( mData->nickName != a.mData->nickName ) return false; |
144 | if ( mData->birthday != a.mData->birthday ) return false; | 144 | if ( mData->birthday != a.mData->birthday ) return false; |
145 | if ( mData->mailer != a.mData->mailer ) return false; | 145 | if ( mData->mailer != a.mData->mailer ) return false; |
146 | if ( mData->timeZone != a.mData->timeZone ) return false; | 146 | if ( mData->timeZone != a.mData->timeZone ) return false; |
147 | if ( mData->geo != a.mData->geo ) return false; | 147 | if ( mData->geo != a.mData->geo ) return false; |
148 | if ( mData->title != a.mData->title ) return false; | 148 | if ( mData->title != a.mData->title ) return false; |
149 | if ( mData->role != a.mData->role ) return false; | 149 | if ( mData->role != a.mData->role ) return false; |
150 | if ( mData->organization != a.mData->organization ) return false; | 150 | if ( mData->organization != a.mData->organization ) return false; |
151 | if ( mData->note != a.mData->note ) return false; | 151 | if ( mData->note != a.mData->note ) return false; |
152 | if ( mData->productId != a.mData->productId ) return false; | 152 | if ( mData->productId != a.mData->productId ) return false; |
153 | //if ( mData->revision != a.mData->revision ) return false; | 153 | //if ( mData->revision != a.mData->revision ) return false; |
154 | if ( mData->sortString != a.mData->sortString ) return false; | 154 | if ( mData->sortString != a.mData->sortString ) return false; |
155 | if ( mData->secrecy != a.mData->secrecy ) return false; | 155 | if ( mData->secrecy != a.mData->secrecy ) return false; |
156 | if ( mData->logo != a.mData->logo ) return false; | 156 | if ( mData->logo != a.mData->logo ) return false; |
157 | if ( mData->photo != a.mData->photo ) return false; | 157 | if ( mData->photo != a.mData->photo ) return false; |
158 | if ( mData->sound != a.mData->sound ) return false; | 158 | if ( mData->sound != a.mData->sound ) return false; |
159 | if ( mData->agent != a.mData->agent ) return false; | 159 | if ( mData->agent != a.mData->agent ) return false; |
160 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && | 160 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && |
161 | ( mData->url != a.mData->url ) ) return false; | 161 | ( mData->url != a.mData->url ) ) return false; |
162 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; | 162 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; |
163 | if ( mData->addresses != a.mData->addresses ) return false; | 163 | if ( mData->addresses != a.mData->addresses ) return false; |
164 | if ( mData->keys != a.mData->keys ) return false; | 164 | if ( mData->keys != a.mData->keys ) return false; |
165 | if ( mData->emails != a.mData->emails ) return false; | 165 | if ( mData->emails != a.mData->emails ) return false; |
166 | if ( mData->categories != a.mData->categories ) return false; | 166 | if ( mData->categories != a.mData->categories ) return false; |
167 | if ( mData->custom != a.mData->custom ) return false; | 167 | if ( mData->custom != a.mData->custom ) return false; |
168 | 168 | ||
169 | return true; | 169 | return true; |
170 | } | 170 | } |
171 | 171 | ||
172 | bool Addressee::operator!=( const Addressee &a ) const | 172 | bool Addressee::operator!=( const Addressee &a ) const |
173 | { | 173 | { |
174 | return !( a == *this ); | 174 | return !( a == *this ); |
175 | } | 175 | } |
176 | 176 | ||
177 | bool Addressee::isEmpty() const | 177 | bool Addressee::isEmpty() const |
178 | { | 178 | { |
179 | return mData->empty; | 179 | return mData->empty; |
180 | } | 180 | } |
181 | ulong Addressee::getCsum4List( const QStringList & attList) | 181 | ulong Addressee::getCsum4List( const QStringList & attList) |
182 | { | 182 | { |
183 | int max = attList.count(); | 183 | int max = attList.count(); |
184 | ulong cSum = 0; | 184 | ulong cSum = 0; |
185 | int j,k,i; | 185 | int j,k,i; |
186 | int add; | 186 | int add; |
187 | for ( i = 0; i < max ; ++i ) { | 187 | for ( i = 0; i < max ; ++i ) { |
188 | QString s = attList[i]; | 188 | QString s = attList[i]; |
189 | if ( ! s.isEmpty() ){ | 189 | if ( ! s.isEmpty() ){ |
190 | j = s.length(); | 190 | j = s.length(); |
191 | for ( k = 0; k < j; ++k ) { | 191 | for ( k = 0; k < j; ++k ) { |
192 | int mul = k +1; | 192 | int mul = k +1; |
193 | add = s[k].unicode (); | 193 | add = s[k].unicode (); |
194 | if ( k < 16 ) | 194 | if ( k < 16 ) |
195 | mul = mul * mul; | 195 | mul = mul * mul; |
196 | int ii = i+1; | 196 | int ii = i+1; |
197 | add = add * mul *ii*ii*ii; | 197 | add = add * mul *ii*ii*ii; |
198 | cSum += add; | 198 | cSum += add; |
199 | //qDebug("csum: %d %d %d", i,k,cSum); | 199 | //qDebug("csum: %d %d %d", i,k,cSum); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | } | 203 | } |
204 | //QString dump = attList.join(","); | 204 | //QString dump = attList.join(","); |
205 | //qDebug("csum: %d %s", cSum,dump.latin1()); | 205 | //qDebug("csum: %d %s", cSum,dump.latin1()); |
206 | 206 | ||
207 | return cSum; | 207 | return cSum; |
208 | 208 | ||
209 | } | 209 | } |
210 | void Addressee::computeCsum(const QString &dev) | 210 | void Addressee::computeCsum(const QString &dev) |
211 | { | 211 | { |
212 | QStringList l; | 212 | QStringList l; |
213 | //if ( !mData->name.isEmpty() ) l.append(mData->name); | 213 | //if ( !mData->name.isEmpty() ) l.append(mData->name); |
214 | //if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); | 214 | //if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); |
215 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); | 215 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); |
216 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); | 216 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); |
217 | if ( !mData->additionalName.isEmpty() ) l.append( mData->additionalName ); | 217 | if ( !mData->additionalName.isEmpty() ) l.append( mData->additionalName ); |
218 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); | 218 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); |
219 | if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); | 219 | if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); |
220 | if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); | 220 | if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); |
221 | if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); | 221 | if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); |
222 | if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); | 222 | if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); |
223 | if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); | 223 | if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); |
224 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); | 224 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); |
225 | if ( !mData->title .isEmpty() ) l.append( mData->title ); | 225 | if ( !mData->title .isEmpty() ) l.append( mData->title ); |
226 | if ( !mData->role.isEmpty() ) l.append( mData->role ); | 226 | if ( !mData->role.isEmpty() ) l.append( mData->role ); |
227 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); | 227 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); |
228 | if ( !mData->note.isEmpty() ) l.append( mData->note ); | 228 | if ( !mData->note.isEmpty() ) l.append( mData->note ); |
229 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); | 229 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); |
230 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); | 230 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); |
231 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); | 231 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); |
232 | if ( !mData->logo.undefined() ) { | 232 | if ( !mData->logo.undefined() ) { |
233 | if ( !mData->logo.isIntern() ) | 233 | if ( !mData->logo.isIntern() ) |
234 | l.append( mData->logo.url() ); | 234 | l.append( mData->logo.url() ); |
235 | else | 235 | else |
236 | l.append( QString::number(mData->logo.data().width()* mData->logo.data().height())); | 236 | l.append( QString::number(mData->logo.data().width()* mData->logo.data().height())); |
237 | } else { | 237 | } else { |
238 | l.append( "nologo"); | 238 | l.append( "nologo"); |
239 | } | 239 | } |
240 | if ( !mData->photo.undefined() ) { | 240 | if ( !mData->photo.undefined() ) { |
241 | if ( !mData->photo.isIntern() ) | 241 | if ( !mData->photo.isIntern() ) |
242 | l.append( mData->photo.url() ); | 242 | l.append( mData->photo.url() ); |
243 | else | 243 | else |
244 | l.append( QString::number(mData->photo.data().width()* mData->photo.data().height())); | 244 | l.append( QString::number(mData->photo.data().width()* mData->photo.data().height())); |
245 | } else { | 245 | } else { |
246 | l.append( "nophoto"); | 246 | l.append( "nophoto"); |
247 | } | 247 | } |
248 | #if 0 | 248 | #if 0 |
249 | if ( !mData->sound.undefined() ) { | 249 | if ( !mData->sound.undefined() ) { |
250 | if ( !mData->sound.isIntern() ) | 250 | if ( !mData->sound.isIntern() ) |
251 | l.append( mData->sound.url() ); | 251 | l.append( mData->sound.url() ); |
252 | else | 252 | else |
253 | l.append( QString(mData->sound.data().with()* mData->sound.data().height())); | 253 | l.append( QString(mData->sound.data().with()* mData->sound.data().height())); |
254 | } else { | 254 | } else { |
255 | l.append( "nosound"); | 255 | l.append( "nosound"); |
256 | } | 256 | } |
257 | #endif | 257 | #endif |
258 | //if ( !mData->agent.isEmpty() ) l.append( ); | 258 | //if ( !mData->agent.isEmpty() ) l.append( ); |
259 | if ( mData->url.isValid() ) | 259 | if ( mData->url.isValid() ) |
260 | if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() ); | 260 | if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() ); |
261 | KABC::PhoneNumber::List phoneNumbers; | 261 | KABC::PhoneNumber::List phoneNumbers; |
262 | KABC::PhoneNumber::List::Iterator phoneIter; | 262 | KABC::PhoneNumber::List::Iterator phoneIter; |
263 | 263 | ||
264 | QStringList t; | 264 | QStringList t; |
265 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 265 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
266 | ++phoneIter ) | 266 | ++phoneIter ) |
267 | t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); | 267 | t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); |
268 | t.sort(); | 268 | t.sort(); |
269 | uint iii; | 269 | uint iii; |
270 | for ( iii = 0; iii < t.count(); ++iii) | 270 | for ( iii = 0; iii < t.count(); ++iii) |
271 | l.append( t[iii] ); | 271 | l.append( t[iii] ); |
272 | t = mData->emails; | 272 | t = mData->emails; |
273 | t.sort(); | 273 | t.sort(); |
274 | for ( iii = 0; iii < t.count(); ++iii) | 274 | for ( iii = 0; iii < t.count(); ++iii) |
275 | l.append( t[iii] ); | 275 | l.append( t[iii] ); |
276 | t = mData->categories; | 276 | t = mData->categories; |
277 | t.sort(); | 277 | t.sort(); |
278 | for ( iii = 0; iii < t.count(); ++iii) | 278 | for ( iii = 0; iii < t.count(); ++iii) |
279 | l.append( t[iii] ); | 279 | l.append( t[iii] ); |
280 | t = mData->custom; | 280 | t = mData->custom; |
281 | t.sort(); | 281 | t.sort(); |
282 | for ( iii = 0; iii < t.count(); ++iii) | 282 | for ( iii = 0; iii < t.count(); ++iii) |
283 | if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) { | 283 | if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) { |
284 | int find = t[iii].find (':')+1; | 284 | int find = t[iii].find (':')+1; |
285 | //qDebug("lennnn %d %d ", find, t[iii].length()); | 285 | //qDebug("lennnn %d %d ", find, t[iii].length()); |
286 | if ( find < t[iii].length()) | 286 | if ( find < t[iii].length()) |
287 | l.append( t[iii] ); | 287 | l.append( t[iii] ); |
288 | 288 | ||
289 | } | 289 | } |
290 | KABC::Address::List::Iterator addressIter; | 290 | KABC::Address::List::Iterator addressIter; |
291 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); | 291 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); |
292 | ++addressIter ) { | 292 | ++addressIter ) { |
293 | t = (*addressIter).asList(); | 293 | t = (*addressIter).asList(); |
294 | t.sort(); | 294 | t.sort(); |
295 | for ( iii = 0; iii < t.count(); ++iii) | 295 | for ( iii = 0; iii < t.count(); ++iii) |
296 | l.append( t[iii] ); | 296 | l.append( t[iii] ); |
297 | } | 297 | } |
298 | uint cs = getCsum4List(l); | 298 | uint cs = getCsum4List(l); |
299 | 299 | ||
300 | #if 0 | 300 | #if 0 |
301 | for ( iii = 0; iii < l.count(); ++iii) | 301 | for ( iii = 0; iii < l.count(); ++iii) |
302 | qDebug("%d***%s***",iii,l[iii].latin1()); | 302 | qDebug("%d***%s***",iii,l[iii].latin1()); |
303 | qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); | 303 | qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); |
304 | #endif | 304 | #endif |
305 | 305 | ||
306 | 306 | ||
307 | setCsum( dev, QString::number (cs )); | 307 | setCsum( dev, QString::number (cs )); |
308 | } | 308 | } |
309 | bool Addressee::matchAddress( QRegExp* re ) const | 309 | bool Addressee::matchAddress( QRegExp* re ) const |
310 | { | 310 | { |
311 | KABC::Address::List::Iterator addressIter; | 311 | KABC::Address::List::Iterator addressIter; |
312 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); | 312 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); |
313 | ++addressIter ) { | 313 | ++addressIter ) { |
314 | if ( (*addressIter).matchAddress( re ) ) | 314 | if ( (*addressIter).matchAddress( re ) ) |
315 | return true; | 315 | return true; |
316 | } | 316 | } |
317 | return false; | 317 | return false; |
318 | } | 318 | } |
319 | bool Addressee::matchPhoneNumber( QRegExp* re ) const | 319 | bool Addressee::matchPhoneNumber( QRegExp* re ) const |
320 | { | 320 | { |
321 | KABC::PhoneNumber::List::Iterator phoneIter; | 321 | KABC::PhoneNumber::List::Iterator phoneIter; |
322 | 322 | ||
323 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); ++phoneIter ) { | 323 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); ++phoneIter ) { |
324 | #if QT_VERSION >= 0x030000 | 324 | #if QT_VERSION >= 0x030000 |
325 | if (re->search( (*phoneIter).number() ) == 0) | 325 | if (re->search( (*phoneIter).number() ) == 0) |
326 | #else | 326 | #else |
327 | if (re->match( (*phoneIter).number() ) == 0) | 327 | if (re->match( (*phoneIter).number() ) == 0) |
328 | #endif | 328 | #endif |
329 | return true; | 329 | return true; |
330 | 330 | ||
331 | } | 331 | } |
332 | return false; | 332 | return false; |
333 | 333 | ||
334 | } | 334 | } |
335 | void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | 335 | void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) |
336 | { | 336 | { |
337 | // merge all standard non-outlook fields. | 337 | // merge all standard non-outlook fields. |
338 | //if isSubSet (e.g. mobile phone sync) merge all fields | 338 | //if isSubSet (e.g. mobile phone sync) merge all fields |
339 | 339 | ||
340 | detach(); | 340 | detach(); |
341 | if ( isSubSet ) { | 341 | if ( isSubSet ) { |
342 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; | 342 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; |
343 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; | 343 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; |
344 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; | 344 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; |
345 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; | 345 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; |
346 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; | 346 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; |
347 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; | 347 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; |
348 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; | 348 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; |
349 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; | 349 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; |
350 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; | 350 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; |
351 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; | 351 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; |
352 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | 352 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; |
353 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | 353 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; |
354 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | 354 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; |
355 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; | 355 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; |
356 | if ( !mData->birthday.isValid() ) | 356 | if ( !mData->birthday.isValid() ) |
357 | if ( ad.mData->birthday.isValid()) | 357 | if ( ad.mData->birthday.isValid()) |
358 | mData->birthday = ad.mData->birthday; | 358 | mData->birthday = ad.mData->birthday; |
359 | 359 | ||
360 | } | 360 | } |
361 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; | 361 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; |
362 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; | 362 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; |
363 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; | 363 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; |
364 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; | 364 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
365 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; | 365 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
366 | QStringList t; | 366 | QStringList t; |
367 | QStringList tAD; | 367 | QStringList tAD; |
368 | uint iii; | 368 | uint iii; |
369 | 369 | ||
370 | // ********** phone numbers | 370 | // ********** phone numbers |
371 | if ( isSubSet ) { | 371 | if ( isSubSet ) { |
372 | PhoneNumber::List phoneAD = ad.phoneNumbers(); | 372 | PhoneNumber::List phoneAD = ad.phoneNumbers(); |
373 | PhoneNumber::List::Iterator phoneItAD; | 373 | PhoneNumber::List::Iterator phoneItAD; |
374 | for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { | 374 | for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { |
375 | bool found = false; | 375 | bool found = false; |
376 | PhoneNumber::List::Iterator it; | 376 | PhoneNumber::List::Iterator it; |
377 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 377 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
378 | if ( ( *phoneItAD ).contains( (*it) ) ) { | 378 | if ( ( *phoneItAD ).contains( (*it) ) ) { |
379 | found = true; | 379 | found = true; |
380 | (*it).setType( ( *phoneItAD ).type() ); | 380 | (*it).setType( ( *phoneItAD ).type() ); |
381 | (*it).setNumber( ( *phoneItAD ).number() ); | 381 | (*it).setNumber( ( *phoneItAD ).number() ); |
382 | break; | 382 | break; |
383 | } | 383 | } |
384 | } | 384 | } |
385 | // if ( isSubSet && ! found ) | 385 | // if ( isSubSet && ! found ) |
386 | if ( ! found ) // LR try this one... | 386 | if ( ! found ) // LR try this one... |
387 | mData->phoneNumbers.append( *phoneItAD ); | 387 | mData->phoneNumbers.append( *phoneItAD ); |
388 | } | 388 | } |
389 | } else { | 389 | } else { |
390 | PhoneNumber::List phoneAD = ad.phoneNumbers(); | 390 | PhoneNumber::List phoneAD = ad.phoneNumbers(); |
391 | PhoneNumber::List::Iterator phoneItAD; | 391 | PhoneNumber::List::Iterator phoneItAD; |
392 | for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { | 392 | for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { |
393 | bool found = false; | 393 | bool found = false; |
394 | PhoneNumber::List::Iterator it; | 394 | PhoneNumber::List::Iterator it; |
395 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 395 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
396 | if ( ( *phoneItAD ).contains( (*it) ) ) { | 396 | if ( ( *phoneItAD ).contains( (*it) ) ) { |
397 | found = true; | 397 | found = true; |
398 | (*it).setType( ( *phoneItAD ).type() ); | 398 | (*it).setType( ( *phoneItAD ).type() ); |
399 | (*it).setNumber( ( *phoneItAD ).number() ); | 399 | (*it).setNumber( ( *phoneItAD ).number() ); |
400 | break; | 400 | break; |
401 | } | 401 | } |
402 | } | 402 | } |
403 | if ( ! found ) { // append numbers which do not have work or home type | 403 | if ( ! found ) { // append numbers which do not have work or home type |
404 | if ( ! ( ( *phoneItAD ).type() & (PhoneNumber::Work | PhoneNumber::Home) ) ) | 404 | if ( ! ( ( *phoneItAD ).type() & (PhoneNumber::Work | PhoneNumber::Home) ) ) |
405 | mData->phoneNumbers.append( *phoneItAD ); | 405 | mData->phoneNumbers.append( *phoneItAD ); |
406 | } | 406 | } |
407 | } | 407 | } |
408 | } | 408 | } |
409 | if ( isSubSet ) { | 409 | if ( isSubSet ) { |
410 | // ************* emails; | 410 | // ************* emails; |
411 | t = mData->emails; | 411 | t = mData->emails; |
412 | tAD = ad.mData->emails; | 412 | tAD = ad.mData->emails; |
413 | for ( iii = 0; iii < tAD.count(); ++iii) | 413 | for ( iii = 0; iii < tAD.count(); ++iii) |
414 | if ( !t.contains(tAD[iii] ) ) | 414 | if ( !t.contains(tAD[iii] ) ) |
415 | mData->emails.append( tAD[iii] ); | 415 | mData->emails.append( tAD[iii] ); |
416 | } | 416 | } |
417 | 417 | ||
418 | // ************* categories; | 418 | // ************* categories; |
419 | if ( isSubSet ) { | 419 | if ( isSubSet ) { |
420 | t = mData->categories; | 420 | t = mData->categories; |
421 | tAD = ad.mData->categories; | 421 | tAD = ad.mData->categories; |
422 | for ( iii = 0; iii < tAD.count(); ++iii) | 422 | for ( iii = 0; iii < tAD.count(); ++iii) |
423 | if ( !t.contains(tAD[iii] ) ) | 423 | if ( !t.contains(tAD[iii] ) ) |
424 | mData->categories.append( tAD[iii] ); | 424 | mData->categories.append( tAD[iii] ); |
425 | } | 425 | } |
426 | QStringList::ConstIterator it; | 426 | QStringList::ConstIterator it; |
427 | for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) { | 427 | for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) { |
428 | QString qualifiedName = (*it).left( (*it).find( ":" )); | 428 | QString qualifiedName = (*it).left( (*it).find( ":" )); |
429 | bool found = false; | 429 | bool found = false; |
430 | QStringList::ConstIterator itL; | 430 | QStringList::ConstIterator itL; |
431 | for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) { | 431 | for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) { |
432 | if ( (*itL).startsWith( qualifiedName ) ) { | 432 | if ( (*itL).startsWith( qualifiedName ) ) { |
433 | found = true; | 433 | found = true; |
434 | break; | 434 | break; |
435 | } | 435 | } |
436 | } | 436 | } |
437 | if ( ! found ) { | 437 | if ( ! found ) { |
438 | mData->custom.append( *it ); | 438 | mData->custom.append( *it ); |
439 | } | 439 | } |
440 | } | 440 | } |
441 | if ( mData->logo.undefined() && !ad.mData->logo.undefined() ) mData->logo = ad.mData->logo; | 441 | if ( mData->logo.undefined() && !ad.mData->logo.undefined() ) mData->logo = ad.mData->logo; |
442 | if ( mData->photo.undefined() && !ad.mData->photo.undefined() ) mData->photo = ad.mData->photo; | 442 | if ( mData->photo.undefined() && !ad.mData->photo.undefined() ) mData->photo = ad.mData->photo; |
443 | if ( !mData->sound.isIntern() ) { | 443 | if ( !mData->sound.isIntern() ) { |
444 | if ( mData->sound.url().isEmpty() ) { | 444 | if ( mData->sound.url().isEmpty() ) { |
445 | mData->sound = ad.mData->sound; | 445 | mData->sound = ad.mData->sound; |
446 | } | 446 | } |
447 | } | 447 | } |
448 | if ( !mData->agent.isIntern() ) { | 448 | if ( !mData->agent.isIntern() ) { |
449 | if ( mData->agent.url().isEmpty() ) { | 449 | if ( mData->agent.url().isEmpty() ) { |
450 | mData->agent = ad.mData->agent; | 450 | mData->agent = ad.mData->agent; |
451 | } | 451 | } |
452 | } | 452 | } |
453 | { | 453 | { |
454 | Key::List::Iterator itA; | 454 | Key::List::Iterator itA; |
455 | for( itA = ad.mData->keys.begin(); itA != ad.mData->keys.end(); ++itA ) { | 455 | for( itA = ad.mData->keys.begin(); itA != ad.mData->keys.end(); ++itA ) { |
456 | bool found = false; | 456 | bool found = false; |
457 | Key::List::Iterator it; | 457 | Key::List::Iterator it; |
458 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { | 458 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { |
459 | if ( (*it) == (*itA)) { | 459 | if ( (*it) == (*itA)) { |
460 | found = true; | 460 | found = true; |
461 | break; | 461 | break; |
462 | 462 | ||
463 | } | 463 | } |
464 | } | 464 | } |
465 | if ( ! found ) { | 465 | if ( ! found ) { |
466 | mData->keys.append( *itA ); | 466 | mData->keys.append( *itA ); |
467 | } | 467 | } |
468 | } | 468 | } |
469 | } | 469 | } |
470 | if ( isSubSet ) { | 470 | if ( isSubSet ) { |
471 | KABC::Address::List::Iterator addressIterA; | 471 | KABC::Address::List::Iterator addressIterA; |
472 | for ( addressIterA = ad.mData->addresses.begin(); addressIterA != ad.mData->addresses.end(); ++addressIterA ) { | 472 | for ( addressIterA = ad.mData->addresses.begin(); addressIterA != ad.mData->addresses.end(); ++addressIterA ) { |
473 | bool found = false; | 473 | bool found = false; |
474 | KABC::Address::List::Iterator addressIter; | 474 | KABC::Address::List::Iterator addressIter; |
475 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); | 475 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); |
476 | ++addressIter ) { | 476 | ++addressIter ) { |
477 | if ( (*addressIter) == (*addressIterA)) { | 477 | if ( (*addressIter) == (*addressIterA)) { |
478 | found = true; | 478 | found = true; |
479 | (*addressIter).setType( (*addressIterA).type() ); | 479 | (*addressIter).setType( (*addressIterA).type() ); |
480 | break; | 480 | break; |
481 | } | 481 | } |
482 | 482 | ||
483 | } | 483 | } |
484 | if ( isSubSet && ! found ) { | 484 | if ( isSubSet && ! found ) { |
485 | mData->addresses.append( *addressIterA ); | 485 | mData->addresses.append( *addressIterA ); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | } | 488 | } |
489 | //qDebug("merge contact %s ", ad.uid().latin1()); | 489 | //qDebug("merge contact %s ", ad.uid().latin1()); |
490 | setUid( ad.uid() ); | 490 | setUid( ad.uid() ); |
491 | setRevision( ad.revision() ); | 491 | setRevision( ad.revision() ); |
492 | } | 492 | } |
493 | 493 | ||
494 | bool Addressee::removeVoice() | 494 | bool Addressee::removeVoice() |
495 | { | 495 | { |
496 | PhoneNumber::List phoneN = phoneNumbers(); | 496 | PhoneNumber::List phoneN = phoneNumbers(); |
497 | PhoneNumber::List::Iterator phoneIt; | 497 | PhoneNumber::List::Iterator phoneIt; |
498 | bool found = false; | 498 | bool found = false; |
499 | for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { | 499 | for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { |
500 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found | 500 | if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found |
501 | if ((*phoneIt).type() - PhoneNumber::Voice ) { | 501 | if ((*phoneIt).type() - PhoneNumber::Voice ) { |
502 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); | 502 | (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); |
503 | insertPhoneNumber( (*phoneIt) ); | 503 | insertPhoneNumber( (*phoneIt) ); |
504 | found = true; | 504 | found = true; |
505 | } | 505 | } |
506 | } | 506 | } |
507 | 507 | ||
508 | } | 508 | } |
509 | return found; | 509 | return found; |
510 | } | 510 | } |
511 | 511 | ||
512 | bool Addressee::containsAdr(const Addressee& ad ) | 512 | bool Addressee::containsAdr(const Addressee& ad ) |
513 | { | 513 | { |
514 | if ( ! ad.mData->familyName.isEmpty() ) if ( mData->familyName != ad.mData->familyName) return false; | 514 | if ( ! ad.mData->familyName.isEmpty() ) if ( mData->familyName != ad.mData->familyName) return false; |
515 | if ( ! ad.mData->givenName.isEmpty() )if ( mData->givenName != ad.mData->givenName ) return false; | 515 | if ( ! ad.mData->givenName.isEmpty() )if ( mData->givenName != ad.mData->givenName ) return false; |
516 | if ( ad.mData->url.isValid() ) if (mData->url != ad.mData->url) return false ; | 516 | if ( ad.mData->url.isValid() ) if (mData->url != ad.mData->url) return false ; |
517 | if ( ! ad.mData->role.isEmpty() ) if (mData->role != ad.mData->role) return false ; | 517 | if ( ! ad.mData->role.isEmpty() ) if (mData->role != ad.mData->role) return false ; |
518 | if ( ! ad.mData->organization.isEmpty() ) if (mData->organization != ad.mData->organization) return false ; | 518 | if ( ! ad.mData->organization.isEmpty() ) if (mData->organization != ad.mData->organization) return false ; |
519 | if ( ! ad.mData->note.isEmpty() ) if (mData->note != ad.mData->note) return false ; | 519 | if ( ! ad.mData->note.isEmpty() ) if (mData->note != ad.mData->note) return false ; |
520 | if ( ! ad.mData->title .isEmpty() ) if (mData->title != ad.mData->title ) return false ; | 520 | if ( ! ad.mData->title .isEmpty() ) if (mData->title != ad.mData->title ) return false ; |
521 | 521 | ||
522 | // compare phone numbers | 522 | // compare phone numbers |
523 | PhoneNumber::List phoneN = ad.phoneNumbers(); | 523 | PhoneNumber::List phoneN = ad.phoneNumbers(); |
524 | PhoneNumber::List::Iterator phoneIt; | 524 | PhoneNumber::List::Iterator phoneIt; |
525 | bool found = false; | 525 | bool found = false; |
526 | for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { | 526 | for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { |
527 | bool found = false; | 527 | bool found = false; |
528 | PhoneNumber::List phoneL = ad.phoneNumbers(); | 528 | PhoneNumber::List phoneL = ad.phoneNumbers(); |
529 | PhoneNumber::List::Iterator phoneItL; | 529 | PhoneNumber::List::Iterator phoneItL; |
530 | for ( phoneItL = phoneL.begin(); phoneItL != phoneL.end(); ++phoneItL ) { | 530 | for ( phoneItL = phoneL.begin(); phoneItL != phoneL.end(); ++phoneItL ) { |
531 | if ( ( *phoneItL ).number() == ( *phoneIt ).number() ) { | 531 | if ( ( *phoneItL ).number() == ( *phoneIt ).number() ) { |
532 | found = true; | 532 | found = true; |
533 | break; | 533 | break; |
534 | } | 534 | } |
535 | } | 535 | } |
536 | if ( ! found ) | 536 | if ( ! found ) |
537 | return false; | 537 | return false; |
538 | } | 538 | } |
539 | return true; | 539 | return true; |
540 | 540 | ||
541 | } | 541 | } |
542 | void Addressee::simplifyAddresses() | 542 | void Addressee::simplifyAddresses() |
543 | { | 543 | { |
544 | 544 | ||
545 | 545 | ||
546 | Address::List list; | 546 | Address::List list; |
547 | Address::List::Iterator it; | 547 | Address::List::Iterator it; |
548 | Address::List::Iterator it2; | 548 | Address::List::Iterator it2; |
549 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 549 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
550 | it2 = it; | 550 | it2 = it; |
551 | ++it2; | 551 | ++it2; |
552 | for( ; it2 != mData->addresses.end(); ++it2 ) { | 552 | for( ; it2 != mData->addresses.end(); ++it2 ) { |
553 | if ( (*it) == (*it2) ) { | 553 | if ( (*it) == (*it2) ) { |
554 | list.append( *it ); | 554 | list.append( *it ); |
555 | break; | 555 | break; |
556 | } | 556 | } |
557 | } | 557 | } |
558 | } | 558 | } |
559 | for( it = list.begin(); it != list.end(); ++it ) { | 559 | for( it = list.begin(); it != list.end(); ++it ) { |
560 | removeAddress( (*it) ); | 560 | removeAddress( (*it) ); |
561 | } | 561 | } |
562 | 562 | ||
563 | list.clear(); | 563 | list.clear(); |
564 | int max = 2; | 564 | int max = 2; |
565 | if ( mData->url.isValid() ) | 565 | if ( mData->url.isValid() ) |
566 | max = 1; | 566 | max = 1; |
567 | if ( mData->addresses.count() <= max ) return ; | 567 | if ( mData->addresses.count() <= max ) return ; |
568 | int count = 0; | 568 | int count = 0; |
569 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 569 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
570 | if ( count >= max ) | 570 | if ( count >= max ) |
571 | list.append( *it ); | 571 | list.append( *it ); |
572 | ++count; | 572 | ++count; |
573 | } | 573 | } |
574 | for( it = list.begin(); it != list.end(); ++it ) { | 574 | for( it = list.begin(); it != list.end(); ++it ) { |
575 | removeAddress( (*it) ); | 575 | removeAddress( (*it) ); |
576 | } | 576 | } |
577 | } | 577 | } |
578 | 578 | ||
579 | // removes all emails but the first | 579 | // removes all emails but the first |
580 | // needed by phone sync | 580 | // needed by phone sync |
581 | void Addressee::simplifyEmails() | 581 | void Addressee::simplifyEmails() |
582 | { | 582 | { |
583 | if ( mData->emails.count() == 0 ) return ; | 583 | if ( mData->emails.count() == 0 ) return ; |
584 | QString email = mData->emails.first(); | 584 | QString email = mData->emails.first(); |
585 | detach(); | 585 | detach(); |
586 | mData->emails.clear(); | 586 | mData->emails.clear(); |
587 | mData->emails.append( email ); | 587 | mData->emails.append( email ); |
588 | } | 588 | } |
589 | void Addressee::makePhoneNumbersOLcompatible() | 589 | void Addressee::makePhoneNumbersOLcompatible() |
590 | { | 590 | { |
591 | KABC::PhoneNumber::List::Iterator phoneIter; | 591 | KABC::PhoneNumber::List::Iterator phoneIter; |
592 | KABC::PhoneNumber::List::Iterator phoneIter2; | 592 | KABC::PhoneNumber::List::Iterator phoneIter2; |
593 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 593 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
594 | ++phoneIter ) { | 594 | ++phoneIter ) { |
595 | ( *phoneIter ).makeCompat(); | 595 | ( *phoneIter ).makeCompat(); |
596 | } | 596 | } |
597 | int hasHome = hasPhoneNumberType( PhoneNumber::Home | PhoneNumber::Pref ); | 597 | int hasHome = hasPhoneNumberType( PhoneNumber::Home | PhoneNumber::Pref ); |
598 | int hasHome2 = hasPhoneNumberType( PhoneNumber::Home ); | 598 | int hasHome2 = hasPhoneNumberType( PhoneNumber::Home ); |
599 | int hasWork = hasPhoneNumberType( PhoneNumber::Work | PhoneNumber::Pref ); | 599 | int hasWork = hasPhoneNumberType( PhoneNumber::Work | PhoneNumber::Pref ); |
600 | int hasWork2 = hasPhoneNumberType( PhoneNumber::Work ); | 600 | int hasWork2 = hasPhoneNumberType( PhoneNumber::Work ); |
601 | int hasCell = hasPhoneNumberType( PhoneNumber::Cell ); | 601 | int hasCell = hasPhoneNumberType( PhoneNumber::Cell ); |
602 | int hasCell2 = hasPhoneNumberType( PhoneNumber::Car ); | 602 | int hasCell2 = hasPhoneNumberType( PhoneNumber::Car ); |
603 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 603 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
604 | ++phoneIter ) { | 604 | ++phoneIter ) { |
605 | if ( (*phoneIter).type() == PhoneNumber::Home && ! hasHome ) { | 605 | if ( (*phoneIter).type() == PhoneNumber::Home && ! hasHome ) { |
606 | (*phoneIter).setType( PhoneNumber::Home | PhoneNumber::Pref ); | 606 | (*phoneIter).setType( PhoneNumber::Home | PhoneNumber::Pref ); |
607 | ++hasHome; | 607 | ++hasHome; |
608 | if ( hasHome2 ) --hasHome2; | 608 | if ( hasHome2 ) --hasHome2; |
609 | } else if ( ( (*phoneIter).type() == PhoneNumber::Home | PhoneNumber::Pref) && hasHome>1 && !hasHome2 ) { | 609 | } else if ( ( (*phoneIter).type() == PhoneNumber::Home | PhoneNumber::Pref) && hasHome>1 && !hasHome2 ) { |
610 | (*phoneIter).setType( PhoneNumber::Home ); | 610 | (*phoneIter).setType( PhoneNumber::Home ); |
611 | --hasHome; | 611 | --hasHome; |
612 | ++hasHome2; | 612 | ++hasHome2; |
613 | } else if ( (*phoneIter).type() == PhoneNumber::Work && ! hasWork ) { | 613 | } else if ( (*phoneIter).type() == PhoneNumber::Work && ! hasWork ) { |
614 | (*phoneIter).setType( PhoneNumber::Work | PhoneNumber::Pref ); | 614 | (*phoneIter).setType( PhoneNumber::Work | PhoneNumber::Pref ); |
615 | ++hasWork; | 615 | ++hasWork; |
616 | if ( hasWork2 ) --hasWork2; | 616 | if ( hasWork2 ) --hasWork2; |
617 | } else if ( ( (*phoneIter).type() == PhoneNumber::Work | PhoneNumber::Pref) && hasWork > 1 && ! hasWork2 ) { | 617 | } else if ( ( (*phoneIter).type() == PhoneNumber::Work | PhoneNumber::Pref) && hasWork > 1 && ! hasWork2 ) { |
618 | (*phoneIter).setType( PhoneNumber::Work ); | 618 | (*phoneIter).setType( PhoneNumber::Work ); |
619 | --hasWork; | 619 | --hasWork; |
620 | ++hasWork2; | 620 | ++hasWork2; |
621 | } else if ( (*phoneIter).type() == PhoneNumber::Cell && hasCell > 1 && !hasCell2) { | 621 | } else if ( (*phoneIter).type() == PhoneNumber::Cell && hasCell > 1 && !hasCell2) { |
622 | (*phoneIter).setType( PhoneNumber::Car ); | 622 | (*phoneIter).setType( PhoneNumber::Car ); |
623 | ++hasCell2; | 623 | ++hasCell2; |
624 | --hasCell; | 624 | --hasCell; |
625 | } else if ( (*phoneIter).type() == PhoneNumber::Car && hasCell2 > 1 && !hasCell) { | 625 | } else if ( (*phoneIter).type() == PhoneNumber::Car && hasCell2 > 1 && !hasCell) { |
626 | (*phoneIter).setType( PhoneNumber::Cell ); | 626 | (*phoneIter).setType( PhoneNumber::Cell ); |
627 | ++hasCell; | 627 | ++hasCell; |
628 | --hasCell2; | 628 | --hasCell2; |
629 | } else{ | 629 | } else{ |
630 | phoneIter2 = phoneIter; | 630 | phoneIter2 = phoneIter; |
631 | ++phoneIter2; | 631 | ++phoneIter2; |
632 | for ( ; phoneIter2 != mData->phoneNumbers.end(); | 632 | for ( ; phoneIter2 != mData->phoneNumbers.end(); |
633 | ++phoneIter2 ) { | 633 | ++phoneIter2 ) { |
634 | if ( (*phoneIter2).type() == (*phoneIter).type() ) { | 634 | if ( (*phoneIter2).type() == (*phoneIter).type() ) { |
635 | (*phoneIter2).setType( PhoneNumber::Voice ); | 635 | (*phoneIter2).setType( PhoneNumber::Voice ); |
636 | 636 | ||
637 | } | 637 | } |
638 | } | 638 | } |
639 | } | 639 | } |
640 | } | 640 | } |
641 | } | 641 | } |
642 | void Addressee::simplifyPhoneNumbers() | 642 | void Addressee::simplifyPhoneNumbers() |
643 | { | 643 | { |
644 | int max = 4; | 644 | int max = 4; |
645 | int inList = mData->phoneNumbers.count(); | 645 | int inList = mData->phoneNumbers.count(); |
646 | KABC::PhoneNumber::List removeNumbers; | 646 | KABC::PhoneNumber::List removeNumbers; |
647 | KABC::PhoneNumber::List::Iterator phoneIter; | 647 | KABC::PhoneNumber::List::Iterator phoneIter; |
648 | if ( inList > max ) { | 648 | if ( inList > max ) { |
649 | // delete non-preferred numbers | 649 | // delete non-preferred numbers |
650 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 650 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
651 | ++phoneIter ) { | 651 | ++phoneIter ) { |
652 | if ( inList > max ) { | 652 | if ( inList > max ) { |
653 | if ( ! (( *phoneIter ).type() & PhoneNumber::Pref )) { | 653 | if ( ! (( *phoneIter ).type() & PhoneNumber::Pref )) { |
654 | removeNumbers.append( ( *phoneIter ) ); | 654 | removeNumbers.append( ( *phoneIter ) ); |
655 | --inList; | 655 | --inList; |
656 | } | 656 | } |
657 | } else | 657 | } else |
658 | break; | 658 | break; |
659 | } | 659 | } |
660 | for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); | 660 | for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); |
661 | ++phoneIter ) { | 661 | ++phoneIter ) { |
662 | removePhoneNumber(( *phoneIter )); | 662 | removePhoneNumber(( *phoneIter )); |
663 | } | 663 | } |
664 | // delete preferred numbers | 664 | // delete preferred numbers |
665 | if ( inList > max ) { | 665 | if ( inList > max ) { |
666 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 666 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
667 | ++phoneIter ) { | 667 | ++phoneIter ) { |
668 | if ( inList > max ) { | 668 | if ( inList > max ) { |
669 | removeNumbers.append( ( *phoneIter ) ); | 669 | removeNumbers.append( ( *phoneIter ) ); |
670 | --inList; | 670 | --inList; |
671 | } else | 671 | } else |
672 | break; | 672 | break; |
673 | } | 673 | } |
674 | for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); | 674 | for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); |
675 | ++phoneIter ) { | 675 | ++phoneIter ) { |
676 | removePhoneNumber(( *phoneIter )); | 676 | removePhoneNumber(( *phoneIter )); |
677 | } | 677 | } |
678 | } | 678 | } |
679 | } | 679 | } |
680 | // remove non-numeric characters | 680 | // remove non-numeric characters |
681 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 681 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
682 | ++phoneIter ) { | 682 | ++phoneIter ) { |
683 | if ( ! ( *phoneIter ).simplifyNumber() ) | 683 | if ( ! ( *phoneIter ).simplifyNumber() ) |
684 | removeNumbers.append( ( *phoneIter ) ); | 684 | removeNumbers.append( ( *phoneIter ) ); |
685 | } | 685 | } |
686 | for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); | 686 | for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); |
687 | ++phoneIter ) { | 687 | ++phoneIter ) { |
688 | removePhoneNumber(( *phoneIter )); | 688 | removePhoneNumber(( *phoneIter )); |
689 | } | 689 | } |
690 | } | 690 | } |
691 | void Addressee::simplifyPhoneNumberTypes() | 691 | void Addressee::simplifyPhoneNumberTypes() |
692 | { | 692 | { |
693 | KABC::PhoneNumber::List::Iterator phoneIter; | 693 | KABC::PhoneNumber::List::Iterator phoneIter; |
694 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 694 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
695 | ++phoneIter ) | 695 | ++phoneIter ) |
696 | ( *phoneIter ).simplifyType(); | 696 | ( *phoneIter ).simplifyType(); |
697 | } | 697 | } |
698 | void Addressee::removeID(const QString &prof) | 698 | void Addressee::removeID(const QString &prof) |
699 | { | 699 | { |
700 | detach(); | 700 | detach(); |
701 | if ( prof.isEmpty() ) | 701 | if ( prof.isEmpty() ) |
702 | mData->mExternalId = ":"; | 702 | mData->mExternalId = ":"; |
703 | else | 703 | else |
704 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 704 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); |
705 | 705 | ||
706 | } | 706 | } |
707 | void Addressee::setID( const QString & prof , const QString & id ) | 707 | void Addressee::setID( const QString & prof , const QString & id ) |
708 | { | 708 | { |
709 | detach(); | 709 | detach(); |
710 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 710 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
711 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 711 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
712 | } | 712 | } |
713 | void Addressee::setTempSyncStat( int id ) | 713 | void Addressee::setTempSyncStat( int id ) |
714 | { | 714 | { |
715 | if ( mData->mTempSyncStat == id ) return; | 715 | if ( mData->mTempSyncStat == id ) return; |
716 | detach(); | 716 | detach(); |
717 | mData->mTempSyncStat = id; | 717 | mData->mTempSyncStat = id; |
718 | } | 718 | } |
719 | int Addressee::tempSyncStat() const | 719 | int Addressee::tempSyncStat() const |
720 | { | 720 | { |
721 | return mData->mTempSyncStat; | 721 | return mData->mTempSyncStat; |
722 | } | 722 | } |
723 | 723 | ||
724 | const QString Addressee::getID( const QString & prof) const | 724 | const QString Addressee::getID( const QString & prof) const |
725 | { | 725 | { |
726 | return KIdManager::getId ( mData->mExternalId, prof ); | 726 | return KIdManager::getId ( mData->mExternalId, prof ); |
727 | } | 727 | } |
728 | 728 | ||
729 | void Addressee::setCsum( const QString & prof , const QString & id ) | 729 | void Addressee::setCsum( const QString & prof , const QString & id ) |
730 | { | 730 | { |
731 | detach(); | 731 | detach(); |
732 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 732 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
733 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); | 733 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); |
734 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); | 734 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); |
735 | } | 735 | } |
736 | 736 | ||
737 | const QString Addressee::getCsum( const QString & prof) const | 737 | const QString Addressee::getCsum( const QString & prof) const |
738 | { | 738 | { |
739 | return KIdManager::getCsum ( mData->mExternalId, prof ); | 739 | return KIdManager::getCsum ( mData->mExternalId, prof ); |
740 | } | 740 | } |
741 | 741 | ||
742 | void Addressee::setIDStr( const QString & s ) | 742 | void Addressee::setIDStr( const QString & s ) |
743 | { | 743 | { |
744 | detach(); | 744 | detach(); |
745 | mData->mExternalId = s; | 745 | mData->mExternalId = s; |
746 | } | 746 | } |
747 | 747 | ||
748 | const QString Addressee::IDStr() const | 748 | const QString Addressee::IDStr() const |
749 | { | 749 | { |
750 | return mData->mExternalId; | 750 | return mData->mExternalId; |
751 | } | 751 | } |
752 | 752 | ||
753 | void Addressee::setExternalUID( const QString &id ) | 753 | void Addressee::setExternalUID( const QString &id ) |
754 | { | 754 | { |
755 | if ( id == mData->externalUID ) return; | 755 | if ( id == mData->externalUID ) return; |
756 | detach(); | 756 | detach(); |
757 | mData->empty = false; | 757 | mData->empty = false; |
758 | mData->externalUID = id; | 758 | mData->externalUID = id; |
759 | } | 759 | } |
760 | 760 | ||
761 | const QString Addressee::externalUID() const | 761 | const QString Addressee::externalUID() const |
762 | { | 762 | { |
763 | return mData->externalUID; | 763 | return mData->externalUID; |
764 | } | 764 | } |
765 | void Addressee::setOriginalExternalUID( const QString &id ) | 765 | void Addressee::setOriginalExternalUID( const QString &id ) |
766 | { | 766 | { |
767 | if ( id == mData->originalExternalUID ) return; | 767 | if ( id == mData->originalExternalUID ) return; |
768 | detach(); | 768 | detach(); |
769 | mData->empty = false; | 769 | mData->empty = false; |
770 | //qDebug("*******Set orig uid %s ", id.latin1()); | 770 | //qDebug("*******Set orig uid %s ", id.latin1()); |
771 | mData->originalExternalUID = id; | 771 | mData->originalExternalUID = id; |
772 | } | 772 | } |
773 | 773 | ||
774 | QString Addressee::originalExternalUID() const | 774 | QString Addressee::originalExternalUID() const |
775 | { | 775 | { |
776 | return mData->originalExternalUID; | 776 | return mData->originalExternalUID; |
777 | } | 777 | } |
778 | 778 | ||
779 | void Addressee::setUid( const QString &id ) | 779 | void Addressee::setUid( const QString &id ) |
780 | { | 780 | { |
781 | if ( id == mData->uid ) return; | 781 | if ( id == mData->uid ) return; |
782 | detach(); | 782 | detach(); |
783 | //qDebug("****setuid %s ", id.latin1()); | 783 | //qDebug("****setuid %s ", id.latin1()); |
784 | mData->empty = false; | 784 | mData->empty = false; |
785 | mData->uid = id; | 785 | mData->uid = id; |
786 | } | 786 | } |
787 | 787 | ||
788 | const QString Addressee::uid() const | 788 | const QString Addressee::uid() const |
789 | { | 789 | { |
790 | if ( mData->uid.isEmpty() ) | 790 | if ( mData->uid.isEmpty() ) |
791 | mData->uid = KApplication::randomString( 10 ); | 791 | mData->uid = KApplication::randomString( 10 ); |
792 | 792 | ||
793 | return mData->uid; | 793 | return mData->uid; |
794 | } | 794 | } |
795 | 795 | ||
796 | QString Addressee::uidLabel() | 796 | QString Addressee::uidLabel() |
797 | { | 797 | { |
798 | return i18n("Unique Identifier"); | 798 | return i18n("Unique Identifier"); |
799 | } | 799 | } |
800 | 800 | ||
801 | void Addressee::setName( const QString &name ) | 801 | void Addressee::setName( const QString &name ) |
802 | { | 802 | { |
803 | if ( name == mData->name ) return; | 803 | if ( name == mData->name ) return; |
804 | detach(); | 804 | detach(); |
805 | mData->empty = false; | 805 | mData->empty = false; |
806 | mData->name = name; | 806 | mData->name = name; |
807 | } | 807 | } |
808 | 808 | ||
809 | QString Addressee::name() const | 809 | QString Addressee::name() const |
810 | { | 810 | { |
811 | return mData->name; | 811 | return mData->name; |
812 | } | 812 | } |
813 | 813 | ||
814 | QString Addressee::nameLabel() | 814 | QString Addressee::nameLabel() |
815 | { | 815 | { |
816 | return i18n("Name"); | 816 | return i18n("Name"); |
817 | } | 817 | } |
818 | 818 | ||
819 | 819 | ||
820 | void Addressee::setFormattedName( const QString &formattedName ) | 820 | void Addressee::setFormattedName( const QString &formattedName ) |
821 | { | 821 | { |
822 | if ( formattedName == mData->formattedName ) return; | 822 | if ( formattedName == mData->formattedName ) return; |
823 | detach(); | 823 | detach(); |
824 | mData->empty = false; | 824 | mData->empty = false; |
825 | mData->formattedName = formattedName; | 825 | mData->formattedName = formattedName; |
826 | } | 826 | } |
827 | 827 | ||
828 | QString Addressee::formattedName() const | 828 | QString Addressee::formattedName() const |
829 | { | 829 | { |
830 | return mData->formattedName; | 830 | return mData->formattedName; |
831 | } | 831 | } |
832 | 832 | ||
833 | QString Addressee::formattedNameLabel() | 833 | QString Addressee::formattedNameLabel() |
834 | { | 834 | { |
835 | return i18n("Formatted Name"); | 835 | return i18n("Formatted Name"); |
836 | } | 836 | } |
837 | 837 | ||
838 | 838 | ||
839 | void Addressee::setFamilyName( const QString &familyName ) | 839 | void Addressee::setFamilyName( const QString &familyName ) |
840 | { | 840 | { |
841 | if ( familyName == mData->familyName ) return; | 841 | if ( familyName == mData->familyName ) return; |
842 | detach(); | 842 | detach(); |
843 | mData->empty = false; | 843 | mData->empty = false; |
844 | mData->familyName = familyName; | 844 | mData->familyName = familyName; |
845 | } | 845 | } |
846 | 846 | ||
847 | QString Addressee::familyName() const | 847 | QString Addressee::familyName() const |
848 | { | 848 | { |
849 | return mData->familyName; | 849 | return mData->familyName; |
850 | } | 850 | } |
851 | 851 | ||
852 | QString Addressee::familyNameLabel() | 852 | QString Addressee::familyNameLabel() |
853 | { | 853 | { |
854 | return i18n("Family Name"); | 854 | return i18n("Family Name"); |
855 | } | 855 | } |
856 | 856 | ||
857 | 857 | ||
858 | void Addressee::setGivenName( const QString &givenName ) | 858 | void Addressee::setGivenName( const QString &givenName ) |
859 | { | 859 | { |
860 | if ( givenName == mData->givenName ) return; | 860 | if ( givenName == mData->givenName ) return; |
861 | detach(); | 861 | detach(); |
862 | mData->empty = false; | 862 | mData->empty = false; |
863 | mData->givenName = givenName; | 863 | mData->givenName = givenName; |
864 | } | 864 | } |
865 | 865 | ||
866 | QString Addressee::givenName() const | 866 | QString Addressee::givenName() const |
867 | { | 867 | { |
868 | return mData->givenName; | 868 | return mData->givenName; |
869 | } | 869 | } |
870 | 870 | ||
871 | QString Addressee::givenNameLabel() | 871 | QString Addressee::givenNameLabel() |
872 | { | 872 | { |
873 | return i18n("Given Name"); | 873 | return i18n("Given Name"); |
874 | } | 874 | } |
875 | 875 | ||
876 | 876 | ||
877 | void Addressee::setAdditionalName( const QString &additionalName ) | 877 | void Addressee::setAdditionalName( const QString &additionalName ) |
878 | { | 878 | { |
879 | if ( additionalName == mData->additionalName ) return; | 879 | if ( additionalName == mData->additionalName ) return; |
880 | detach(); | 880 | detach(); |
881 | mData->empty = false; | 881 | mData->empty = false; |
882 | mData->additionalName = additionalName; | 882 | mData->additionalName = additionalName; |
883 | } | 883 | } |
884 | 884 | ||
885 | QString Addressee::additionalName() const | 885 | QString Addressee::additionalName() const |
886 | { | 886 | { |
887 | return mData->additionalName; | 887 | return mData->additionalName; |
888 | } | 888 | } |
889 | 889 | ||
890 | QString Addressee::additionalNameLabel() | 890 | QString Addressee::additionalNameLabel() |
891 | { | 891 | { |
892 | return i18n("Additional Names"); | 892 | return i18n("Additional Names"); |
893 | } | 893 | } |
894 | 894 | ||
895 | 895 | ||
896 | void Addressee::setPrefix( const QString &prefix ) | 896 | void Addressee::setPrefix( const QString &prefix ) |
897 | { | 897 | { |
898 | if ( prefix == mData->prefix ) return; | 898 | if ( prefix == mData->prefix ) return; |
899 | detach(); | 899 | detach(); |
900 | mData->empty = false; | 900 | mData->empty = false; |
901 | mData->prefix = prefix; | 901 | mData->prefix = prefix; |
902 | } | 902 | } |
903 | 903 | ||
904 | QString Addressee::prefix() const | 904 | QString Addressee::prefix() const |
905 | { | 905 | { |
906 | return mData->prefix; | 906 | return mData->prefix; |
907 | } | 907 | } |
908 | 908 | ||
909 | QString Addressee::prefixLabel() | 909 | QString Addressee::prefixLabel() |
910 | { | 910 | { |
911 | return i18n("Honorific Prefixes"); | 911 | return i18n("Honorific Prefixes"); |
912 | } | 912 | } |
913 | 913 | ||
914 | 914 | ||
915 | void Addressee::setSuffix( const QString &suffix ) | 915 | void Addressee::setSuffix( const QString &suffix ) |
916 | { | 916 | { |
917 | if ( suffix == mData->suffix ) return; | 917 | if ( suffix == mData->suffix ) return; |
918 | detach(); | 918 | detach(); |
919 | mData->empty = false; | 919 | mData->empty = false; |
920 | mData->suffix = suffix; | 920 | mData->suffix = suffix; |
921 | } | 921 | } |
922 | 922 | ||
923 | QString Addressee::suffix() const | 923 | QString Addressee::suffix() const |
924 | { | 924 | { |
925 | return mData->suffix; | 925 | return mData->suffix; |
926 | } | 926 | } |
927 | 927 | ||
928 | QString Addressee::suffixLabel() | 928 | QString Addressee::suffixLabel() |
929 | { | 929 | { |
930 | return i18n("Honorific Suffixes"); | 930 | return i18n("Honorific Suffixes"); |
931 | } | 931 | } |
932 | 932 | ||
933 | 933 | ||
934 | void Addressee::setNickName( const QString &nickName ) | 934 | void Addressee::setNickName( const QString &nickName ) |
935 | { | 935 | { |
936 | if ( nickName == mData->nickName ) return; | 936 | if ( nickName == mData->nickName ) return; |
937 | detach(); | 937 | detach(); |
938 | mData->empty = false; | 938 | mData->empty = false; |
939 | mData->nickName = nickName; | 939 | mData->nickName = nickName; |
940 | } | 940 | } |
941 | 941 | ||
942 | QString Addressee::nickName() const | 942 | QString Addressee::nickName() const |
943 | { | 943 | { |
944 | return mData->nickName; | 944 | return mData->nickName; |
945 | } | 945 | } |
946 | 946 | ||
947 | QString Addressee::nickNameLabel() | 947 | QString Addressee::nickNameLabel() |
948 | { | 948 | { |
949 | return i18n("Nick Name"); | 949 | return i18n("Nick Name"); |
950 | } | 950 | } |
951 | 951 | ||
952 | 952 | ||
953 | void Addressee::setBirthday( const QDateTime &birthday ) | 953 | void Addressee::setBirthday( const QDateTime &birthday ) |
954 | { | 954 | { |
955 | if ( birthday == mData->birthday ) return; | 955 | if ( birthday == mData->birthday ) return; |
956 | detach(); | 956 | detach(); |
957 | mData->empty = false; | 957 | mData->empty = false; |
958 | mData->birthday = birthday; | 958 | mData->birthday = birthday; |
959 | } | 959 | } |
960 | 960 | ||
961 | QDateTime Addressee::birthday() const | 961 | QDateTime Addressee::birthday() const |
962 | { | 962 | { |
963 | return mData->birthday; | 963 | return mData->birthday; |
964 | } | 964 | } |
965 | 965 | ||
966 | QString Addressee::birthdayLabel() | 966 | QString Addressee::birthdayLabel() |
967 | { | 967 | { |
968 | return i18n("Birthday"); | 968 | return i18n("Birthday"); |
969 | } | 969 | } |
970 | 970 | ||
971 | 971 | ||
972 | QString Addressee::homeAddressStreetLabel() | 972 | QString Addressee::homeAddressStreetLabel() |
973 | { | 973 | { |
974 | return i18n("Home Address Street"); | 974 | return i18n("Home Address Street"); |
975 | } | 975 | } |
976 | 976 | ||
977 | 977 | ||
978 | QString Addressee::homeAddressLocalityLabel() | 978 | QString Addressee::homeAddressLocalityLabel() |
979 | { | 979 | { |
980 | return i18n("Home Address Locality"); | 980 | return i18n("Home Address Locality"); |
981 | } | 981 | } |
982 | 982 | ||
983 | 983 | ||
984 | QString Addressee::homeAddressRegionLabel() | 984 | QString Addressee::homeAddressRegionLabel() |
985 | { | 985 | { |
986 | return i18n("Home Address Region"); | 986 | return i18n("Home Address Region"); |
987 | } | 987 | } |
988 | 988 | ||
989 | 989 | ||
990 | QString Addressee::homeAddressPostalCodeLabel() | 990 | QString Addressee::homeAddressPostalCodeLabel() |
991 | { | 991 | { |
992 | return i18n("Home Address Postal Code"); | 992 | return i18n("Home Address Postal Code"); |
993 | } | 993 | } |
994 | 994 | ||
995 | 995 | ||
996 | QString Addressee::homeAddressCountryLabel() | 996 | QString Addressee::homeAddressCountryLabel() |
997 | { | 997 | { |
998 | return i18n("Home Address Country"); | 998 | return i18n("Home Address Country"); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | QString Addressee::homeAddressLabelLabel() | 1002 | QString Addressee::homeAddressLabelLabel() |
1003 | { | 1003 | { |
1004 | return i18n("Home Address Label"); | 1004 | return i18n("Home Address Label"); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | 1007 | ||
1008 | QString Addressee::businessAddressStreetLabel() | 1008 | QString Addressee::businessAddressStreetLabel() |
1009 | { | 1009 | { |
1010 | return i18n("Business Address Street"); | 1010 | return i18n("Business Address Street"); |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | 1013 | ||
1014 | QString Addressee::businessAddressLocalityLabel() | 1014 | QString Addressee::businessAddressLocalityLabel() |
1015 | { | 1015 | { |
1016 | return i18n("Business Address Locality"); | 1016 | return i18n("Business Address Locality"); |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | 1019 | ||
1020 | QString Addressee::businessAddressRegionLabel() | 1020 | QString Addressee::businessAddressRegionLabel() |
1021 | { | 1021 | { |
1022 | return i18n("Business Address Region"); | 1022 | return i18n("Business Address Region"); |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | QString Addressee::businessAddressPostalCodeLabel() | 1026 | QString Addressee::businessAddressPostalCodeLabel() |
1027 | { | 1027 | { |
1028 | return i18n("Business Address Postal Code"); | 1028 | return i18n("Business Address Postal Code"); |
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | 1031 | ||
1032 | QString Addressee::businessAddressCountryLabel() | 1032 | QString Addressee::businessAddressCountryLabel() |
1033 | { | 1033 | { |
1034 | return i18n("Business Address Country"); | 1034 | return i18n("Business Address Country"); |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | 1037 | ||
1038 | QString Addressee::businessAddressLabelLabel() | 1038 | QString Addressee::businessAddressLabelLabel() |
1039 | { | 1039 | { |
1040 | return i18n("Business Address Label"); | 1040 | return i18n("Business Address Label"); |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | 1043 | ||
1044 | QString Addressee::homePhoneLabel() | 1044 | QString Addressee::homePhoneLabel() |
1045 | { | 1045 | { |
1046 | return i18n("Home Phone"); | 1046 | return i18n("Home Phone"); |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | 1049 | ||
1050 | QString Addressee::businessPhoneLabel() | 1050 | QString Addressee::businessPhoneLabel() |
1051 | { | 1051 | { |
1052 | return i18n("Work Phone"); | 1052 | return i18n("Work Phone"); |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | 1055 | ||
1056 | QString Addressee::mobilePhoneLabel() | 1056 | QString Addressee::mobilePhoneLabel() |
1057 | { | 1057 | { |
1058 | return i18n("Mobile Phone"); | 1058 | return i18n("Mobile"); |
1059 | } | 1059 | } |
1060 | QString Addressee::mobileWorkPhoneLabel() | 1060 | QString Addressee::mobileWorkPhoneLabel() |
1061 | { | 1061 | { |
1062 | return i18n("Mobile2 (Work)"); | 1062 | return i18n("Mobile2"); |
1063 | } | ||
1064 | QString Addressee::mobileHomePhoneLabel() | ||
1065 | { | ||
1066 | return i18n("Mobile (Home)"); | ||
1067 | } | 1063 | } |
1068 | 1064 | ||
1069 | 1065 | ||
1070 | QString Addressee::homeFaxLabel() | 1066 | QString Addressee::homeFaxLabel() |
1071 | { | 1067 | { |
1072 | return i18n("Fax (Home)"); | 1068 | return i18n("Fax (Home)"); |
1073 | } | 1069 | } |
1074 | 1070 | ||
1075 | 1071 | ||
1076 | QString Addressee::businessFaxLabel() | 1072 | QString Addressee::businessFaxLabel() |
1077 | { | 1073 | { |
1078 | return i18n("Fax (Work)"); | 1074 | return i18n("Fax (Work)"); |
1079 | } | 1075 | } |
1080 | 1076 | ||
1081 | 1077 | ||
1082 | QString Addressee::carPhoneLabel() | ||
1083 | { | ||
1084 | return i18n("Mobile2 (Car)"); | ||
1085 | } | ||
1086 | |||
1087 | |||
1088 | QString Addressee::isdnLabel() | 1078 | QString Addressee::isdnLabel() |
1089 | { | 1079 | { |
1090 | return i18n("ISDN"); | 1080 | return i18n("ISDN"); |
1091 | } | 1081 | } |
1092 | 1082 | ||
1093 | 1083 | ||
1094 | QString Addressee::pagerLabel() | 1084 | QString Addressee::pagerLabel() |
1095 | { | 1085 | { |
1096 | return i18n("Pager"); | 1086 | return i18n("Pager"); |
1097 | } | 1087 | } |
1098 | QString Addressee::otherPhoneLabel() | 1088 | QString Addressee::otherPhoneLabel() |
1099 | { | 1089 | { |
1100 | return i18n("Other Phone"); | 1090 | return i18n("Other Phone"); |
1101 | } | 1091 | } |
1102 | 1092 | ||
1103 | QString Addressee::sipLabel() | 1093 | QString Addressee::sipLabel() |
1104 | { | 1094 | { |
1105 | return i18n("SIP"); | 1095 | return i18n("SIP"); |
1106 | } | 1096 | } |
1107 | 1097 | ||
1108 | QString Addressee::emailLabel() | 1098 | QString Addressee::emailLabel() |
1109 | { | 1099 | { |
1110 | return i18n("Email Address"); | 1100 | return i18n("Email Address"); |
1111 | } | 1101 | } |
1112 | 1102 | ||
1113 | 1103 | ||
1114 | void Addressee::setMailer( const QString &mailer ) | 1104 | void Addressee::setMailer( const QString &mailer ) |
1115 | { | 1105 | { |
1116 | if ( mailer == mData->mailer ) return; | 1106 | if ( mailer == mData->mailer ) return; |
1117 | detach(); | 1107 | detach(); |
1118 | mData->empty = false; | 1108 | mData->empty = false; |
1119 | mData->mailer = mailer; | 1109 | mData->mailer = mailer; |
1120 | } | 1110 | } |
1121 | 1111 | ||
1122 | QString Addressee::mailer() const | 1112 | QString Addressee::mailer() const |
1123 | { | 1113 | { |
1124 | return mData->mailer; | 1114 | return mData->mailer; |
1125 | } | 1115 | } |
1126 | 1116 | ||
1127 | QString Addressee::mailerLabel() | 1117 | QString Addressee::mailerLabel() |
1128 | { | 1118 | { |
1129 | return i18n("Mail Client"); | 1119 | return i18n("Mail Client"); |
1130 | } | 1120 | } |
1131 | 1121 | ||
1132 | 1122 | ||
1133 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 1123 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
1134 | { | 1124 | { |
1135 | if ( timeZone == mData->timeZone ) return; | 1125 | if ( timeZone == mData->timeZone ) return; |
1136 | detach(); | 1126 | detach(); |
1137 | mData->empty = false; | 1127 | mData->empty = false; |
1138 | mData->timeZone = timeZone; | 1128 | mData->timeZone = timeZone; |
1139 | } | 1129 | } |
1140 | 1130 | ||
1141 | TimeZone Addressee::timeZone() const | 1131 | TimeZone Addressee::timeZone() const |
1142 | { | 1132 | { |
1143 | return mData->timeZone; | 1133 | return mData->timeZone; |
1144 | } | 1134 | } |
1145 | 1135 | ||
1146 | QString Addressee::timeZoneLabel() | 1136 | QString Addressee::timeZoneLabel() |
1147 | { | 1137 | { |
1148 | return i18n("Time Zone"); | 1138 | return i18n("Time Zone"); |
1149 | } | 1139 | } |
1150 | 1140 | ||
1151 | 1141 | ||
1152 | void Addressee::setGeo( const Geo &geo ) | 1142 | void Addressee::setGeo( const Geo &geo ) |
1153 | { | 1143 | { |
1154 | if ( geo == mData->geo ) return; | 1144 | if ( geo == mData->geo ) return; |
1155 | detach(); | 1145 | detach(); |
1156 | mData->empty = false; | 1146 | mData->empty = false; |
1157 | mData->geo = geo; | 1147 | mData->geo = geo; |
1158 | } | 1148 | } |
1159 | 1149 | ||
1160 | Geo Addressee::geo() const | 1150 | Geo Addressee::geo() const |
1161 | { | 1151 | { |
1162 | return mData->geo; | 1152 | return mData->geo; |
1163 | } | 1153 | } |
1164 | 1154 | ||
1165 | QString Addressee::geoLabel() | 1155 | QString Addressee::geoLabel() |
1166 | { | 1156 | { |
1167 | return i18n("Geographic Position"); | 1157 | return i18n("Geographic Position"); |
1168 | } | 1158 | } |
1169 | 1159 | ||
1170 | 1160 | ||
1171 | void Addressee::setTitle( const QString &title ) | 1161 | void Addressee::setTitle( const QString &title ) |
1172 | { | 1162 | { |
1173 | if ( title == mData->title ) return; | 1163 | if ( title == mData->title ) return; |
1174 | detach(); | 1164 | detach(); |
1175 | mData->empty = false; | 1165 | mData->empty = false; |
1176 | mData->title = title; | 1166 | mData->title = title; |
1177 | } | 1167 | } |
1178 | 1168 | ||
1179 | QString Addressee::title() const | 1169 | QString Addressee::title() const |
1180 | { | 1170 | { |
1181 | return mData->title; | 1171 | return mData->title; |
1182 | } | 1172 | } |
1183 | 1173 | ||
1184 | QString Addressee::titleLabel() | 1174 | QString Addressee::titleLabel() |
1185 | { | 1175 | { |
1186 | return i18n("Title"); | 1176 | return i18n("Title"); |
1187 | } | 1177 | } |
1188 | 1178 | ||
1189 | 1179 | ||
1190 | void Addressee::setRole( const QString &role ) | 1180 | void Addressee::setRole( const QString &role ) |
1191 | { | 1181 | { |
1192 | if ( role == mData->role ) return; | 1182 | if ( role == mData->role ) return; |
1193 | detach(); | 1183 | detach(); |
1194 | mData->empty = false; | 1184 | mData->empty = false; |
1195 | mData->role = role; | 1185 | mData->role = role; |
1196 | } | 1186 | } |
1197 | 1187 | ||
1198 | QString Addressee::role() const | 1188 | QString Addressee::role() const |
1199 | { | 1189 | { |
1200 | return mData->role; | 1190 | return mData->role; |
1201 | } | 1191 | } |
1202 | 1192 | ||
1203 | QString Addressee::roleLabel() | 1193 | QString Addressee::roleLabel() |
1204 | { | 1194 | { |
1205 | return i18n("Role"); | 1195 | return i18n("Role"); |
1206 | } | 1196 | } |
1207 | 1197 | ||
1208 | 1198 | ||
1209 | void Addressee::setOrganization( const QString &organization ) | 1199 | void Addressee::setOrganization( const QString &organization ) |
1210 | { | 1200 | { |
1211 | if ( organization == mData->organization ) return; | 1201 | if ( organization == mData->organization ) return; |
1212 | detach(); | 1202 | detach(); |
1213 | mData->empty = false; | 1203 | mData->empty = false; |
1214 | mData->organization = organization; | 1204 | mData->organization = organization; |
1215 | } | 1205 | } |
1216 | 1206 | ||
1217 | QString Addressee::organization() const | 1207 | QString Addressee::organization() const |
1218 | { | 1208 | { |
1219 | return mData->organization; | 1209 | return mData->organization; |
1220 | } | 1210 | } |
1221 | 1211 | ||
1222 | QString Addressee::organizationLabel() | 1212 | QString Addressee::organizationLabel() |
1223 | { | 1213 | { |
1224 | return i18n("Organization"); | 1214 | return i18n("Organization"); |
1225 | } | 1215 | } |
1226 | 1216 | ||
1227 | 1217 | ||
1228 | void Addressee::setNote( const QString ¬e ) | 1218 | void Addressee::setNote( const QString ¬e ) |
1229 | { | 1219 | { |
1230 | if ( note == mData->note ) return; | 1220 | if ( note == mData->note ) return; |
1231 | detach(); | 1221 | detach(); |
1232 | mData->empty = false; | 1222 | mData->empty = false; |
1233 | mData->note = note; | 1223 | mData->note = note; |
1234 | } | 1224 | } |
1235 | 1225 | ||
1236 | QString Addressee::note() const | 1226 | QString Addressee::note() const |
1237 | { | 1227 | { |
1238 | return mData->note; | 1228 | return mData->note; |
1239 | } | 1229 | } |
1240 | 1230 | ||
1241 | QString Addressee::noteLabel() | 1231 | QString Addressee::noteLabel() |
1242 | { | 1232 | { |
1243 | return i18n("Note"); | 1233 | return i18n("Note"); |
1244 | } | 1234 | } |
1245 | 1235 | ||
1246 | 1236 | ||
1247 | void Addressee::setProductId( const QString &productId ) | 1237 | void Addressee::setProductId( const QString &productId ) |
1248 | { | 1238 | { |
1249 | if ( productId == mData->productId ) return; | 1239 | if ( productId == mData->productId ) return; |
1250 | detach(); | 1240 | detach(); |
1251 | mData->empty = false; | 1241 | mData->empty = false; |
1252 | mData->productId = productId; | 1242 | mData->productId = productId; |
1253 | } | 1243 | } |
1254 | 1244 | ||
1255 | QString Addressee::productId() const | 1245 | QString Addressee::productId() const |
1256 | { | 1246 | { |
1257 | return mData->productId; | 1247 | return mData->productId; |
1258 | } | 1248 | } |
1259 | 1249 | ||
1260 | QString Addressee::productIdLabel() | 1250 | QString Addressee::productIdLabel() |
1261 | { | 1251 | { |
1262 | return i18n("Product Identifier"); | 1252 | return i18n("Product Identifier"); |
1263 | } | 1253 | } |
1264 | 1254 | ||
1265 | 1255 | ||
1266 | void Addressee::setRevision( const QDateTime &revision ) | 1256 | void Addressee::setRevision( const QDateTime &revision ) |
1267 | { | 1257 | { |
1268 | if ( revision == mData->revision ) return; | 1258 | if ( revision == mData->revision ) return; |
1269 | detach(); | 1259 | detach(); |
1270 | mData->empty = false; | 1260 | mData->empty = false; |
1271 | mData->revision = QDateTime( revision.date(), | 1261 | mData->revision = QDateTime( revision.date(), |
1272 | QTime (revision.time().hour(), | 1262 | QTime (revision.time().hour(), |
1273 | revision.time().minute(), | 1263 | revision.time().minute(), |
1274 | revision.time().second())); | 1264 | revision.time().second())); |
1275 | } | 1265 | } |
1276 | 1266 | ||
1277 | QDateTime Addressee::revision() const | 1267 | QDateTime Addressee::revision() const |
1278 | { | 1268 | { |
1279 | return mData->revision; | 1269 | return mData->revision; |
1280 | } | 1270 | } |
1281 | 1271 | ||
1282 | QString Addressee::revisionLabel() | 1272 | QString Addressee::revisionLabel() |
1283 | { | 1273 | { |
1284 | return i18n("Revision Date"); | 1274 | return i18n("Revision Date"); |
1285 | } | 1275 | } |
1286 | 1276 | ||
1287 | 1277 | ||
1288 | void Addressee::setSortString( const QString &sortString ) | 1278 | void Addressee::setSortString( const QString &sortString ) |
1289 | { | 1279 | { |
1290 | if ( sortString == mData->sortString ) return; | 1280 | if ( sortString == mData->sortString ) return; |
1291 | detach(); | 1281 | detach(); |
1292 | mData->empty = false; | 1282 | mData->empty = false; |
1293 | mData->sortString = sortString; | 1283 | mData->sortString = sortString; |
1294 | } | 1284 | } |
1295 | 1285 | ||
1296 | QString Addressee::sortString() const | 1286 | QString Addressee::sortString() const |
1297 | { | 1287 | { |
1298 | return mData->sortString; | 1288 | return mData->sortString; |
1299 | } | 1289 | } |
1300 | 1290 | ||
1301 | QString Addressee::sortStringLabel() | 1291 | QString Addressee::sortStringLabel() |
1302 | { | 1292 | { |
1303 | return i18n("Sort String"); | 1293 | return i18n("Sort String"); |
1304 | } | 1294 | } |
1305 | 1295 | ||
1306 | 1296 | ||
1307 | void Addressee::setUrl( const KURL &url ) | 1297 | void Addressee::setUrl( const KURL &url ) |
1308 | { | 1298 | { |
1309 | if ( url == mData->url ) return; | 1299 | if ( url == mData->url ) return; |
1310 | detach(); | 1300 | detach(); |
1311 | mData->empty = false; | 1301 | mData->empty = false; |
1312 | mData->url = url; | 1302 | mData->url = url; |
1313 | } | 1303 | } |
1314 | 1304 | ||
1315 | KURL Addressee::url() const | 1305 | KURL Addressee::url() const |
1316 | { | 1306 | { |
1317 | return mData->url; | 1307 | return mData->url; |
1318 | } | 1308 | } |
1319 | 1309 | ||
1320 | QString Addressee::urlLabel() | 1310 | QString Addressee::urlLabel() |
1321 | { | 1311 | { |
1322 | return i18n("URL"); | 1312 | return i18n("URL"); |
1323 | } | 1313 | } |
1324 | 1314 | ||
1325 | 1315 | ||
1326 | void Addressee::setSecrecy( const Secrecy &secrecy ) | 1316 | void Addressee::setSecrecy( const Secrecy &secrecy ) |
1327 | { | 1317 | { |
1328 | if ( secrecy == mData->secrecy ) return; | 1318 | if ( secrecy == mData->secrecy ) return; |
1329 | detach(); | 1319 | detach(); |
1330 | mData->empty = false; | 1320 | mData->empty = false; |
1331 | mData->secrecy = secrecy; | 1321 | mData->secrecy = secrecy; |
1332 | } | 1322 | } |
1333 | 1323 | ||
1334 | Secrecy Addressee::secrecy() const | 1324 | Secrecy Addressee::secrecy() const |
1335 | { | 1325 | { |
1336 | return mData->secrecy; | 1326 | return mData->secrecy; |
1337 | } | 1327 | } |
1338 | 1328 | ||
1339 | QString Addressee::secrecyLabel() | 1329 | QString Addressee::secrecyLabel() |
1340 | { | 1330 | { |
1341 | return i18n("Security Class"); | 1331 | return i18n("Security Class"); |
1342 | } | 1332 | } |
1343 | 1333 | ||
1344 | 1334 | ||
1345 | void Addressee::setLogo( const Picture &logo ) | 1335 | void Addressee::setLogo( const Picture &logo ) |
1346 | { | 1336 | { |
1347 | if ( logo == mData->logo ) return; | 1337 | if ( logo == mData->logo ) return; |
1348 | detach(); | 1338 | detach(); |
1349 | mData->empty = false; | 1339 | mData->empty = false; |
1350 | mData->logo = logo; | 1340 | mData->logo = logo; |
1351 | } | 1341 | } |
1352 | 1342 | ||
1353 | Picture Addressee::logo() const | 1343 | Picture Addressee::logo() const |
1354 | { | 1344 | { |
1355 | return mData->logo; | 1345 | return mData->logo; |
1356 | } | 1346 | } |
1357 | 1347 | ||
1358 | QString Addressee::logoLabel() | 1348 | QString Addressee::logoLabel() |
1359 | { | 1349 | { |
1360 | return i18n("Logo"); | 1350 | return i18n("Logo"); |
1361 | } | 1351 | } |
1362 | 1352 | ||
1363 | 1353 | ||
1364 | void Addressee::setPhoto( const Picture &photo ) | 1354 | void Addressee::setPhoto( const Picture &photo ) |
1365 | { | 1355 | { |
1366 | if ( photo == mData->photo ) return; | 1356 | if ( photo == mData->photo ) return; |
1367 | detach(); | 1357 | detach(); |
1368 | mData->empty = false; | 1358 | mData->empty = false; |
1369 | mData->photo = photo; | 1359 | mData->photo = photo; |
1370 | } | 1360 | } |
1371 | 1361 | ||
1372 | Picture Addressee::photo() const | 1362 | Picture Addressee::photo() const |
1373 | { | 1363 | { |
1374 | return mData->photo; | 1364 | return mData->photo; |
1375 | } | 1365 | } |
1376 | 1366 | ||
1377 | QString Addressee::photoLabel() | 1367 | QString Addressee::photoLabel() |
1378 | { | 1368 | { |
1379 | return i18n("Photo"); | 1369 | return i18n("Photo"); |
1380 | } | 1370 | } |
1381 | 1371 | ||
1382 | 1372 | ||
1383 | void Addressee::setSound( const Sound &sound ) | 1373 | void Addressee::setSound( const Sound &sound ) |
1384 | { | 1374 | { |
1385 | if ( sound == mData->sound ) return; | 1375 | if ( sound == mData->sound ) return; |
1386 | detach(); | 1376 | detach(); |
1387 | mData->empty = false; | 1377 | mData->empty = false; |
1388 | mData->sound = sound; | 1378 | mData->sound = sound; |
1389 | } | 1379 | } |
1390 | 1380 | ||
1391 | Sound Addressee::sound() const | 1381 | Sound Addressee::sound() const |
1392 | { | 1382 | { |
1393 | return mData->sound; | 1383 | return mData->sound; |
1394 | } | 1384 | } |
1395 | 1385 | ||
1396 | QString Addressee::soundLabel() | 1386 | QString Addressee::soundLabel() |
1397 | { | 1387 | { |
1398 | return i18n("Sound"); | 1388 | return i18n("Sound"); |
1399 | } | 1389 | } |
1400 | 1390 | ||
1401 | 1391 | ||
1402 | void Addressee::setAgent( const Agent &agent ) | 1392 | void Addressee::setAgent( const Agent &agent ) |
1403 | { | 1393 | { |
1404 | if ( agent == mData->agent ) return; | 1394 | if ( agent == mData->agent ) return; |
1405 | detach(); | 1395 | detach(); |
1406 | mData->empty = false; | 1396 | mData->empty = false; |
1407 | mData->agent = agent; | 1397 | mData->agent = agent; |
1408 | } | 1398 | } |
1409 | 1399 | ||
1410 | Agent Addressee::agent() const | 1400 | Agent Addressee::agent() const |
1411 | { | 1401 | { |
1412 | return mData->agent; | 1402 | return mData->agent; |
1413 | } | 1403 | } |
1414 | 1404 | ||
1415 | QString Addressee::agentLabel() | 1405 | QString Addressee::agentLabel() |
1416 | { | 1406 | { |
1417 | return i18n("Agent"); | 1407 | return i18n("Agent"); |
1418 | } | 1408 | } |
1419 | 1409 | ||
1420 | 1410 | ||
1421 | 1411 | ||
1422 | void Addressee::setNameFromString( const QString &str ) | 1412 | void Addressee::setNameFromString( const QString &str ) |
1423 | { | 1413 | { |
1424 | setFormattedName( str ); | 1414 | setFormattedName( str ); |
1425 | setName( str ); | 1415 | setName( str ); |
1426 | 1416 | ||
1427 | static bool first = true; | 1417 | static bool first = true; |
1428 | static QStringList titles; | 1418 | static QStringList titles; |
1429 | static QStringList suffixes; | 1419 | static QStringList suffixes; |
1430 | static QStringList prefixes; | 1420 | static QStringList prefixes; |
1431 | 1421 | ||
1432 | if ( first ) { | 1422 | if ( first ) { |
1433 | first = false; | 1423 | first = false; |
1434 | titles += i18n( "Dr." ); | 1424 | titles += i18n( "Dr." ); |
1435 | titles += i18n( "Miss" ); | 1425 | titles += i18n( "Miss" ); |
1436 | titles += i18n( "Mr." ); | 1426 | titles += i18n( "Mr." ); |
1437 | titles += i18n( "Mrs." ); | 1427 | titles += i18n( "Mrs." ); |
1438 | titles += i18n( "Ms." ); | 1428 | titles += i18n( "Ms." ); |
1439 | titles += i18n( "Prof." ); | 1429 | titles += i18n( "Prof." ); |
1440 | 1430 | ||
1441 | suffixes += i18n( "I" ); | 1431 | suffixes += i18n( "I" ); |
1442 | suffixes += i18n( "II" ); | 1432 | suffixes += i18n( "II" ); |
1443 | suffixes += i18n( "III" ); | 1433 | suffixes += i18n( "III" ); |
1444 | suffixes += i18n( "Jr." ); | 1434 | suffixes += i18n( "Jr." ); |
1445 | suffixes += i18n( "Sr." ); | 1435 | suffixes += i18n( "Sr." ); |
1446 | 1436 | ||
1447 | prefixes += "van"; | 1437 | prefixes += "van"; |
1448 | prefixes += "von"; | 1438 | prefixes += "von"; |
1449 | prefixes += "de"; | 1439 | prefixes += "de"; |
1450 | 1440 | ||
1451 | KConfig config( locateLocal( "config", "kabcrc") ); | 1441 | KConfig config( locateLocal( "config", "kabcrc") ); |
1452 | config.setGroup( "General" ); | 1442 | config.setGroup( "General" ); |
1453 | titles += config.readListEntry( "Prefixes" ); | 1443 | titles += config.readListEntry( "Prefixes" ); |
1454 | titles.remove( "" ); | 1444 | titles.remove( "" ); |
1455 | prefixes += config.readListEntry( "Inclusions" ); | 1445 | prefixes += config.readListEntry( "Inclusions" ); |
1456 | prefixes.remove( "" ); | 1446 | prefixes.remove( "" ); |
1457 | suffixes += config.readListEntry( "Suffixes" ); | 1447 | suffixes += config.readListEntry( "Suffixes" ); |
1458 | suffixes.remove( "" ); | 1448 | suffixes.remove( "" ); |
1459 | } | 1449 | } |
1460 | 1450 | ||
1461 | // clear all name parts | 1451 | // clear all name parts |
1462 | setPrefix( "" ); | 1452 | setPrefix( "" ); |
1463 | setGivenName( "" ); | 1453 | setGivenName( "" ); |
1464 | setAdditionalName( "" ); | 1454 | setAdditionalName( "" ); |
1465 | setFamilyName( "" ); | 1455 | setFamilyName( "" ); |
1466 | setSuffix( "" ); | 1456 | setSuffix( "" ); |
1467 | 1457 | ||
1468 | if ( str.isEmpty() ) | 1458 | if ( str.isEmpty() ) |
1469 | return; | 1459 | return; |
1470 | 1460 | ||
1471 | int i = str.find(','); | 1461 | int i = str.find(','); |
1472 | if( i < 0 ) { | 1462 | if( i < 0 ) { |
1473 | QStringList parts = QStringList::split( " ", str ); | 1463 | QStringList parts = QStringList::split( " ", str ); |
1474 | int leftOffset = 0; | 1464 | int leftOffset = 0; |
1475 | int rightOffset = parts.count() - 1; | 1465 | int rightOffset = parts.count() - 1; |
1476 | 1466 | ||
1477 | QString suffix; | 1467 | QString suffix; |
1478 | while ( rightOffset >= 0 ) { | 1468 | while ( rightOffset >= 0 ) { |
1479 | if ( suffixes.contains( parts[ rightOffset ] ) ) { | 1469 | if ( suffixes.contains( parts[ rightOffset ] ) ) { |
1480 | suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? "" : " ")); | 1470 | suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? "" : " ")); |
1481 | rightOffset--; | 1471 | rightOffset--; |
1482 | } else | 1472 | } else |
1483 | break; | 1473 | break; |
1484 | } | 1474 | } |
1485 | setSuffix( suffix ); | 1475 | setSuffix( suffix ); |
1486 | 1476 | ||
1487 | if ( rightOffset < 0 ) | 1477 | if ( rightOffset < 0 ) |
1488 | return; | 1478 | return; |
1489 | 1479 | ||
1490 | if ( rightOffset - 1 >= 0 && prefixes.contains( parts[ rightOffset - 1 ].lower() ) ) { | 1480 | if ( rightOffset - 1 >= 0 && prefixes.contains( parts[ rightOffset - 1 ].lower() ) ) { |
1491 | setFamilyName( parts[ rightOffset - 1 ] + " " + parts[ rightOffset ] ); | 1481 | setFamilyName( parts[ rightOffset - 1 ] + " " + parts[ rightOffset ] ); |
1492 | rightOffset--; | 1482 | rightOffset--; |
1493 | } else | 1483 | } else |
1494 | setFamilyName( parts[ rightOffset ] ); | 1484 | setFamilyName( parts[ rightOffset ] ); |
1495 | 1485 | ||
1496 | QString prefix; | 1486 | QString prefix; |
1497 | while ( leftOffset < rightOffset ) { | 1487 | while ( leftOffset < rightOffset ) { |
1498 | if ( titles.contains( parts[ leftOffset ] ) ) { | 1488 | if ( titles.contains( parts[ leftOffset ] ) ) { |
1499 | prefix.append( ( prefix.isEmpty() ? "" : " ") + parts[ leftOffset ] ); | 1489 | prefix.append( ( prefix.isEmpty() ? "" : " ") + parts[ leftOffset ] ); |
1500 | leftOffset++; | 1490 | leftOffset++; |
1501 | } else | 1491 | } else |
1502 | break; | 1492 | break; |
1503 | } | 1493 | } |
1504 | setPrefix( prefix ); | 1494 | setPrefix( prefix ); |
1505 | 1495 | ||
1506 | if ( leftOffset < rightOffset ) { | 1496 | if ( leftOffset < rightOffset ) { |
1507 | setGivenName( parts[ leftOffset ] ); | 1497 | setGivenName( parts[ leftOffset ] ); |
1508 | leftOffset++; | 1498 | leftOffset++; |
1509 | } | 1499 | } |
1510 | 1500 | ||
1511 | QString additionalName; | 1501 | QString additionalName; |
1512 | while ( leftOffset < rightOffset ) { | 1502 | while ( leftOffset < rightOffset ) { |
1513 | additionalName.append( ( additionalName.isEmpty() ? "" : " ") + parts[ leftOffset ] ); | 1503 | additionalName.append( ( additionalName.isEmpty() ? "" : " ") + parts[ leftOffset ] ); |
1514 | leftOffset++; | 1504 | leftOffset++; |
1515 | } | 1505 | } |
1516 | setAdditionalName( additionalName ); | 1506 | setAdditionalName( additionalName ); |
1517 | } else { | 1507 | } else { |
1518 | QString part1 = str.left( i ); | 1508 | QString part1 = str.left( i ); |
1519 | QString part2 = str.mid( i + 1 ); | 1509 | QString part2 = str.mid( i + 1 ); |
1520 | 1510 | ||
1521 | QStringList parts = QStringList::split( " ", part1 ); | 1511 | QStringList parts = QStringList::split( " ", part1 ); |
1522 | int leftOffset = 0; | 1512 | int leftOffset = 0; |
1523 | int rightOffset = parts.count() - 1; | 1513 | int rightOffset = parts.count() - 1; |
1524 | 1514 | ||
1525 | QString suffix; | 1515 | QString suffix; |
1526 | while ( rightOffset >= 0 ) { | 1516 | while ( rightOffset >= 0 ) { |
1527 | if ( suffixes.contains( parts[ rightOffset ] ) ) { | 1517 | if ( suffixes.contains( parts[ rightOffset ] ) ) { |
1528 | suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? "" : " ")); | 1518 | suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? "" : " ")); |
1529 | rightOffset--; | 1519 | rightOffset--; |
1530 | } else | 1520 | } else |
1531 | break; | 1521 | break; |
1532 | } | 1522 | } |
1533 | setSuffix( suffix ); | 1523 | setSuffix( suffix ); |
1534 | 1524 | ||
1535 | if ( rightOffset - 1 >= 0 && prefixes.contains( parts[ rightOffset - 1 ].lower() ) ) { | 1525 | if ( rightOffset - 1 >= 0 && prefixes.contains( parts[ rightOffset - 1 ].lower() ) ) { |
1536 | setFamilyName( parts[ rightOffset - 1 ] + " " + parts[ rightOffset ] ); | 1526 | setFamilyName( parts[ rightOffset - 1 ] + " " + parts[ rightOffset ] ); |
1537 | rightOffset--; | 1527 | rightOffset--; |
1538 | } else | 1528 | } else |
1539 | setFamilyName( parts[ rightOffset ] ); | 1529 | setFamilyName( parts[ rightOffset ] ); |
1540 | 1530 | ||
1541 | QString prefix; | 1531 | QString prefix; |
1542 | while ( leftOffset < rightOffset ) { | 1532 | while ( leftOffset < rightOffset ) { |
1543 | if ( titles.contains( parts[ leftOffset ] ) ) { | 1533 | if ( titles.contains( parts[ leftOffset ] ) ) { |
1544 | prefix.append( ( prefix.isEmpty() ? "" : " ") + parts[ leftOffset ] ); | 1534 | prefix.append( ( prefix.isEmpty() ? "" : " ") + parts[ leftOffset ] ); |
1545 | leftOffset++; | 1535 | leftOffset++; |
1546 | } else | 1536 | } else |
1547 | break; | 1537 | break; |
1548 | } | 1538 | } |
1549 | 1539 | ||
1550 | parts = QStringList::split( " ", part2 ); | 1540 | parts = QStringList::split( " ", part2 ); |
1551 | 1541 | ||
1552 | leftOffset = 0; | 1542 | leftOffset = 0; |
1553 | rightOffset = parts.count(); | 1543 | rightOffset = parts.count(); |
1554 | 1544 | ||
1555 | while ( leftOffset < rightOffset ) { | 1545 | while ( leftOffset < rightOffset ) { |
1556 | if ( titles.contains( parts[ leftOffset ] ) ) { | 1546 | if ( titles.contains( parts[ leftOffset ] ) ) { |
1557 | prefix.append( ( prefix.isEmpty() ? "" : " ") + parts[ leftOffset ] ); | 1547 | prefix.append( ( prefix.isEmpty() ? "" : " ") + parts[ leftOffset ] ); |
1558 | leftOffset++; | 1548 | leftOffset++; |
1559 | } else | 1549 | } else |
1560 | break; | 1550 | break; |
1561 | } | 1551 | } |
1562 | setPrefix( prefix ); | 1552 | setPrefix( prefix ); |
1563 | 1553 | ||
1564 | if ( leftOffset < rightOffset ) { | 1554 | if ( leftOffset < rightOffset ) { |
1565 | setGivenName( parts[ leftOffset ] ); | 1555 | setGivenName( parts[ leftOffset ] ); |
1566 | leftOffset++; | 1556 | leftOffset++; |
1567 | } | 1557 | } |
1568 | 1558 | ||
1569 | QString additionalName; | 1559 | QString additionalName; |
1570 | while ( leftOffset < rightOffset ) { | 1560 | while ( leftOffset < rightOffset ) { |
1571 | additionalName.append( ( additionalName.isEmpty() ? "" : " ") + parts[ leftOffset ] ); | 1561 | additionalName.append( ( additionalName.isEmpty() ? "" : " ") + parts[ leftOffset ] ); |
1572 | leftOffset++; | 1562 | leftOffset++; |
1573 | } | 1563 | } |
1574 | setAdditionalName( additionalName ); | 1564 | setAdditionalName( additionalName ); |
1575 | } | 1565 | } |
1576 | } | 1566 | } |
1577 | 1567 | ||
1578 | QString Addressee::realName() const | 1568 | QString Addressee::realName() const |
1579 | { | 1569 | { |
1580 | if ( !formattedName().isEmpty() ) | 1570 | if ( !formattedName().isEmpty() ) |
1581 | return formattedName(); | 1571 | return formattedName(); |
1582 | 1572 | ||
1583 | QString n = assembledName(); | 1573 | QString n = assembledName(); |
1584 | 1574 | ||
1585 | if ( n.isEmpty() ) | 1575 | if ( n.isEmpty() ) |
1586 | n = name(); | 1576 | n = name(); |
1587 | if ( n.isEmpty() ) | 1577 | if ( n.isEmpty() ) |
1588 | n = organization(); | 1578 | n = organization(); |
1589 | return n; | 1579 | return n; |
1590 | } | 1580 | } |
1591 | 1581 | ||
1592 | QString Addressee::assembledName() const | 1582 | QString Addressee::assembledName() const |
1593 | { | 1583 | { |
1594 | QString name = prefix() + " " + givenName() + " " + additionalName() + " " + | 1584 | QString name = prefix() + " " + givenName() + " " + additionalName() + " " + |
1595 | familyName() + " " + suffix(); | 1585 | familyName() + " " + suffix(); |
1596 | 1586 | ||
1597 | return name.simplifyWhiteSpace(); | 1587 | return name.simplifyWhiteSpace(); |
1598 | } | 1588 | } |
1599 | 1589 | ||
1600 | QString Addressee::fullEmail( const QString &email ) const | 1590 | QString Addressee::fullEmail( const QString &email ) const |
1601 | { | 1591 | { |
1602 | QString e; | 1592 | QString e; |
1603 | if ( email.isNull() ) { | 1593 | if ( email.isNull() ) { |
1604 | e = preferredEmail(); | 1594 | e = preferredEmail(); |
1605 | } else { | 1595 | } else { |
1606 | e = email; | 1596 | e = email; |
1607 | } | 1597 | } |
1608 | if ( e.isEmpty() ) return QString::null; | 1598 | if ( e.isEmpty() ) return QString::null; |
1609 | 1599 | ||
1610 | QString text; | 1600 | QString text; |
1611 | if ( realName().isEmpty() ) | 1601 | if ( realName().isEmpty() ) |
1612 | text = e; | 1602 | text = e; |
1613 | else | 1603 | else |
1614 | text = assembledName() + " <" + e + ">"; | 1604 | text = assembledName() + " <" + e + ">"; |
1615 | 1605 | ||
1616 | return text; | 1606 | return text; |
1617 | } | 1607 | } |
1618 | 1608 | ||
1619 | void Addressee::insertEmail( const QString &email, bool preferred ) | 1609 | void Addressee::insertEmail( const QString &email, bool preferred ) |
1620 | { | 1610 | { |
1621 | detach(); | 1611 | detach(); |
1622 | 1612 | ||
1623 | QStringList::Iterator it = mData->emails.find( email ); | 1613 | QStringList::Iterator it = mData->emails.find( email ); |
1624 | 1614 | ||
1625 | if ( it != mData->emails.end() ) { | 1615 | if ( it != mData->emails.end() ) { |
1626 | if ( !preferred || it == mData->emails.begin() ) return; | 1616 | if ( !preferred || it == mData->emails.begin() ) return; |
1627 | mData->emails.remove( it ); | 1617 | mData->emails.remove( it ); |
1628 | mData->emails.prepend( email ); | 1618 | mData->emails.prepend( email ); |
1629 | } else { | 1619 | } else { |
1630 | if ( preferred ) { | 1620 | if ( preferred ) { |
1631 | mData->emails.prepend( email ); | 1621 | mData->emails.prepend( email ); |
1632 | } else { | 1622 | } else { |
1633 | mData->emails.append( email ); | 1623 | mData->emails.append( email ); |
1634 | } | 1624 | } |
1635 | } | 1625 | } |
1636 | } | 1626 | } |
1637 | 1627 | ||
1638 | void Addressee::removeEmail( const QString &email ) | 1628 | void Addressee::removeEmail( const QString &email ) |
1639 | { | 1629 | { |
1640 | detach(); | 1630 | detach(); |
1641 | 1631 | ||
1642 | QStringList::Iterator it = mData->emails.find( email ); | 1632 | QStringList::Iterator it = mData->emails.find( email ); |
1643 | if ( it == mData->emails.end() ) return; | 1633 | if ( it == mData->emails.end() ) return; |
1644 | 1634 | ||
1645 | mData->emails.remove( it ); | 1635 | mData->emails.remove( it ); |
1646 | } | 1636 | } |
1647 | 1637 | ||
1648 | QString Addressee::preferredEmail() const | 1638 | QString Addressee::preferredEmail() const |
1649 | { | 1639 | { |
1650 | if ( mData->emails.count() == 0 ) return QString::null; | 1640 | if ( mData->emails.count() == 0 ) return QString::null; |
1651 | else return mData->emails.first(); | 1641 | else return mData->emails.first(); |
1652 | } | 1642 | } |
1653 | 1643 | ||
1654 | QStringList Addressee::emails() const | 1644 | QStringList Addressee::emails() const |
1655 | { | 1645 | { |
1656 | return mData->emails; | 1646 | return mData->emails; |
1657 | } | 1647 | } |
1658 | void Addressee::setEmails( const QStringList& emails ) { | 1648 | void Addressee::setEmails( const QStringList& emails ) { |
1659 | detach(); | 1649 | detach(); |
1660 | mData->emails = emails; | 1650 | mData->emails = emails; |
1661 | } | 1651 | } |
1662 | void Addressee::insertPhoneNumber( const PhoneNumber &phoneNumber ) | 1652 | void Addressee::insertPhoneNumber( const PhoneNumber &phoneNumber ) |
1663 | { | 1653 | { |
1664 | detach(); | 1654 | detach(); |
1665 | mData->empty = false; | 1655 | mData->empty = false; |
1666 | 1656 | ||
1667 | PhoneNumber::List::Iterator it; | 1657 | PhoneNumber::List::Iterator it; |
1668 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 1658 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
1669 | if ( (*it).id() == phoneNumber.id() ) { | 1659 | if ( (*it).id() == phoneNumber.id() ) { |
1670 | *it = phoneNumber; | 1660 | *it = phoneNumber; |
1671 | return; | 1661 | return; |
1672 | } | 1662 | } |
1673 | } | 1663 | } |
1674 | mData->phoneNumbers.append( phoneNumber ); | 1664 | mData->phoneNumbers.append( phoneNumber ); |
1675 | } | 1665 | } |
1676 | 1666 | ||
1677 | void Addressee::removePhoneNumber( const PhoneNumber &phoneNumber ) | 1667 | void Addressee::removePhoneNumber( const PhoneNumber &phoneNumber ) |
1678 | { | 1668 | { |
1679 | detach(); | 1669 | detach(); |
1680 | 1670 | ||
1681 | PhoneNumber::List::Iterator it; | 1671 | PhoneNumber::List::Iterator it; |
1682 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 1672 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
1683 | if ( (*it).id() == phoneNumber.id() ) { | 1673 | if ( (*it).id() == phoneNumber.id() ) { |
1684 | mData->phoneNumbers.remove( it ); | 1674 | mData->phoneNumbers.remove( it ); |
1685 | return; | 1675 | return; |
1686 | } | 1676 | } |
1687 | } | 1677 | } |
1688 | } | 1678 | } |
1689 | 1679 | ||
1690 | PhoneNumber Addressee::phoneNumber( int type ) const | 1680 | PhoneNumber Addressee::phoneNumber( int type ) const |
1691 | { | 1681 | { |
1692 | PhoneNumber phoneNumber( "", type ); | 1682 | PhoneNumber phoneNumber( "", type ); |
1693 | PhoneNumber::List::ConstIterator it; | 1683 | PhoneNumber::List::ConstIterator it; |
1694 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 1684 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
1695 | if ( matchBinaryPatternP( (*it).type(), type ) ) { | 1685 | if ( matchBinaryPatternP( (*it).type(), type ) ) { |
1696 | if ( (*it).type() & PhoneNumber::Pref ) | 1686 | if ( (*it).type() & PhoneNumber::Pref ) |
1697 | return (*it); | 1687 | return (*it); |
1698 | else if ( phoneNumber.number().isEmpty() ) | 1688 | else if ( phoneNumber.number().isEmpty() ) |
1699 | phoneNumber = (*it); | 1689 | phoneNumber = (*it); |
1700 | } | 1690 | } |
1701 | } | 1691 | } |
1702 | 1692 | ||
1703 | return phoneNumber; | 1693 | return phoneNumber; |
1704 | } | 1694 | } |
1705 | 1695 | ||
1706 | PhoneNumber::List Addressee::phoneNumbers() const | 1696 | PhoneNumber::List Addressee::phoneNumbers() const |
1707 | { | 1697 | { |
1708 | return mData->phoneNumbers; | 1698 | return mData->phoneNumbers; |
1709 | } | 1699 | } |
1710 | 1700 | ||
1711 | int Addressee::hasPhoneNumberType( int type ) | 1701 | int Addressee::hasPhoneNumberType( int type ) |
1712 | { | 1702 | { |
1713 | int retval = 0; | 1703 | int retval = 0; |
1714 | PhoneNumber::List::ConstIterator it; | 1704 | PhoneNumber::List::ConstIterator it; |
1715 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 1705 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
1716 | if ( (*it).type() == type ) | 1706 | if ( (*it).type() == type ) |
1717 | ++retval; | 1707 | ++retval; |
1718 | } | 1708 | } |
1719 | return retval; | 1709 | return retval; |
1720 | } | 1710 | } |
1721 | PhoneNumber::List Addressee::phoneNumbers( int type ) const | 1711 | PhoneNumber::List Addressee::phoneNumbers( int type ) const |
1722 | { | 1712 | { |
1723 | PhoneNumber::List list; | 1713 | PhoneNumber::List list; |
1724 | 1714 | ||
1725 | PhoneNumber::List::ConstIterator it; | 1715 | PhoneNumber::List::ConstIterator it; |
1726 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 1716 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
1727 | if ( matchBinaryPattern( (*it).type(), type ) ) { | 1717 | if ( matchBinaryPattern( (*it).type(), type ) ) { |
1728 | list.append( *it ); | 1718 | list.append( *it ); |
1729 | } | 1719 | } |
1730 | } | 1720 | } |
1731 | return list; | 1721 | return list; |
1732 | } | 1722 | } |
1733 | 1723 | ||
1734 | PhoneNumber Addressee::findPhoneNumber( const QString &id ) const | 1724 | PhoneNumber Addressee::findPhoneNumber( const QString &id ) const |
1735 | { | 1725 | { |
1736 | PhoneNumber::List::ConstIterator it; | 1726 | PhoneNumber::List::ConstIterator it; |
1737 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { | 1727 | for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { |
1738 | if ( (*it).id() == id ) { | 1728 | if ( (*it).id() == id ) { |
1739 | return *it; | 1729 | return *it; |
1740 | } | 1730 | } |
1741 | } | 1731 | } |
1742 | return PhoneNumber(); | 1732 | return PhoneNumber(); |
1743 | } | 1733 | } |
1744 | 1734 | ||
1745 | void Addressee::insertKey( const Key &key ) | 1735 | void Addressee::insertKey( const Key &key ) |
1746 | { | 1736 | { |
1747 | detach(); | 1737 | detach(); |
1748 | mData->empty = false; | 1738 | mData->empty = false; |
1749 | 1739 | ||
1750 | Key::List::Iterator it; | 1740 | Key::List::Iterator it; |
1751 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { | 1741 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { |
1752 | if ( (*it).id() == key.id() ) { | 1742 | if ( (*it).id() == key.id() ) { |
1753 | *it = key; | 1743 | *it = key; |
1754 | return; | 1744 | return; |
1755 | } | 1745 | } |
1756 | } | 1746 | } |
1757 | mData->keys.append( key ); | 1747 | mData->keys.append( key ); |
1758 | } | 1748 | } |
1759 | 1749 | ||
1760 | void Addressee::removeKey( const Key &key ) | 1750 | void Addressee::removeKey( const Key &key ) |
1761 | { | 1751 | { |
1762 | detach(); | 1752 | detach(); |
1763 | 1753 | ||
1764 | Key::List::Iterator it; | 1754 | Key::List::Iterator it; |
1765 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { | 1755 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { |
1766 | if ( (*it).id() == key.id() ) { | 1756 | if ( (*it).id() == key.id() ) { |
1767 | mData->keys.remove( key ); | 1757 | mData->keys.remove( key ); |
1768 | return; | 1758 | return; |
1769 | } | 1759 | } |
1770 | } | 1760 | } |
1771 | } | 1761 | } |
1772 | 1762 | ||
1773 | Key Addressee::key( int type, QString customTypeString ) const | 1763 | Key Addressee::key( int type, QString customTypeString ) const |
1774 | { | 1764 | { |
1775 | Key::List::ConstIterator it; | 1765 | Key::List::ConstIterator it; |
1776 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { | 1766 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { |
1777 | if ( (*it).type() == type ) { | 1767 | if ( (*it).type() == type ) { |
1778 | if ( type == Key::Custom ) { | 1768 | if ( type == Key::Custom ) { |
1779 | if ( customTypeString.isEmpty() ) { | 1769 | if ( customTypeString.isEmpty() ) { |
1780 | return *it; | 1770 | return *it; |
1781 | } else { | 1771 | } else { |
1782 | if ( (*it).customTypeString() == customTypeString ) | 1772 | if ( (*it).customTypeString() == customTypeString ) |
1783 | return (*it); | 1773 | return (*it); |
1784 | } | 1774 | } |
1785 | } else { | 1775 | } else { |
1786 | return *it; | 1776 | return *it; |
1787 | } | 1777 | } |
1788 | } | 1778 | } |
1789 | } | 1779 | } |
1790 | return Key( QString(), type ); | 1780 | return Key( QString(), type ); |
1791 | } | 1781 | } |
1792 | void Addressee::setKeys( const Key::List& list ) { | 1782 | void Addressee::setKeys( const Key::List& list ) { |
1793 | detach(); | 1783 | detach(); |
1794 | mData->keys = list; | 1784 | mData->keys = list; |
1795 | } | 1785 | } |
1796 | 1786 | ||
1797 | Key::List Addressee::keys() const | 1787 | Key::List Addressee::keys() const |
1798 | { | 1788 | { |
1799 | return mData->keys; | 1789 | return mData->keys; |
1800 | } | 1790 | } |
1801 | 1791 | ||
1802 | Key::List Addressee::keys( int type, QString customTypeString ) const | 1792 | Key::List Addressee::keys( int type, QString customTypeString ) const |
1803 | { | 1793 | { |
1804 | Key::List list; | 1794 | Key::List list; |
1805 | 1795 | ||
1806 | Key::List::ConstIterator it; | 1796 | Key::List::ConstIterator it; |
1807 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { | 1797 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { |
1808 | if ( (*it).type() == type ) { | 1798 | if ( (*it).type() == type ) { |
1809 | if ( type == Key::Custom ) { | 1799 | if ( type == Key::Custom ) { |
1810 | if ( customTypeString.isEmpty() ) { | 1800 | if ( customTypeString.isEmpty() ) { |
1811 | list.append(*it); | 1801 | list.append(*it); |
1812 | } else { | 1802 | } else { |
1813 | if ( (*it).customTypeString() == customTypeString ) | 1803 | if ( (*it).customTypeString() == customTypeString ) |
1814 | list.append(*it); | 1804 | list.append(*it); |
1815 | } | 1805 | } |
1816 | } else { | 1806 | } else { |
1817 | list.append(*it); | 1807 | list.append(*it); |
1818 | } | 1808 | } |
1819 | } | 1809 | } |
1820 | } | 1810 | } |
1821 | return list; | 1811 | return list; |
1822 | } | 1812 | } |
1823 | 1813 | ||
1824 | Key Addressee::findKey( const QString &id ) const | 1814 | Key Addressee::findKey( const QString &id ) const |
1825 | { | 1815 | { |
1826 | Key::List::ConstIterator it; | 1816 | Key::List::ConstIterator it; |
1827 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { | 1817 | for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { |
1828 | if ( (*it).id() == id ) { | 1818 | if ( (*it).id() == id ) { |
1829 | return *it; | 1819 | return *it; |
1830 | } | 1820 | } |
1831 | } | 1821 | } |
1832 | return Key(); | 1822 | return Key(); |
1833 | } | 1823 | } |
1834 | 1824 | ||
1835 | QString Addressee::asString() const | 1825 | QString Addressee::asString() const |
1836 | { | 1826 | { |
1837 | return "Smith, agent Smith..."; | 1827 | return "Smith, agent Smith..."; |
1838 | } | 1828 | } |
1839 | 1829 | ||
1840 | void Addressee::dump() const | 1830 | void Addressee::dump() const |
1841 | { | 1831 | { |
1842 | return; | 1832 | return; |
1843 | #if 0 | 1833 | #if 0 |
1844 | kdDebug(5700) << "Addressee {" << endl; | 1834 | kdDebug(5700) << "Addressee {" << endl; |
1845 | 1835 | ||
1846 | kdDebug(5700) << " Uid: '" << uid() << "'" << endl; | 1836 | kdDebug(5700) << " Uid: '" << uid() << "'" << endl; |
1847 | 1837 | ||
1848 | kdDebug(5700) << " Name: '" << name() << "'" << endl; | 1838 | kdDebug(5700) << " Name: '" << name() << "'" << endl; |
1849 | kdDebug(5700) << " FormattedName: '" << formattedName() << "'" << endl; | 1839 | kdDebug(5700) << " FormattedName: '" << formattedName() << "'" << endl; |
1850 | kdDebug(5700) << " FamilyName: '" << familyName() << "'" << endl; | 1840 | kdDebug(5700) << " FamilyName: '" << familyName() << "'" << endl; |
1851 | kdDebug(5700) << " GivenName: '" << givenName() << "'" << endl; | 1841 | kdDebug(5700) << " GivenName: '" << givenName() << "'" << endl; |
1852 | kdDebug(5700) << " AdditionalName: '" << additionalName() << "'" << endl; | 1842 | kdDebug(5700) << " AdditionalName: '" << additionalName() << "'" << endl; |
1853 | kdDebug(5700) << " Prefix: '" << prefix() << "'" << endl; | 1843 | kdDebug(5700) << " Prefix: '" << prefix() << "'" << endl; |
1854 | kdDebug(5700) << " Suffix: '" << suffix() << "'" << endl; | 1844 | kdDebug(5700) << " Suffix: '" << suffix() << "'" << endl; |
1855 | kdDebug(5700) << " NickName: '" << nickName() << "'" << endl; | 1845 | kdDebug(5700) << " NickName: '" << nickName() << "'" << endl; |
1856 | kdDebug(5700) << " Birthday: '" << birthday().toString() << "'" << endl; | 1846 | kdDebug(5700) << " Birthday: '" << birthday().toString() << "'" << endl; |
1857 | kdDebug(5700) << " Mailer: '" << mailer() << "'" << endl; | 1847 | kdDebug(5700) << " Mailer: '" << mailer() << "'" << endl; |
1858 | kdDebug(5700) << " TimeZone: '" << timeZone().asString() << "'" << endl; | 1848 | kdDebug(5700) << " TimeZone: '" << timeZone().asString() << "'" << endl; |
1859 | kdDebug(5700) << " Geo: '" << geo().asString() << "'" << endl; | 1849 | kdDebug(5700) << " Geo: '" << geo().asString() << "'" << endl; |
1860 | kdDebug(5700) << " Title: '" << title() << "'" << endl; | 1850 | kdDebug(5700) << " Title: '" << title() << "'" << endl; |
1861 | kdDebug(5700) << " Role: '" << role() << "'" << endl; | 1851 | kdDebug(5700) << " Role: '" << role() << "'" << endl; |
1862 | kdDebug(5700) << " Organization: '" << organization() << "'" << endl; | 1852 | kdDebug(5700) << " Organization: '" << organization() << "'" << endl; |
1863 | kdDebug(5700) << " Note: '" << note() << "'" << endl; | 1853 | kdDebug(5700) << " Note: '" << note() << "'" << endl; |
1864 | kdDebug(5700) << " ProductId: '" << productId() << "'" << endl; | 1854 | kdDebug(5700) << " ProductId: '" << productId() << "'" << endl; |
1865 | kdDebug(5700) << " Revision: '" << revision().toString() << "'" << endl; | 1855 | kdDebug(5700) << " Revision: '" << revision().toString() << "'" << endl; |
1866 | kdDebug(5700) << " SortString: '" << sortString() << "'" << endl; | 1856 | kdDebug(5700) << " SortString: '" << sortString() << "'" << endl; |
1867 | kdDebug(5700) << " Url: '" << url().url() << "'" << endl; | 1857 | kdDebug(5700) << " Url: '" << url().url() << "'" << endl; |
1868 | kdDebug(5700) << " Secrecy: '" << secrecy().asString() << "'" << endl; | 1858 | kdDebug(5700) << " Secrecy: '" << secrecy().asString() << "'" << endl; |
1869 | kdDebug(5700) << " Logo: '" << logo().asString() << "'" << endl; | 1859 | kdDebug(5700) << " Logo: '" << logo().asString() << "'" << endl; |
1870 | kdDebug(5700) << " Photo: '" << photo().asString() << "'" << endl; | 1860 | kdDebug(5700) << " Photo: '" << photo().asString() << "'" << endl; |
1871 | kdDebug(5700) << " Sound: '" << sound().asString() << "'" << endl; | 1861 | kdDebug(5700) << " Sound: '" << sound().asString() << "'" << endl; |
1872 | kdDebug(5700) << " Agent: '" << agent().asString() << "'" << endl; | 1862 | kdDebug(5700) << " Agent: '" << agent().asString() << "'" << endl; |
1873 | 1863 | ||
1874 | kdDebug(5700) << " Emails {" << endl; | 1864 | kdDebug(5700) << " Emails {" << endl; |
1875 | QStringList e = emails(); | 1865 | QStringList e = emails(); |
1876 | QStringList::ConstIterator it; | 1866 | QStringList::ConstIterator it; |
1877 | for( it = e.begin(); it != e.end(); ++it ) { | 1867 | for( it = e.begin(); it != e.end(); ++it ) { |
1878 | kdDebug(5700) << " " << (*it) << endl; | 1868 | kdDebug(5700) << " " << (*it) << endl; |
1879 | } | 1869 | } |
1880 | kdDebug(5700) << " }" << endl; | 1870 | kdDebug(5700) << " }" << endl; |
1881 | 1871 | ||
1882 | kdDebug(5700) << " PhoneNumbers {" << endl; | 1872 | kdDebug(5700) << " PhoneNumbers {" << endl; |
1883 | PhoneNumber::List p = phoneNumbers(); | 1873 | PhoneNumber::List p = phoneNumbers(); |
1884 | PhoneNumber::List::ConstIterator it2; | 1874 | PhoneNumber::List::ConstIterator it2; |
1885 | for( it2 = p.begin(); it2 != p.end(); ++it2 ) { | 1875 | for( it2 = p.begin(); it2 != p.end(); ++it2 ) { |
1886 | kdDebug(5700) << " Type: " << int((*it2).type()) << " Number: " << (*it2).number() << endl; | 1876 | kdDebug(5700) << " Type: " << int((*it2).type()) << " Number: " << (*it2).number() << endl; |
1887 | } | 1877 | } |
1888 | kdDebug(5700) << " }" << endl; | 1878 | kdDebug(5700) << " }" << endl; |
1889 | 1879 | ||
1890 | Address::List a = addresses(); | 1880 | Address::List a = addresses(); |
1891 | Address::List::ConstIterator it3; | 1881 | Address::List::ConstIterator it3; |
1892 | for( it3 = a.begin(); it3 != a.end(); ++it3 ) { | 1882 | for( it3 = a.begin(); it3 != a.end(); ++it3 ) { |
1893 | (*it3).dump(); | 1883 | (*it3).dump(); |
1894 | } | 1884 | } |
1895 | 1885 | ||
1896 | kdDebug(5700) << " Keys {" << endl; | 1886 | kdDebug(5700) << " Keys {" << endl; |
1897 | Key::List k = keys(); | 1887 | Key::List k = keys(); |
1898 | Key::List::ConstIterator it4; | 1888 | Key::List::ConstIterator it4; |
1899 | for( it4 = k.begin(); it4 != k.end(); ++it4 ) { | 1889 | for( it4 = k.begin(); it4 != k.end(); ++it4 ) { |
1900 | kdDebug(5700) << " Type: " << int((*it4).type()) << | 1890 | kdDebug(5700) << " Type: " << int((*it4).type()) << |
1901 | " Key: " << (*it4).textData() << | 1891 | " Key: " << (*it4).textData() << |
1902 | " CustomString: " << (*it4).customTypeString() << endl; | 1892 | " CustomString: " << (*it4).customTypeString() << endl; |
1903 | } | 1893 | } |
1904 | kdDebug(5700) << " }" << endl; | 1894 | kdDebug(5700) << " }" << endl; |
1905 | 1895 | ||
1906 | kdDebug(5700) << "}" << endl; | 1896 | kdDebug(5700) << "}" << endl; |
1907 | #endif | 1897 | #endif |
1908 | } | 1898 | } |
1909 | 1899 | ||
1910 | 1900 | ||
1911 | void Addressee::insertAddress( const Address &address ) | 1901 | void Addressee::insertAddress( const Address &address ) |
1912 | { | 1902 | { |
1913 | detach(); | 1903 | detach(); |
1914 | mData->empty = false; | 1904 | mData->empty = false; |
1915 | 1905 | ||
1916 | Address::List::Iterator it; | 1906 | Address::List::Iterator it; |
1917 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 1907 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
1918 | if ( (*it).id() == address.id() ) { | 1908 | if ( (*it).id() == address.id() ) { |
1919 | *it = address; | 1909 | *it = address; |
1920 | return; | 1910 | return; |
1921 | } | 1911 | } |
1922 | } | 1912 | } |
1923 | mData->addresses.append( address ); | 1913 | mData->addresses.append( address ); |
1924 | } | 1914 | } |
1925 | 1915 | ||
1926 | void Addressee::removeAddress( const Address &address ) | 1916 | void Addressee::removeAddress( const Address &address ) |
1927 | { | 1917 | { |
1928 | detach(); | 1918 | detach(); |
1929 | 1919 | ||
1930 | Address::List::Iterator it; | 1920 | Address::List::Iterator it; |
1931 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 1921 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
1932 | if ( (*it).id() == address.id() ) { | 1922 | if ( (*it).id() == address.id() ) { |
1933 | mData->addresses.remove( it ); | 1923 | mData->addresses.remove( it ); |
1934 | return; | 1924 | return; |
1935 | } | 1925 | } |
1936 | } | 1926 | } |
1937 | } | 1927 | } |
1938 | 1928 | ||
1939 | Address Addressee::address( int type ) const | 1929 | Address Addressee::address( int type ) const |
1940 | { | 1930 | { |
1941 | Address address( type ); | 1931 | Address address( type ); |
1942 | Address::List::ConstIterator it; | 1932 | Address::List::ConstIterator it; |
1943 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 1933 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
1944 | if ( matchBinaryPatternA( (*it).type(), type ) ) { | 1934 | if ( matchBinaryPatternA( (*it).type(), type ) ) { |
1945 | if ( (*it).type() & Address::Pref ) | 1935 | if ( (*it).type() & Address::Pref ) |
1946 | return (*it); | 1936 | return (*it); |
1947 | else if ( address.isEmpty() ) | 1937 | else if ( address.isEmpty() ) |
1948 | address = (*it); | 1938 | address = (*it); |
1949 | } | 1939 | } |
1950 | } | 1940 | } |
1951 | 1941 | ||
1952 | return address; | 1942 | return address; |
1953 | } | 1943 | } |
1954 | 1944 | ||
1955 | Address::List Addressee::addresses() const | 1945 | Address::List Addressee::addresses() const |
1956 | { | 1946 | { |
1957 | return mData->addresses; | 1947 | return mData->addresses; |
1958 | } | 1948 | } |
1959 | 1949 | ||
1960 | Address::List Addressee::addresses( int type ) const | 1950 | Address::List Addressee::addresses( int type ) const |
1961 | { | 1951 | { |
1962 | Address::List list; | 1952 | Address::List list; |
1963 | 1953 | ||
1964 | Address::List::ConstIterator it; | 1954 | Address::List::ConstIterator it; |
1965 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 1955 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
1966 | if ( matchBinaryPattern( (*it).type(), type ) ) { | 1956 | if ( matchBinaryPattern( (*it).type(), type ) ) { |
1967 | list.append( *it ); | 1957 | list.append( *it ); |
1968 | } | 1958 | } |
1969 | } | 1959 | } |
1970 | 1960 | ||
1971 | return list; | 1961 | return list; |
1972 | } | 1962 | } |
1973 | 1963 | ||
1974 | Address Addressee::findAddress( const QString &id ) const | 1964 | Address Addressee::findAddress( const QString &id ) const |
1975 | { | 1965 | { |
1976 | Address::List::ConstIterator it; | 1966 | Address::List::ConstIterator it; |
1977 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 1967 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
1978 | if ( (*it).id() == id ) { | 1968 | if ( (*it).id() == id ) { |
1979 | return *it; | 1969 | return *it; |
1980 | } | 1970 | } |
1981 | } | 1971 | } |
1982 | return Address(); | 1972 | return Address(); |
1983 | } | 1973 | } |
1984 | 1974 | ||
1985 | void Addressee::insertCategory( const QString &c ) | 1975 | void Addressee::insertCategory( const QString &c ) |
1986 | { | 1976 | { |
1987 | detach(); | 1977 | detach(); |
1988 | mData->empty = false; | 1978 | mData->empty = false; |
1989 | 1979 | ||
1990 | if ( mData->categories.contains( c ) ) return; | 1980 | if ( mData->categories.contains( c ) ) return; |
1991 | 1981 | ||
1992 | mData->categories.append( c ); | 1982 | mData->categories.append( c ); |
1993 | } | 1983 | } |
1994 | 1984 | ||
1995 | void Addressee::removeCategory( const QString &c ) | 1985 | void Addressee::removeCategory( const QString &c ) |
1996 | { | 1986 | { |
1997 | detach(); | 1987 | detach(); |
1998 | 1988 | ||
1999 | QStringList::Iterator it = mData->categories.find( c ); | 1989 | QStringList::Iterator it = mData->categories.find( c ); |
2000 | if ( it == mData->categories.end() ) return; | 1990 | if ( it == mData->categories.end() ) return; |
2001 | 1991 | ||
2002 | mData->categories.remove( it ); | 1992 | mData->categories.remove( it ); |
2003 | } | 1993 | } |
2004 | 1994 | ||
2005 | bool Addressee::hasCategory( const QString &c ) const | 1995 | bool Addressee::hasCategory( const QString &c ) const |
2006 | { | 1996 | { |
2007 | return ( mData->categories.contains( c ) ); | 1997 | return ( mData->categories.contains( c ) ); |
2008 | } | 1998 | } |
2009 | 1999 | ||
2010 | void Addressee::setCategories( const QStringList &c ) | 2000 | void Addressee::setCategories( const QStringList &c ) |
2011 | { | 2001 | { |
2012 | detach(); | 2002 | detach(); |
2013 | mData->empty = false; | 2003 | mData->empty = false; |
2014 | 2004 | ||
2015 | mData->categories = c; | 2005 | mData->categories = c; |
2016 | } | 2006 | } |
2017 | 2007 | ||
2018 | QStringList Addressee::categories() const | 2008 | QStringList Addressee::categories() const |
2019 | { | 2009 | { |
2020 | return mData->categories; | 2010 | return mData->categories; |
2021 | } | 2011 | } |
2022 | 2012 | ||
2023 | void Addressee::insertCustom( const QString &app, const QString &name, | 2013 | void Addressee::insertCustom( const QString &app, const QString &name, |
2024 | const QString &value ) | 2014 | const QString &value ) |
2025 | { | 2015 | { |
2026 | if ( value.isNull() || name.isEmpty() || app.isEmpty() ) return; | 2016 | if ( value.isNull() || name.isEmpty() || app.isEmpty() ) return; |
2027 | 2017 | ||
2028 | detach(); | 2018 | detach(); |
2029 | mData->empty = false; | 2019 | mData->empty = false; |
2030 | 2020 | ||
2031 | QString qualifiedName = app + "-" + name + ":"; | 2021 | QString qualifiedName = app + "-" + name + ":"; |
2032 | 2022 | ||
2033 | QStringList::Iterator it; | 2023 | QStringList::Iterator it; |
2034 | for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { | 2024 | for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { |
2035 | if ( (*it).startsWith( qualifiedName ) ) { | 2025 | if ( (*it).startsWith( qualifiedName ) ) { |
2036 | (*it) = qualifiedName + value; | 2026 | (*it) = qualifiedName + value; |
2037 | return; | 2027 | return; |
2038 | } | 2028 | } |
2039 | } | 2029 | } |
2040 | mData->custom.append( qualifiedName + value ); | 2030 | mData->custom.append( qualifiedName + value ); |
2041 | } | 2031 | } |
2042 | 2032 | ||
2043 | void Addressee::removeCustom( const QString &app, const QString &name) | 2033 | void Addressee::removeCustom( const QString &app, const QString &name) |
2044 | { | 2034 | { |
2045 | detach(); | 2035 | detach(); |
2046 | 2036 | ||
2047 | QString qualifiedName = app + "-" + name + ":"; | 2037 | QString qualifiedName = app + "-" + name + ":"; |
2048 | 2038 | ||
2049 | QStringList::Iterator it; | 2039 | QStringList::Iterator it; |
2050 | for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { | 2040 | for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { |
2051 | if ( (*it).startsWith( qualifiedName ) ) { | 2041 | if ( (*it).startsWith( qualifiedName ) ) { |
2052 | mData->custom.remove( it ); | 2042 | mData->custom.remove( it ); |
2053 | return; | 2043 | return; |
2054 | } | 2044 | } |
2055 | } | 2045 | } |
2056 | } | 2046 | } |
2057 | 2047 | ||
2058 | QString Addressee::custom( const QString &app, const QString &name ) const | 2048 | QString Addressee::custom( const QString &app, const QString &name ) const |
2059 | { | 2049 | { |
2060 | QString qualifiedName = app + "-" + name + ":"; | 2050 | QString qualifiedName = app + "-" + name + ":"; |
2061 | QString value; | 2051 | QString value; |
2062 | 2052 | ||
2063 | QStringList::ConstIterator it; | 2053 | QStringList::ConstIterator it; |
2064 | for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { | 2054 | for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { |
2065 | if ( (*it).startsWith( qualifiedName ) ) { | 2055 | if ( (*it).startsWith( qualifiedName ) ) { |
2066 | value = (*it).mid( (*it).find( ":" ) + 1 ); | 2056 | value = (*it).mid( (*it).find( ":" ) + 1 ); |
2067 | break; | 2057 | break; |
2068 | } | 2058 | } |
2069 | } | 2059 | } |
2070 | 2060 | ||
2071 | return value; | 2061 | return value; |
2072 | } | 2062 | } |
2073 | 2063 | ||
2074 | void Addressee::setCustoms( const QStringList &l ) | 2064 | void Addressee::setCustoms( const QStringList &l ) |
2075 | { | 2065 | { |
2076 | detach(); | 2066 | detach(); |
2077 | mData->empty = false; | 2067 | mData->empty = false; |
2078 | 2068 | ||
2079 | mData->custom = l; | 2069 | mData->custom = l; |
2080 | } | 2070 | } |
2081 | 2071 | ||
2082 | QStringList Addressee::customs() const | 2072 | QStringList Addressee::customs() const |
2083 | { | 2073 | { |
2084 | return mData->custom; | 2074 | return mData->custom; |
2085 | } | 2075 | } |
2086 | 2076 | ||
2087 | void Addressee::parseEmailAddress( const QString &rawEmail, QString &fullName, | 2077 | void Addressee::parseEmailAddress( const QString &rawEmail, QString &fullName, |
2088 | QString &email) | 2078 | QString &email) |
2089 | { | 2079 | { |
2090 | int startPos, endPos, len; | 2080 | int startPos, endPos, len; |
2091 | QString partA, partB, result; | 2081 | QString partA, partB, result; |
2092 | char endCh = '>'; | 2082 | char endCh = '>'; |
2093 | 2083 | ||
2094 | startPos = rawEmail.find('<'); | 2084 | startPos = rawEmail.find('<'); |
2095 | if (startPos < 0) | 2085 | if (startPos < 0) |
2096 | { | 2086 | { |
2097 | startPos = rawEmail.find('('); | 2087 | startPos = rawEmail.find('('); |
2098 | endCh = ')'; | 2088 | endCh = ')'; |
2099 | } | 2089 | } |
2100 | if (startPos < 0) | 2090 | if (startPos < 0) |
2101 | { | 2091 | { |
2102 | // We couldn't find any separators, so we assume the whole string | 2092 | // We couldn't find any separators, so we assume the whole string |
2103 | // is the email address | 2093 | // is the email address |
2104 | email = rawEmail; | 2094 | email = rawEmail; |
2105 | fullName = ""; | 2095 | fullName = ""; |
2106 | } | 2096 | } |
2107 | else | 2097 | else |
2108 | { | 2098 | { |
2109 | // We have a start position, try to find an end | 2099 | // We have a start position, try to find an end |
2110 | endPos = rawEmail.find(endCh, startPos+1); | 2100 | endPos = rawEmail.find(endCh, startPos+1); |
2111 | 2101 | ||
2112 | if (endPos < 0) | 2102 | if (endPos < 0) |
2113 | { | 2103 | { |
2114 | // We couldn't find the end of the email address. We can only | 2104 | // We couldn't find the end of the email address. We can only |
2115 | // assume the entire string is the email address. | 2105 | // assume the entire string is the email address. |
2116 | email = rawEmail; | 2106 | email = rawEmail; |
2117 | fullName = ""; | 2107 | fullName = ""; |
2118 | } | 2108 | } |
2119 | else | 2109 | else |
2120 | { | 2110 | { |
2121 | // We have a start and end to the email address | 2111 | // We have a start and end to the email address |
2122 | 2112 | ||
2123 | // Grab the name part | 2113 | // Grab the name part |
2124 | fullName = rawEmail.left(startPos).stripWhiteSpace(); | 2114 | fullName = rawEmail.left(startPos).stripWhiteSpace(); |
2125 | 2115 | ||
2126 | // grab the email part | 2116 | // grab the email part |
2127 | email = rawEmail.mid(startPos+1, endPos-startPos-1).stripWhiteSpace(); | 2117 | email = rawEmail.mid(startPos+1, endPos-startPos-1).stripWhiteSpace(); |
2128 | 2118 | ||
2129 | // Check that we do not have any extra characters on the end of the | 2119 | // Check that we do not have any extra characters on the end of the |
2130 | // strings | 2120 | // strings |
2131 | len = fullName.length(); | 2121 | len = fullName.length(); |
2132 | if (fullName[0]=='"' && fullName[len-1]=='"') | 2122 | if (fullName[0]=='"' && fullName[len-1]=='"') |
2133 | fullName = fullName.mid(1, len-2); | 2123 | fullName = fullName.mid(1, len-2); |
2134 | else if (fullName[0]=='<' && fullName[len-1]=='>') | 2124 | else if (fullName[0]=='<' && fullName[len-1]=='>') |
2135 | fullName = fullName.mid(1, len-2); | 2125 | fullName = fullName.mid(1, len-2); |
2136 | else if (fullName[0]=='(' && fullName[len-1]==')') | 2126 | else if (fullName[0]=='(' && fullName[len-1]==')') |
2137 | fullName = fullName.mid(1, len-2); | 2127 | fullName = fullName.mid(1, len-2); |
2138 | } | 2128 | } |
2139 | } | 2129 | } |
2140 | } | 2130 | } |
2141 | 2131 | ||
2142 | void Addressee::setResource( Resource *resource ) | 2132 | void Addressee::setResource( Resource *resource ) |
2143 | { | 2133 | { |
2144 | detach(); | 2134 | detach(); |
2145 | mData->resource = resource; | 2135 | mData->resource = resource; |
2146 | } | 2136 | } |
2147 | 2137 | ||
2148 | Resource *Addressee::resource() const | 2138 | Resource *Addressee::resource() const |
2149 | { | 2139 | { |
2150 | return mData->resource; | 2140 | return mData->resource; |
2151 | } | 2141 | } |
2152 | 2142 | ||
2153 | //US | 2143 | //US |
2154 | QString Addressee::resourceLabel() | 2144 | QString Addressee::resourceLabel() |
2155 | { | 2145 | { |
2156 | return i18n("Resource"); | 2146 | return i18n("Resource"); |
2157 | } | 2147 | } |
2158 | QString Addressee::categoryLabel() | 2148 | QString Addressee::categoryLabel() |
2159 | { | 2149 | { |
2160 | return i18n("Category"); | 2150 | return i18n("Category"); |
2161 | } | 2151 | } |
2162 | 2152 | ||
2163 | void Addressee::setChanged( bool value ) | 2153 | void Addressee::setChanged( bool value ) |
2164 | { | 2154 | { |
2165 | detach(); | 2155 | detach(); |
2166 | mData->changed = value; | 2156 | mData->changed = value; |
2167 | } | 2157 | } |
2168 | 2158 | ||
2169 | bool Addressee::changed() const | 2159 | bool Addressee::changed() const |
2170 | { | 2160 | { |
2171 | return mData->changed; | 2161 | return mData->changed; |
2172 | } | 2162 | } |
2173 | 2163 | ||
2174 | void Addressee::setTagged( bool value ) | 2164 | void Addressee::setTagged( bool value ) |
2175 | { | 2165 | { |
2176 | detach(); | 2166 | detach(); |
2177 | mData->tagged = value; | 2167 | mData->tagged = value; |
2178 | } | 2168 | } |
2179 | 2169 | ||
2180 | bool Addressee::tagged() const | 2170 | bool Addressee::tagged() const |
2181 | { | 2171 | { |
2182 | return mData->tagged; | 2172 | return mData->tagged; |
2183 | } | 2173 | } |
2184 | 2174 | ||
2185 | QDataStream &KABC::operator<<( QDataStream &s, const Addressee &a ) | 2175 | QDataStream &KABC::operator<<( QDataStream &s, const Addressee &a ) |
2186 | { | 2176 | { |
2187 | if (!a.mData) return s; | 2177 | if (!a.mData) return s; |
2188 | 2178 | ||
2189 | s << a.uid(); | 2179 | s << a.uid(); |
2190 | 2180 | ||
2191 | s << a.mData->name; | 2181 | s << a.mData->name; |
2192 | s << a.mData->formattedName; | 2182 | s << a.mData->formattedName; |
2193 | s << a.mData->familyName; | 2183 | s << a.mData->familyName; |
2194 | s << a.mData->givenName; | 2184 | s << a.mData->givenName; |
2195 | s << a.mData->additionalName; | 2185 | s << a.mData->additionalName; |
2196 | s << a.mData->prefix; | 2186 | s << a.mData->prefix; |
2197 | s << a.mData->suffix; | 2187 | s << a.mData->suffix; |
2198 | s << a.mData->nickName; | 2188 | s << a.mData->nickName; |
2199 | s << a.mData->birthday; | 2189 | s << a.mData->birthday; |
2200 | s << a.mData->mailer; | 2190 | s << a.mData->mailer; |
2201 | s << a.mData->timeZone; | 2191 | s << a.mData->timeZone; |
2202 | s << a.mData->geo; | 2192 | s << a.mData->geo; |
2203 | s << a.mData->title; | 2193 | s << a.mData->title; |
2204 | s << a.mData->role; | 2194 | s << a.mData->role; |
2205 | s << a.mData->organization; | 2195 | s << a.mData->organization; |
2206 | s << a.mData->note; | 2196 | s << a.mData->note; |
2207 | s << a.mData->productId; | 2197 | s << a.mData->productId; |
2208 | s << a.mData->revision; | 2198 | s << a.mData->revision; |
2209 | s << a.mData->sortString; | 2199 | s << a.mData->sortString; |
2210 | s << a.mData->url; | 2200 | s << a.mData->url; |
2211 | s << a.mData->secrecy; | 2201 | s << a.mData->secrecy; |
2212 | s << a.mData->logo; | 2202 | s << a.mData->logo; |
2213 | s << a.mData->photo; | 2203 | s << a.mData->photo; |
2214 | s << a.mData->sound; | 2204 | s << a.mData->sound; |
2215 | s << a.mData->agent; | 2205 | s << a.mData->agent; |
2216 | s << a.mData->phoneNumbers; | 2206 | s << a.mData->phoneNumbers; |
2217 | s << a.mData->addresses; | 2207 | s << a.mData->addresses; |
2218 | s << a.mData->emails; | 2208 | s << a.mData->emails; |
2219 | s << a.mData->categories; | 2209 | s << a.mData->categories; |
2220 | s << a.mData->custom; | 2210 | s << a.mData->custom; |
2221 | s << a.mData->keys; | 2211 | s << a.mData->keys; |
2222 | return s; | 2212 | return s; |
2223 | } | 2213 | } |
2224 | 2214 | ||
2225 | QDataStream &KABC::operator>>( QDataStream &s, Addressee &a ) | 2215 | QDataStream &KABC::operator>>( QDataStream &s, Addressee &a ) |
2226 | { | 2216 | { |
2227 | if (!a.mData) return s; | 2217 | if (!a.mData) return s; |
2228 | 2218 | ||
2229 | s >> a.mData->uid; | 2219 | s >> a.mData->uid; |
2230 | 2220 | ||
2231 | s >> a.mData->name; | 2221 | s >> a.mData->name; |
2232 | s >> a.mData->formattedName; | 2222 | s >> a.mData->formattedName; |
2233 | s >> a.mData->familyName; | 2223 | s >> a.mData->familyName; |
2234 | s >> a.mData->givenName; | 2224 | s >> a.mData->givenName; |
2235 | s >> a.mData->additionalName; | 2225 | s >> a.mData->additionalName; |
2236 | s >> a.mData->prefix; | 2226 | s >> a.mData->prefix; |
2237 | s >> a.mData->suffix; | 2227 | s >> a.mData->suffix; |
2238 | s >> a.mData->nickName; | 2228 | s >> a.mData->nickName; |
2239 | s >> a.mData->birthday; | 2229 | s >> a.mData->birthday; |
2240 | s >> a.mData->mailer; | 2230 | s >> a.mData->mailer; |
2241 | s >> a.mData->timeZone; | 2231 | s >> a.mData->timeZone; |
2242 | s >> a.mData->geo; | 2232 | s >> a.mData->geo; |
2243 | s >> a.mData->title; | 2233 | s >> a.mData->title; |
2244 | s >> a.mData->role; | 2234 | s >> a.mData->role; |
2245 | s >> a.mData->organization; | 2235 | s >> a.mData->organization; |
2246 | s >> a.mData->note; | 2236 | s >> a.mData->note; |
2247 | s >> a.mData->productId; | 2237 | s >> a.mData->productId; |
2248 | s >> a.mData->revision; | 2238 | s >> a.mData->revision; |
2249 | s >> a.mData->sortString; | 2239 | s >> a.mData->sortString; |
2250 | s >> a.mData->url; | 2240 | s >> a.mData->url; |
2251 | s >> a.mData->secrecy; | 2241 | s >> a.mData->secrecy; |
2252 | s >> a.mData->logo; | 2242 | s >> a.mData->logo; |
2253 | s >> a.mData->photo; | 2243 | s >> a.mData->photo; |
2254 | s >> a.mData->sound; | 2244 | s >> a.mData->sound; |
2255 | s >> a.mData->agent; | 2245 | s >> a.mData->agent; |
2256 | s >> a.mData->phoneNumbers; | 2246 | s >> a.mData->phoneNumbers; |
2257 | s >> a.mData->addresses; | 2247 | s >> a.mData->addresses; |
2258 | s >> a.mData->emails; | 2248 | s >> a.mData->emails; |
2259 | s >> a.mData->categories; | 2249 | s >> a.mData->categories; |
2260 | s >> a.mData->custom; | 2250 | s >> a.mData->custom; |
2261 | s >> a.mData->keys; | 2251 | s >> a.mData->keys; |
2262 | 2252 | ||
2263 | a.mData->empty = false; | 2253 | a.mData->empty = false; |
2264 | 2254 | ||
2265 | return s; | 2255 | return s; |
2266 | } | 2256 | } |
2267 | bool matchBinaryPattern( int value, int pattern ) | 2257 | bool matchBinaryPattern( int value, int pattern ) |
2268 | { | 2258 | { |
2269 | /** | 2259 | /** |
2270 | We want to match all telephonnumbers/addresses which have the bits in the | 2260 | We want to match all telephonnumbers/addresses which have the bits in the |
2271 | pattern set. More are allowed. | 2261 | pattern set. More are allowed. |
2272 | if pattern == 0 we have a special handling, then we want only those with | 2262 | if pattern == 0 we have a special handling, then we want only those with |
2273 | exactly no bit set. | 2263 | exactly no bit set. |
2274 | */ | 2264 | */ |
2275 | if ( pattern == 0 ) | 2265 | if ( pattern == 0 ) |
2276 | return ( value == 0 ); | 2266 | return ( value == 0 ); |
2277 | else | 2267 | else |
2278 | return ( pattern == ( pattern & value ) ); | 2268 | return ( pattern == ( pattern & value ) ); |
2279 | } | 2269 | } |
2280 | 2270 | ||
2281 | bool matchBinaryPatternP( int value, int pattern ) | 2271 | bool matchBinaryPatternP( int value, int pattern ) |
2282 | { | 2272 | { |
2283 | 2273 | ||
2284 | if ( pattern == 0 ) | 2274 | if ( pattern == 0 ) |
2285 | return ( value == 0 ); | 2275 | return ( value == 0 ); |
2286 | else | 2276 | else |
2287 | return ( (pattern |PhoneNumber::Pref ) == ( value |PhoneNumber::Pref ) ); | 2277 | return ( (pattern |PhoneNumber::Pref ) == ( value |PhoneNumber::Pref ) ); |
2288 | } | 2278 | } |
2289 | bool matchBinaryPatternA( int value, int pattern ) | 2279 | bool matchBinaryPatternA( int value, int pattern ) |
2290 | { | 2280 | { |
2291 | 2281 | ||
2292 | if ( pattern == 0 ) | 2282 | if ( pattern == 0 ) |
2293 | return ( value == 0 ); | 2283 | return ( value == 0 ); |
2294 | else | 2284 | else |
2295 | return ( (pattern | Address::Pref) == ( value | Address::Pref ) ); | 2285 | return ( (pattern | Address::Pref) == ( value | Address::Pref ) ); |
2296 | } | 2286 | } |
diff --git a/kabc/addressee.h b/kabc/addressee.h index fcadda6..aac78dc 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h | |||
@@ -1,861 +1,856 @@ | |||
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 | #ifndef KABC_ADDRESSEE_H | 29 | #ifndef KABC_ADDRESSEE_H |
30 | #define KABC_ADDRESSEE_H | 30 | #define KABC_ADDRESSEE_H |
31 | 31 | ||
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qstring.h> | 33 | #include <qstring.h> |
34 | #include <qregexp.h> | 34 | #include <qregexp.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <qvaluelist.h> | 36 | #include <qvaluelist.h> |
37 | 37 | ||
38 | #include <ksharedptr.h> | 38 | #include <ksharedptr.h> |
39 | #include <kurl.h> | 39 | #include <kurl.h> |
40 | 40 | ||
41 | #include "address.h" | 41 | #include "address.h" |
42 | #include "agent.h" | 42 | #include "agent.h" |
43 | #include "geo.h" | 43 | #include "geo.h" |
44 | #include "key.h" | 44 | #include "key.h" |
45 | #include "phonenumber.h" | 45 | #include "phonenumber.h" |
46 | #include "picture.h" | 46 | #include "picture.h" |
47 | #include "secrecy.h" | 47 | #include "secrecy.h" |
48 | #include "sound.h" | 48 | #include "sound.h" |
49 | #include "timezone.h" | 49 | #include "timezone.h" |
50 | 50 | ||
51 | namespace KABC { | 51 | namespace KABC { |
52 | 52 | ||
53 | class Resource; | 53 | class Resource; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | @short address book entry | 56 | @short address book entry |
57 | 57 | ||
58 | This class represents an entry in the address book. | 58 | This class represents an entry in the address book. |
59 | 59 | ||
60 | The data of this class is implicitly shared. You can pass this class by value. | 60 | The data of this class is implicitly shared. You can pass this class by value. |
61 | 61 | ||
62 | If you need the name of a field for presenting it to the user you should use | 62 | If you need the name of a field for presenting it to the user you should use |
63 | the functions ending in Label(). They return a translated string which can be | 63 | the functions ending in Label(). They return a translated string which can be |
64 | used as label for the corresponding field. | 64 | used as label for the corresponding field. |
65 | 65 | ||
66 | About the name fields: | 66 | About the name fields: |
67 | 67 | ||
68 | givenName() is the first name and familyName() the last name. In some | 68 | givenName() is the first name and familyName() the last name. In some |
69 | countries the family name comes first, that's the reason for the | 69 | countries the family name comes first, that's the reason for the |
70 | naming. formattedName() is the full name with the correct formatting. | 70 | naming. formattedName() is the full name with the correct formatting. |
71 | It is used as an override, when the correct formatting can't be generated | 71 | It is used as an override, when the correct formatting can't be generated |
72 | from the other name fields automatically. | 72 | from the other name fields automatically. |
73 | 73 | ||
74 | realName() returns a fully formatted name(). It uses formattedName, if set, | 74 | realName() returns a fully formatted name(). It uses formattedName, if set, |
75 | otherwise it constucts the name from the name fields. As fallback, if | 75 | otherwise it constucts the name from the name fields. As fallback, if |
76 | nothing else is set it uses name(). | 76 | nothing else is set it uses name(). |
77 | 77 | ||
78 | name() is the NAME type of RFC2426. It can be used as internal name for the | 78 | name() is the NAME type of RFC2426. It can be used as internal name for the |
79 | data enty, but shouldn't be used for displaying the data to the user. | 79 | data enty, but shouldn't be used for displaying the data to the user. |
80 | */ | 80 | */ |
81 | class Addressee | 81 | class Addressee |
82 | { | 82 | { |
83 | friend QDataStream &operator<<( QDataStream &, const Addressee & ); | 83 | friend QDataStream &operator<<( QDataStream &, const Addressee & ); |
84 | friend QDataStream &operator>>( QDataStream &, Addressee & ); | 84 | friend QDataStream &operator>>( QDataStream &, Addressee & ); |
85 | 85 | ||
86 | public: | 86 | public: |
87 | typedef QValueList<Addressee> List; | 87 | typedef QValueList<Addressee> List; |
88 | 88 | ||
89 | /** | 89 | /** |
90 | Construct an empty address book entry. | 90 | Construct an empty address book entry. |
91 | */ | 91 | */ |
92 | Addressee(); | 92 | Addressee(); |
93 | ~Addressee(); | 93 | ~Addressee(); |
94 | 94 | ||
95 | Addressee( const Addressee & ); | 95 | Addressee( const Addressee & ); |
96 | Addressee &operator=( const Addressee & ); | 96 | Addressee &operator=( const Addressee & ); |
97 | 97 | ||
98 | bool operator==( const Addressee & ) const; | 98 | bool operator==( const Addressee & ) const; |
99 | bool operator!=( const Addressee & ) const; | 99 | bool operator!=( const Addressee & ) const; |
100 | // sync stuff | 100 | // sync stuff |
101 | void setTempSyncStat(int id); | 101 | void setTempSyncStat(int id); |
102 | int tempSyncStat() const; | 102 | int tempSyncStat() const; |
103 | void setIDStr( const QString & ); | 103 | void setIDStr( const QString & ); |
104 | const QString IDStr() const; | 104 | const QString IDStr() const; |
105 | void setID( const QString &, const QString & ); | 105 | void setID( const QString &, const QString & ); |
106 | const QString getID( const QString & ) const; | 106 | const QString getID( const QString & ) const; |
107 | void setCsum( const QString &, const QString & ); | 107 | void setCsum( const QString &, const QString & ); |
108 | const QString getCsum( const QString & ) const ; | 108 | const QString getCsum( const QString & ) const ; |
109 | void removeID(const QString &); | 109 | void removeID(const QString &); |
110 | void computeCsum(const QString &dev); | 110 | void computeCsum(const QString &dev); |
111 | ulong getCsum4List( const QStringList & attList); | 111 | ulong getCsum4List( const QStringList & attList); |
112 | /** | 112 | /** |
113 | Return, if the address book entry is empty. | 113 | Return, if the address book entry is empty. |
114 | */ | 114 | */ |
115 | bool isEmpty() const; | 115 | bool isEmpty() const; |
116 | void setExternalUID( const QString &id ); | 116 | void setExternalUID( const QString &id ); |
117 | const QString externalUID() const; | 117 | const QString externalUID() const; |
118 | void setOriginalExternalUID( const QString &id ); | 118 | void setOriginalExternalUID( const QString &id ); |
119 | QString originalExternalUID() const; | 119 | QString originalExternalUID() const; |
120 | void mergeContact( const Addressee& ad, bool isSubSet ); | 120 | void mergeContact( const Addressee& ad, bool isSubSet ); |
121 | void simplifyEmails(); | 121 | void simplifyEmails(); |
122 | void simplifyAddresses(); | 122 | void simplifyAddresses(); |
123 | void simplifyPhoneNumbers(); | 123 | void simplifyPhoneNumbers(); |
124 | void simplifyPhoneNumberTypes(); | 124 | void simplifyPhoneNumberTypes(); |
125 | void makePhoneNumbersOLcompatible(); | 125 | void makePhoneNumbersOLcompatible(); |
126 | int hasPhoneNumberType( int type ); | 126 | int hasPhoneNumberType( int type ); |
127 | bool removeVoice(); | 127 | bool removeVoice(); |
128 | bool containsAdr(const Addressee& addr ); | 128 | bool containsAdr(const Addressee& addr ); |
129 | 129 | ||
130 | /** | 130 | /** |
131 | Set unique identifier. | 131 | Set unique identifier. |
132 | */ | 132 | */ |
133 | void setUid( const QString &uid ); | 133 | void setUid( const QString &uid ); |
134 | /** | 134 | /** |
135 | Return unique identifier. | 135 | Return unique identifier. |
136 | */ | 136 | */ |
137 | const QString uid() const; | 137 | const QString uid() const; |
138 | /** | 138 | /** |
139 | Return translated label for uid field. | 139 | Return translated label for uid field. |
140 | */ | 140 | */ |
141 | static QString uidLabel(); | 141 | static QString uidLabel(); |
142 | 142 | ||
143 | /** | 143 | /** |
144 | Set name. | 144 | Set name. |
145 | */ | 145 | */ |
146 | void setName( const QString &name ); | 146 | void setName( const QString &name ); |
147 | /** | 147 | /** |
148 | Return name. | 148 | Return name. |
149 | */ | 149 | */ |
150 | QString name() const; | 150 | QString name() const; |
151 | /** | 151 | /** |
152 | Return translated label for name field. | 152 | Return translated label for name field. |
153 | */ | 153 | */ |
154 | static QString nameLabel(); | 154 | static QString nameLabel(); |
155 | 155 | ||
156 | /** | 156 | /** |
157 | Set formatted name. | 157 | Set formatted name. |
158 | */ | 158 | */ |
159 | void setFormattedName( const QString &formattedName ); | 159 | void setFormattedName( const QString &formattedName ); |
160 | /** | 160 | /** |
161 | Return formatted name. | 161 | Return formatted name. |
162 | */ | 162 | */ |
163 | QString formattedName() const; | 163 | QString formattedName() const; |
164 | /** | 164 | /** |
165 | Return translated label for formattedName field. | 165 | Return translated label for formattedName field. |
166 | */ | 166 | */ |
167 | static QString formattedNameLabel(); | 167 | static QString formattedNameLabel(); |
168 | 168 | ||
169 | /** | 169 | /** |
170 | Set family name. | 170 | Set family name. |
171 | */ | 171 | */ |
172 | void setFamilyName( const QString &familyName ); | 172 | void setFamilyName( const QString &familyName ); |
173 | /** | 173 | /** |
174 | Return family name. | 174 | Return family name. |
175 | */ | 175 | */ |
176 | QString familyName() const; | 176 | QString familyName() const; |
177 | /** | 177 | /** |
178 | Return translated label for familyName field. | 178 | Return translated label for familyName field. |
179 | */ | 179 | */ |
180 | static QString familyNameLabel(); | 180 | static QString familyNameLabel(); |
181 | 181 | ||
182 | /** | 182 | /** |
183 | Set given name. | 183 | Set given name. |
184 | */ | 184 | */ |
185 | void setGivenName( const QString &givenName ); | 185 | void setGivenName( const QString &givenName ); |
186 | /** | 186 | /** |
187 | Return given name. | 187 | Return given name. |
188 | */ | 188 | */ |
189 | QString givenName() const; | 189 | QString givenName() const; |
190 | /** | 190 | /** |
191 | Return translated label for givenName field. | 191 | Return translated label for givenName field. |
192 | */ | 192 | */ |
193 | static QString givenNameLabel(); | 193 | static QString givenNameLabel(); |
194 | 194 | ||
195 | /** | 195 | /** |
196 | Set additional names. | 196 | Set additional names. |
197 | */ | 197 | */ |
198 | void setAdditionalName( const QString &additionalName ); | 198 | void setAdditionalName( const QString &additionalName ); |
199 | /** | 199 | /** |
200 | Return additional names. | 200 | Return additional names. |
201 | */ | 201 | */ |
202 | QString additionalName() const; | 202 | QString additionalName() const; |
203 | /** | 203 | /** |
204 | Return translated label for additionalName field. | 204 | Return translated label for additionalName field. |
205 | */ | 205 | */ |
206 | static QString additionalNameLabel(); | 206 | static QString additionalNameLabel(); |
207 | 207 | ||
208 | /** | 208 | /** |
209 | Set honorific prefixes. | 209 | Set honorific prefixes. |
210 | */ | 210 | */ |
211 | void setPrefix( const QString &prefix ); | 211 | void setPrefix( const QString &prefix ); |
212 | /** | 212 | /** |
213 | Return honorific prefixes. | 213 | Return honorific prefixes. |
214 | */ | 214 | */ |
215 | QString prefix() const; | 215 | QString prefix() const; |
216 | /** | 216 | /** |
217 | Return translated label for prefix field. | 217 | Return translated label for prefix field. |
218 | */ | 218 | */ |
219 | static QString prefixLabel(); | 219 | static QString prefixLabel(); |
220 | 220 | ||
221 | /** | 221 | /** |
222 | Set honorific suffixes. | 222 | Set honorific suffixes. |
223 | */ | 223 | */ |
224 | void setSuffix( const QString &suffix ); | 224 | void setSuffix( const QString &suffix ); |
225 | /** | 225 | /** |
226 | Return honorific suffixes. | 226 | Return honorific suffixes. |
227 | */ | 227 | */ |
228 | QString suffix() const; | 228 | QString suffix() const; |
229 | /** | 229 | /** |
230 | Return translated label for suffix field. | 230 | Return translated label for suffix field. |
231 | */ | 231 | */ |
232 | static QString suffixLabel(); | 232 | static QString suffixLabel(); |
233 | 233 | ||
234 | /** | 234 | /** |
235 | Set nick name. | 235 | Set nick name. |
236 | */ | 236 | */ |
237 | void setNickName( const QString &nickName ); | 237 | void setNickName( const QString &nickName ); |
238 | /** | 238 | /** |
239 | Return nick name. | 239 | Return nick name. |
240 | */ | 240 | */ |
241 | QString nickName() const; | 241 | QString nickName() const; |
242 | /** | 242 | /** |
243 | Return translated label for nickName field. | 243 | Return translated label for nickName field. |
244 | */ | 244 | */ |
245 | static QString nickNameLabel(); | 245 | static QString nickNameLabel(); |
246 | 246 | ||
247 | /** | 247 | /** |
248 | Set birthday. | 248 | Set birthday. |
249 | */ | 249 | */ |
250 | void setBirthday( const QDateTime &birthday ); | 250 | void setBirthday( const QDateTime &birthday ); |
251 | /** | 251 | /** |
252 | Return birthday. | 252 | Return birthday. |
253 | */ | 253 | */ |
254 | QDateTime birthday() const; | 254 | QDateTime birthday() const; |
255 | /** | 255 | /** |
256 | Return translated label for birthday field. | 256 | Return translated label for birthday field. |
257 | */ | 257 | */ |
258 | static QString birthdayLabel(); | 258 | static QString birthdayLabel(); |
259 | 259 | ||
260 | /** | 260 | /** |
261 | Return translated label for homeAddressStreet field. | 261 | Return translated label for homeAddressStreet field. |
262 | */ | 262 | */ |
263 | static QString homeAddressStreetLabel(); | 263 | static QString homeAddressStreetLabel(); |
264 | 264 | ||
265 | /** | 265 | /** |
266 | Return translated label for homeAddressLocality field. | 266 | Return translated label for homeAddressLocality field. |
267 | */ | 267 | */ |
268 | static QString homeAddressLocalityLabel(); | 268 | static QString homeAddressLocalityLabel(); |
269 | 269 | ||
270 | /** | 270 | /** |
271 | Return translated label for homeAddressRegion field. | 271 | Return translated label for homeAddressRegion field. |
272 | */ | 272 | */ |
273 | static QString homeAddressRegionLabel(); | 273 | static QString homeAddressRegionLabel(); |
274 | 274 | ||
275 | /** | 275 | /** |
276 | Return translated label for homeAddressPostalCode field. | 276 | Return translated label for homeAddressPostalCode field. |
277 | */ | 277 | */ |
278 | static QString homeAddressPostalCodeLabel(); | 278 | static QString homeAddressPostalCodeLabel(); |
279 | 279 | ||
280 | /** | 280 | /** |
281 | Return translated label for homeAddressCountry field. | 281 | Return translated label for homeAddressCountry field. |
282 | */ | 282 | */ |
283 | static QString homeAddressCountryLabel(); | 283 | static QString homeAddressCountryLabel(); |
284 | 284 | ||
285 | /** | 285 | /** |
286 | Return translated label for homeAddressLabel field. | 286 | Return translated label for homeAddressLabel field. |
287 | */ | 287 | */ |
288 | static QString homeAddressLabelLabel(); | 288 | static QString homeAddressLabelLabel(); |
289 | 289 | ||
290 | /** | 290 | /** |
291 | Return translated label for businessAddressStreet field. | 291 | Return translated label for businessAddressStreet field. |
292 | */ | 292 | */ |
293 | static QString businessAddressStreetLabel(); | 293 | static QString businessAddressStreetLabel(); |
294 | 294 | ||
295 | /** | 295 | /** |
296 | Return translated label for businessAddressLocality field. | 296 | Return translated label for businessAddressLocality field. |
297 | */ | 297 | */ |
298 | static QString businessAddressLocalityLabel(); | 298 | static QString businessAddressLocalityLabel(); |
299 | 299 | ||
300 | /** | 300 | /** |
301 | Return translated label for businessAddressRegion field. | 301 | Return translated label for businessAddressRegion field. |
302 | */ | 302 | */ |
303 | static QString businessAddressRegionLabel(); | 303 | static QString businessAddressRegionLabel(); |
304 | 304 | ||
305 | /** | 305 | /** |
306 | Return translated label for businessAddressPostalCode field. | 306 | Return translated label for businessAddressPostalCode field. |
307 | */ | 307 | */ |
308 | static QString businessAddressPostalCodeLabel(); | 308 | static QString businessAddressPostalCodeLabel(); |
309 | 309 | ||
310 | /** | 310 | /** |
311 | Return translated label for businessAddressCountry field. | 311 | Return translated label for businessAddressCountry field. |
312 | */ | 312 | */ |
313 | static QString businessAddressCountryLabel(); | 313 | static QString businessAddressCountryLabel(); |
314 | 314 | ||
315 | /** | 315 | /** |
316 | Return translated label for businessAddressLabel field. | 316 | Return translated label for businessAddressLabel field. |
317 | */ | 317 | */ |
318 | static QString businessAddressLabelLabel(); | 318 | static QString businessAddressLabelLabel(); |
319 | 319 | ||
320 | /** | 320 | /** |
321 | Return translated label for homePhone field. | 321 | Return translated label for homePhone field. |
322 | */ | 322 | */ |
323 | static QString homePhoneLabel(); | 323 | static QString homePhoneLabel(); |
324 | 324 | ||
325 | /** | 325 | /** |
326 | Return translated label for businessPhone field. | 326 | Return translated label for businessPhone field. |
327 | */ | 327 | */ |
328 | static QString businessPhoneLabel(); | 328 | static QString businessPhoneLabel(); |
329 | 329 | ||
330 | /** | 330 | /** |
331 | Return translated label for mobilePhone field. | 331 | Return translated label for mobilePhone field. |
332 | */ | 332 | */ |
333 | static QString mobilePhoneLabel(); | 333 | static QString mobilePhoneLabel(); |
334 | static QString mobileWorkPhoneLabel(); | 334 | static QString mobileWorkPhoneLabel(); |
335 | static QString mobileHomePhoneLabel(); | ||
336 | 335 | ||
337 | /** | 336 | /** |
338 | Return translated label for homeFax field. | 337 | Return translated label for homeFax field. |
339 | */ | 338 | */ |
340 | static QString homeFaxLabel(); | 339 | static QString homeFaxLabel(); |
341 | 340 | ||
342 | /** | 341 | /** |
343 | Return translated label for businessFax field. | 342 | Return translated label for businessFax field. |
344 | */ | 343 | */ |
345 | static QString businessFaxLabel(); | 344 | static QString businessFaxLabel(); |
346 | 345 | ||
347 | /** | 346 | |
348 | Return translated label for carPhone field. | ||
349 | */ | ||
350 | static QString carPhoneLabel(); | ||
351 | |||
352 | /** | 347 | /** |
353 | Return translated label for isdn field. | 348 | Return translated label for isdn field. |
354 | */ | 349 | */ |
355 | static QString isdnLabel(); | 350 | static QString isdnLabel(); |
356 | 351 | ||
357 | /** | 352 | /** |
358 | Return translated label for pager field. | 353 | Return translated label for pager field. |
359 | */ | 354 | */ |
360 | static QString pagerLabel(); | 355 | static QString pagerLabel(); |
361 | static QString otherPhoneLabel(); | 356 | static QString otherPhoneLabel(); |
362 | /** | 357 | /** |
363 | Return translated label for sip field. | 358 | Return translated label for sip field. |
364 | */ | 359 | */ |
365 | static QString sipLabel(); | 360 | static QString sipLabel(); |
366 | 361 | ||
367 | /** | 362 | /** |
368 | Return translated label for email field. | 363 | Return translated label for email field. |
369 | */ | 364 | */ |
370 | static QString emailLabel(); | 365 | static QString emailLabel(); |
371 | 366 | ||
372 | /** | 367 | /** |
373 | Set mail client. | 368 | Set mail client. |
374 | */ | 369 | */ |
375 | void setMailer( const QString &mailer ); | 370 | void setMailer( const QString &mailer ); |
376 | /** | 371 | /** |
377 | Return mail client. | 372 | Return mail client. |
378 | */ | 373 | */ |
379 | QString mailer() const; | 374 | QString mailer() const; |
380 | /** | 375 | /** |
381 | Return translated label for mailer field. | 376 | Return translated label for mailer field. |
382 | */ | 377 | */ |
383 | static QString mailerLabel(); | 378 | static QString mailerLabel(); |
384 | 379 | ||
385 | /** | 380 | /** |
386 | Set time zone. | 381 | Set time zone. |
387 | */ | 382 | */ |
388 | void setTimeZone( const TimeZone &timeZone ); | 383 | void setTimeZone( const TimeZone &timeZone ); |
389 | /** | 384 | /** |
390 | Return time zone. | 385 | Return time zone. |
391 | */ | 386 | */ |
392 | TimeZone timeZone() const; | 387 | TimeZone timeZone() const; |
393 | /** | 388 | /** |
394 | Return translated label for timeZone field. | 389 | Return translated label for timeZone field. |
395 | */ | 390 | */ |
396 | static QString timeZoneLabel(); | 391 | static QString timeZoneLabel(); |
397 | 392 | ||
398 | /** | 393 | /** |
399 | Set geographic position. | 394 | Set geographic position. |
400 | */ | 395 | */ |
401 | void setGeo( const Geo &geo ); | 396 | void setGeo( const Geo &geo ); |
402 | /** | 397 | /** |
403 | Return geographic position. | 398 | Return geographic position. |
404 | */ | 399 | */ |
405 | Geo geo() const; | 400 | Geo geo() const; |
406 | /** | 401 | /** |
407 | Return translated label for geo field. | 402 | Return translated label for geo field. |
408 | */ | 403 | */ |
409 | static QString geoLabel(); | 404 | static QString geoLabel(); |
410 | 405 | ||
411 | /** | 406 | /** |
412 | Set title. | 407 | Set title. |
413 | */ | 408 | */ |
414 | void setTitle( const QString &title ); | 409 | void setTitle( const QString &title ); |
415 | /** | 410 | /** |
416 | Return title. | 411 | Return title. |
417 | */ | 412 | */ |
418 | QString title() const; | 413 | QString title() const; |
419 | /** | 414 | /** |
420 | Return translated label for title field. | 415 | Return translated label for title field. |
421 | */ | 416 | */ |
422 | static QString titleLabel(); | 417 | static QString titleLabel(); |
423 | 418 | ||
424 | /** | 419 | /** |
425 | Set role. | 420 | Set role. |
426 | */ | 421 | */ |
427 | void setRole( const QString &role ); | 422 | void setRole( const QString &role ); |
428 | /** | 423 | /** |
429 | Return role. | 424 | Return role. |
430 | */ | 425 | */ |
431 | QString role() const; | 426 | QString role() const; |
432 | /** | 427 | /** |
433 | Return translated label for role field. | 428 | Return translated label for role field. |
434 | */ | 429 | */ |
435 | static QString roleLabel(); | 430 | static QString roleLabel(); |
436 | 431 | ||
437 | /** | 432 | /** |
438 | Set organization. | 433 | Set organization. |
439 | */ | 434 | */ |
440 | void setOrganization( const QString &organization ); | 435 | void setOrganization( const QString &organization ); |
441 | /** | 436 | /** |
442 | Return organization. | 437 | Return organization. |
443 | */ | 438 | */ |
444 | QString organization() const; | 439 | QString organization() const; |
445 | /** | 440 | /** |
446 | Return translated label for organization field. | 441 | Return translated label for organization field. |
447 | */ | 442 | */ |
448 | static QString organizationLabel(); | 443 | static QString organizationLabel(); |
449 | 444 | ||
450 | /** | 445 | /** |
451 | Set note. | 446 | Set note. |
452 | */ | 447 | */ |
453 | void setNote( const QString ¬e ); | 448 | void setNote( const QString ¬e ); |
454 | /** | 449 | /** |
455 | Return note. | 450 | Return note. |
456 | */ | 451 | */ |
457 | QString note() const; | 452 | QString note() const; |
458 | /** | 453 | /** |
459 | Return translated label for note field. | 454 | Return translated label for note field. |
460 | */ | 455 | */ |
461 | static QString noteLabel(); | 456 | static QString noteLabel(); |
462 | 457 | ||
463 | /** | 458 | /** |
464 | Set product identifier. | 459 | Set product identifier. |
465 | */ | 460 | */ |
466 | void setProductId( const QString &productId ); | 461 | void setProductId( const QString &productId ); |
467 | /** | 462 | /** |
468 | Return product identifier. | 463 | Return product identifier. |
469 | */ | 464 | */ |
470 | QString productId() const; | 465 | QString productId() const; |
471 | /** | 466 | /** |
472 | Return translated label for productId field. | 467 | Return translated label for productId field. |
473 | */ | 468 | */ |
474 | static QString productIdLabel(); | 469 | static QString productIdLabel(); |
475 | 470 | ||
476 | /** | 471 | /** |
477 | Set revision date. | 472 | Set revision date. |
478 | */ | 473 | */ |
479 | void setRevision( const QDateTime &revision ); | 474 | void setRevision( const QDateTime &revision ); |
480 | /** | 475 | /** |
481 | Return revision date. | 476 | Return revision date. |
482 | */ | 477 | */ |
483 | QDateTime revision() const; | 478 | QDateTime revision() const; |
484 | /** | 479 | /** |
485 | Return translated label for revision field. | 480 | Return translated label for revision field. |
486 | */ | 481 | */ |
487 | static QString revisionLabel(); | 482 | static QString revisionLabel(); |
488 | 483 | ||
489 | /** | 484 | /** |
490 | Set sort string. | 485 | Set sort string. |
491 | */ | 486 | */ |
492 | void setSortString( const QString &sortString ); | 487 | void setSortString( const QString &sortString ); |
493 | /** | 488 | /** |
494 | Return sort string. | 489 | Return sort string. |
495 | */ | 490 | */ |
496 | QString sortString() const; | 491 | QString sortString() const; |
497 | /** | 492 | /** |
498 | Return translated label for sortString field. | 493 | Return translated label for sortString field. |
499 | */ | 494 | */ |
500 | static QString sortStringLabel(); | 495 | static QString sortStringLabel(); |
501 | 496 | ||
502 | /** | 497 | /** |
503 | Set URL. | 498 | Set URL. |
504 | */ | 499 | */ |
505 | void setUrl( const KURL &url ); | 500 | void setUrl( const KURL &url ); |
506 | /** | 501 | /** |
507 | Return URL. | 502 | Return URL. |
508 | */ | 503 | */ |
509 | KURL url() const; | 504 | KURL url() const; |
510 | /** | 505 | /** |
511 | Return translated label for url field. | 506 | Return translated label for url field. |
512 | */ | 507 | */ |
513 | static QString urlLabel(); | 508 | static QString urlLabel(); |
514 | 509 | ||
515 | /** | 510 | /** |
516 | Set security class. | 511 | Set security class. |
517 | */ | 512 | */ |
518 | void setSecrecy( const Secrecy &secrecy ); | 513 | void setSecrecy( const Secrecy &secrecy ); |
519 | /** | 514 | /** |
520 | Return security class. | 515 | Return security class. |
521 | */ | 516 | */ |
522 | Secrecy secrecy() const; | 517 | Secrecy secrecy() const; |
523 | /** | 518 | /** |
524 | Return translated label for secrecy field. | 519 | Return translated label for secrecy field. |
525 | */ | 520 | */ |
526 | static QString secrecyLabel(); | 521 | static QString secrecyLabel(); |
527 | 522 | ||
528 | /** | 523 | /** |
529 | Set logo. | 524 | Set logo. |
530 | */ | 525 | */ |
531 | void setLogo( const Picture &logo ); | 526 | void setLogo( const Picture &logo ); |
532 | /** | 527 | /** |
533 | Return logo. | 528 | Return logo. |
534 | */ | 529 | */ |
535 | Picture logo() const; | 530 | Picture logo() const; |
536 | /** | 531 | /** |
537 | Return translated label for logo field. | 532 | Return translated label for logo field. |
538 | */ | 533 | */ |
539 | static QString logoLabel(); | 534 | static QString logoLabel(); |
540 | 535 | ||
541 | /** | 536 | /** |
542 | Set photo. | 537 | Set photo. |
543 | */ | 538 | */ |
544 | void setPhoto( const Picture &photo ); | 539 | void setPhoto( const Picture &photo ); |
545 | /** | 540 | /** |
546 | Return photo. | 541 | Return photo. |
547 | */ | 542 | */ |
548 | Picture photo() const; | 543 | Picture photo() const; |
549 | /** | 544 | /** |
550 | Return translated label for photo field. | 545 | Return translated label for photo field. |
551 | */ | 546 | */ |
552 | static QString photoLabel(); | 547 | static QString photoLabel(); |
553 | 548 | ||
554 | /** | 549 | /** |
555 | Set sound. | 550 | Set sound. |
556 | */ | 551 | */ |
557 | void setSound( const Sound &sound ); | 552 | void setSound( const Sound &sound ); |
558 | /** | 553 | /** |
559 | Return sound. | 554 | Return sound. |
560 | */ | 555 | */ |
561 | Sound sound() const; | 556 | Sound sound() const; |
562 | /** | 557 | /** |
563 | Return translated label for sound field. | 558 | Return translated label for sound field. |
564 | */ | 559 | */ |
565 | static QString soundLabel(); | 560 | static QString soundLabel(); |
566 | 561 | ||
567 | /** | 562 | /** |
568 | Set agent. | 563 | Set agent. |
569 | */ | 564 | */ |
570 | void setAgent( const Agent &agent ); | 565 | void setAgent( const Agent &agent ); |
571 | /** | 566 | /** |
572 | Return agent. | 567 | Return agent. |
573 | */ | 568 | */ |
574 | Agent agent() const; | 569 | Agent agent() const; |
575 | /** | 570 | /** |
576 | Return translated label for agent field. | 571 | Return translated label for agent field. |
577 | */ | 572 | */ |
578 | static QString agentLabel(); | 573 | static QString agentLabel(); |
579 | 574 | ||
580 | /** | 575 | /** |
581 | Set name fields by parsing the given string and trying to associate the | 576 | Set name fields by parsing the given string and trying to associate the |
582 | parts of the string with according fields. This function should probably | 577 | parts of the string with according fields. This function should probably |
583 | be a bit more clever. | 578 | be a bit more clever. |
584 | */ | 579 | */ |
585 | void setNameFromString( const QString & ); | 580 | void setNameFromString( const QString & ); |
586 | 581 | ||
587 | /** | 582 | /** |
588 | Return the name of the addressee. This is calculated from all the name | 583 | Return the name of the addressee. This is calculated from all the name |
589 | fields. | 584 | fields. |
590 | */ | 585 | */ |
591 | QString realName() const; | 586 | QString realName() const; |
592 | 587 | ||
593 | /** | 588 | /** |
594 | Return the name that consists of all name parts. | 589 | Return the name that consists of all name parts. |
595 | */ | 590 | */ |
596 | QString assembledName() const; | 591 | QString assembledName() const; |
597 | 592 | ||
598 | /** | 593 | /** |
599 | Return email address including real name. | 594 | Return email address including real name. |
600 | 595 | ||
601 | @param email Email address to be used to construct the full email string. | 596 | @param email Email address to be used to construct the full email string. |
602 | If this is QString::null the preferred email address is used. | 597 | If this is QString::null the preferred email address is used. |
603 | */ | 598 | */ |
604 | QString fullEmail( const QString &email=QString::null ) const; | 599 | QString fullEmail( const QString &email=QString::null ) const; |
605 | 600 | ||
606 | /** | 601 | /** |
607 | Insert an email address. If the email address already exists in this | 602 | Insert an email address. If the email address already exists in this |
608 | addressee it is not duplicated. | 603 | addressee it is not duplicated. |
609 | 604 | ||
610 | @param email Email address | 605 | @param email Email address |
611 | @param preferred Set to true, if this is the preferred email address of | 606 | @param preferred Set to true, if this is the preferred email address of |
612 | the addressee. | 607 | the addressee. |
613 | */ | 608 | */ |
614 | void insertEmail( const QString &email, bool preferred=false ); | 609 | void insertEmail( const QString &email, bool preferred=false ); |
615 | 610 | ||
616 | /** | 611 | /** |
617 | Remove email address. If the email address doesn't exist, nothing happens. | 612 | Remove email address. If the email address doesn't exist, nothing happens. |
618 | */ | 613 | */ |
619 | void removeEmail( const QString &email ); | 614 | void removeEmail( const QString &email ); |
620 | 615 | ||
621 | /** | 616 | /** |
622 | Return preferred email address. This is the first email address or the | 617 | Return preferred email address. This is the first email address or the |
623 | last one added with @ref insertEmail() with a set preferred parameter. | 618 | last one added with @ref insertEmail() with a set preferred parameter. |
624 | */ | 619 | */ |
625 | QString preferredEmail() const; | 620 | QString preferredEmail() const; |
626 | 621 | ||
627 | /** | 622 | /** |
628 | Return list of all email addresses. | 623 | Return list of all email addresses. |
629 | */ | 624 | */ |
630 | QStringList emails() const; | 625 | QStringList emails() const; |
631 | 626 | ||
632 | /** | 627 | /** |
633 | Set the emails to @param. | 628 | Set the emails to @param. |
634 | The first email address gets the preferred one! | 629 | The first email address gets the preferred one! |
635 | @param list The list of email addresses. | 630 | @param list The list of email addresses. |
636 | */ | 631 | */ |
637 | void setEmails( const QStringList& list); | 632 | void setEmails( const QStringList& list); |
638 | 633 | ||
639 | /** | 634 | /** |
640 | Insert a phone number. If a phone number with the same id already exists | 635 | Insert a phone number. If a phone number with the same id already exists |
641 | in this addressee it is not duplicated. | 636 | in this addressee it is not duplicated. |
642 | */ | 637 | */ |
643 | void insertPhoneNumber( const PhoneNumber &phoneNumber ); | 638 | void insertPhoneNumber( const PhoneNumber &phoneNumber ); |
644 | 639 | ||
645 | /** | 640 | /** |
646 | Remove phone number. If no phone number with the given id exists for this | 641 | Remove phone number. If no phone number with the given id exists for this |
647 | addresse nothing happens. | 642 | addresse nothing happens. |
648 | */ | 643 | */ |
649 | void removePhoneNumber( const PhoneNumber &phoneNumber ); | 644 | void removePhoneNumber( const PhoneNumber &phoneNumber ); |
650 | 645 | ||
651 | /** | 646 | /** |
652 | Return phone number, which matches the given type. | 647 | Return phone number, which matches the given type. |
653 | */ | 648 | */ |
654 | PhoneNumber phoneNumber( int type ) const; | 649 | PhoneNumber phoneNumber( int type ) const; |
655 | 650 | ||
656 | bool matchPhoneNumber( QRegExp* searchExp ) const; | 651 | bool matchPhoneNumber( QRegExp* searchExp ) const; |
657 | bool matchAddress( QRegExp* searchExp ) const; | 652 | bool matchAddress( QRegExp* searchExp ) const; |
658 | 653 | ||
659 | /** | 654 | /** |
660 | Return list of all phone numbers. | 655 | Return list of all phone numbers. |
661 | */ | 656 | */ |
662 | PhoneNumber::List phoneNumbers() const; | 657 | PhoneNumber::List phoneNumbers() const; |
663 | 658 | ||
664 | /** | 659 | /** |
665 | Return list of phone numbers with a special type. | 660 | Return list of phone numbers with a special type. |
666 | */ | 661 | */ |
667 | PhoneNumber::List phoneNumbers( int type ) const; | 662 | PhoneNumber::List phoneNumbers( int type ) const; |
668 | 663 | ||
669 | /** | 664 | /** |
670 | Return phone number with the given id. | 665 | Return phone number with the given id. |
671 | */ | 666 | */ |
672 | PhoneNumber findPhoneNumber( const QString &id ) const; | 667 | PhoneNumber findPhoneNumber( const QString &id ) const; |
673 | 668 | ||
674 | /** | 669 | /** |
675 | Insert a key. If a key with the same id already exists | 670 | Insert a key. If a key with the same id already exists |
676 | in this addressee it is not duplicated. | 671 | in this addressee it is not duplicated. |
677 | */ | 672 | */ |
678 | void insertKey( const Key &key ); | 673 | void insertKey( const Key &key ); |
679 | 674 | ||
680 | /** | 675 | /** |
681 | Remove a key. If no key with the given id exists for this | 676 | Remove a key. If no key with the given id exists for this |
682 | addresse nothing happens. | 677 | addresse nothing happens. |
683 | */ | 678 | */ |
684 | void removeKey( const Key &key ); | 679 | void removeKey( const Key &key ); |
685 | 680 | ||
686 | /** | 681 | /** |
687 | Return key, which matches the given type. | 682 | Return key, which matches the given type. |
688 | If @p type == Key::Custom you can specify a string | 683 | If @p type == Key::Custom you can specify a string |
689 | that should match. If you leave the string empty, the first | 684 | that should match. If you leave the string empty, the first |
690 | key with a custom value is returned. | 685 | key with a custom value is returned. |
691 | */ | 686 | */ |
692 | Key key( int type, QString customTypeString = QString::null ) const; | 687 | Key key( int type, QString customTypeString = QString::null ) const; |
693 | 688 | ||
694 | /** | 689 | /** |
695 | Return list of all keys. | 690 | Return list of all keys. |
696 | */ | 691 | */ |
697 | Key::List keys() const; | 692 | Key::List keys() const; |
698 | 693 | ||
699 | /** | 694 | /** |
700 | Set the list of keys | 695 | Set the list of keys |
701 | @param keys The keys to be set. | 696 | @param keys The keys to be set. |
702 | */ | 697 | */ |
703 | void setKeys( const Key::List& keys); | 698 | void setKeys( const Key::List& keys); |
704 | 699 | ||
705 | /** | 700 | /** |
706 | Return list of keys with a special type. | 701 | Return list of keys with a special type. |
707 | If @p type == Key::Custom you can specify a string | 702 | If @p type == Key::Custom you can specify a string |
708 | that should match. If you leave the string empty, all custom | 703 | that should match. If you leave the string empty, all custom |
709 | keys will be returned. | 704 | keys will be returned. |
710 | */ | 705 | */ |
711 | Key::List keys( int type, QString customTypeString = QString::null ) const; | 706 | Key::List keys( int type, QString customTypeString = QString::null ) const; |
712 | 707 | ||
713 | /** | 708 | /** |
714 | Return key with the given id. | 709 | Return key with the given id. |
715 | */ | 710 | */ |
716 | Key findKey( const QString &id ) const; | 711 | Key findKey( const QString &id ) const; |
717 | 712 | ||
718 | /** | 713 | /** |
719 | Insert an address. If an address with the same id already exists | 714 | Insert an address. If an address with the same id already exists |
720 | in this addressee it is not duplicated. | 715 | in this addressee it is not duplicated. |
721 | */ | 716 | */ |
722 | void insertAddress( const Address &address ); | 717 | void insertAddress( const Address &address ); |
723 | 718 | ||
724 | /** | 719 | /** |
725 | Remove address. If no address with the given id exists for this | 720 | Remove address. If no address with the given id exists for this |
726 | addresse nothing happens. | 721 | addresse nothing happens. |
727 | */ | 722 | */ |
728 | void removeAddress( const Address &address ); | 723 | void removeAddress( const Address &address ); |
729 | 724 | ||
730 | /** | 725 | /** |
731 | Return address, which matches the given type. | 726 | Return address, which matches the given type. |
732 | */ | 727 | */ |
733 | Address address( int type ) const; | 728 | Address address( int type ) const; |
734 | 729 | ||
735 | /** | 730 | /** |
736 | Return list of all addresses. | 731 | Return list of all addresses. |
737 | */ | 732 | */ |
738 | Address::List addresses() const; | 733 | Address::List addresses() const; |
739 | 734 | ||
740 | /** | 735 | /** |
741 | Return list of addresses with a special type. | 736 | Return list of addresses with a special type. |
742 | */ | 737 | */ |
743 | Address::List addresses( int type ) const; | 738 | Address::List addresses( int type ) const; |
744 | 739 | ||
745 | /** | 740 | /** |
746 | Return address with the given id. | 741 | Return address with the given id. |
747 | */ | 742 | */ |
748 | Address findAddress( const QString &id ) const; | 743 | Address findAddress( const QString &id ) const; |
749 | 744 | ||
750 | /** | 745 | /** |
751 | Insert category. If the category already exists it is not duplicated. | 746 | Insert category. If the category already exists it is not duplicated. |
752 | */ | 747 | */ |
753 | void insertCategory( const QString & ); | 748 | void insertCategory( const QString & ); |
754 | 749 | ||
755 | /** | 750 | /** |
756 | Remove category. | 751 | Remove category. |
757 | */ | 752 | */ |
758 | void removeCategory( const QString & ); | 753 | void removeCategory( const QString & ); |
759 | 754 | ||
760 | /** | 755 | /** |
761 | Return, if addressee has the given category. | 756 | Return, if addressee has the given category. |
762 | */ | 757 | */ |
763 | bool hasCategory( const QString & ) const; | 758 | bool hasCategory( const QString & ) const; |
764 | 759 | ||
765 | /** | 760 | /** |
766 | Set categories to given value. | 761 | Set categories to given value. |
767 | */ | 762 | */ |
768 | void setCategories( const QStringList & ); | 763 | void setCategories( const QStringList & ); |
769 | 764 | ||
770 | /** | 765 | /** |
771 | Return list of all set categories. | 766 | Return list of all set categories. |
772 | */ | 767 | */ |
773 | QStringList categories() const; | 768 | QStringList categories() const; |
774 | 769 | ||
775 | /** | 770 | /** |
776 | Insert custom entry. The entry is identified by the name of the inserting | 771 | Insert custom entry. The entry is identified by the name of the inserting |
777 | application and a unique name. If an entry with the given app and name | 772 | application and a unique name. If an entry with the given app and name |
778 | already exists its value is replaced with the new given value. | 773 | already exists its value is replaced with the new given value. |
779 | */ | 774 | */ |
780 | void insertCustom( const QString &app, const QString &name, | 775 | void insertCustom( const QString &app, const QString &name, |
781 | const QString &value ); | 776 | const QString &value ); |
782 | 777 | ||
783 | /** | 778 | /** |
784 | Remove custom entry. | 779 | Remove custom entry. |
785 | */ | 780 | */ |
786 | void removeCustom( const QString &app, const QString &name ); | 781 | void removeCustom( const QString &app, const QString &name ); |
787 | 782 | ||
788 | /** | 783 | /** |
789 | Return value of custom entry, identified by app and entry name. | 784 | Return value of custom entry, identified by app and entry name. |
790 | */ | 785 | */ |
791 | QString custom( const QString &app, const QString &name ) const; | 786 | QString custom( const QString &app, const QString &name ) const; |
792 | 787 | ||
793 | /** | 788 | /** |
794 | Set all custom entries. | 789 | Set all custom entries. |
795 | */ | 790 | */ |
796 | void setCustoms( const QStringList & ); | 791 | void setCustoms( const QStringList & ); |
797 | 792 | ||
798 | /** | 793 | /** |
799 | Return list of all custom entries. | 794 | Return list of all custom entries. |
800 | */ | 795 | */ |
801 | QStringList customs() const; | 796 | QStringList customs() const; |
802 | 797 | ||
803 | /** | 798 | /** |
804 | Parse full email address. The result is given back in fullName and email. | 799 | Parse full email address. The result is given back in fullName and email. |
805 | */ | 800 | */ |
806 | static void parseEmailAddress( const QString &rawEmail, QString &fullName, | 801 | static void parseEmailAddress( const QString &rawEmail, QString &fullName, |
807 | QString &email ); | 802 | QString &email ); |
808 | 803 | ||
809 | /** | 804 | /** |
810 | Debug output. | 805 | Debug output. |
811 | */ | 806 | */ |
812 | void dump() const; | 807 | void dump() const; |
813 | 808 | ||
814 | /** | 809 | /** |
815 | Returns string representation of the addressee. | 810 | Returns string representation of the addressee. |
816 | */ | 811 | */ |
817 | QString asString() const; | 812 | QString asString() const; |
818 | 813 | ||
819 | /** | 814 | /** |
820 | Set resource where the addressee is from. | 815 | Set resource where the addressee is from. |
821 | */ | 816 | */ |
822 | void setResource( Resource *resource ); | 817 | void setResource( Resource *resource ); |
823 | 818 | ||
824 | /** | 819 | /** |
825 | Return pointer to resource. | 820 | Return pointer to resource. |
826 | */ | 821 | */ |
827 | Resource *resource() const; | 822 | Resource *resource() const; |
828 | 823 | ||
829 | /** | 824 | /** |
830 | Return resourcelabel. | 825 | Return resourcelabel. |
831 | */ | 826 | */ |
832 | //US | 827 | //US |
833 | static QString resourceLabel(); | 828 | static QString resourceLabel(); |
834 | static QString categoryLabel(); | 829 | static QString categoryLabel(); |
835 | /** | 830 | /** |
836 | Mark addressee as changed. | 831 | Mark addressee as changed. |
837 | */ | 832 | */ |
838 | void setChanged( bool value ); | 833 | void setChanged( bool value ); |
839 | 834 | ||
840 | /** | 835 | /** |
841 | Return whether the addressee is changed. | 836 | Return whether the addressee is changed. |
842 | */ | 837 | */ |
843 | bool changed() const; | 838 | bool changed() const; |
844 | 839 | ||
845 | void setTagged( bool value ); | 840 | void setTagged( bool value ); |
846 | bool tagged() const; | 841 | bool tagged() const; |
847 | 842 | ||
848 | private: | 843 | private: |
849 | Addressee copy(); | 844 | Addressee copy(); |
850 | void detach(); | 845 | void detach(); |
851 | 846 | ||
852 | struct AddresseeData; | 847 | struct AddresseeData; |
853 | mutable KSharedPtr<AddresseeData> mData; | 848 | mutable KSharedPtr<AddresseeData> mData; |
854 | }; | 849 | }; |
855 | 850 | ||
856 | QDataStream &operator<<( QDataStream &, const Addressee & ); | 851 | QDataStream &operator<<( QDataStream &, const Addressee & ); |
857 | QDataStream &operator>>( QDataStream &, Addressee & ); | 852 | QDataStream &operator>>( QDataStream &, Addressee & ); |
858 | 853 | ||
859 | } | 854 | } |
860 | 855 | ||
861 | #endif | 856 | #endif |
diff --git a/kabc/field.cpp b/kabc/field.cpp index 6f2b307..7c6d7a9 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp | |||
@@ -1,596 +1,584 @@ | |||
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) 2002 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2002 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 <klocale.h> | 29 | #include <klocale.h> |
30 | #include <kconfig.h> | 30 | #include <kconfig.h> |
31 | #include <kconfigbase.h> | 31 | #include <kconfigbase.h> |
32 | #include <kglobal.h> | 32 | #include <kglobal.h> |
33 | 33 | ||
34 | #include "field.h" | 34 | #include "field.h" |
35 | #include "resource.h" | 35 | #include "resource.h" |
36 | 36 | ||
37 | using namespace KABC; | 37 | using namespace KABC; |
38 | 38 | ||
39 | class Field::FieldImpl | 39 | class Field::FieldImpl |
40 | { | 40 | { |
41 | public: | 41 | public: |
42 | FieldImpl( int fieldId, int category = 0, | 42 | FieldImpl( int fieldId, int category = 0, |
43 | const QString &label = QString::null, | 43 | const QString &label = QString::null, |
44 | const QString &key = QString::null, | 44 | const QString &key = QString::null, |
45 | const QString &app = QString::null ) | 45 | const QString &app = QString::null ) |
46 | : mFieldId( fieldId ), mCategory( category ), mLabel( label ), | 46 | : mFieldId( fieldId ), mCategory( category ), mLabel( label ), |
47 | mKey( key ), mApp( app ) {} | 47 | mKey( key ), mApp( app ) {} |
48 | 48 | ||
49 | enum FieldId | 49 | enum FieldId |
50 | { | 50 | { |
51 | CustomField, | 51 | CustomField, |
52 | FormattedName, | 52 | FormattedName, |
53 | FamilyName, | 53 | FamilyName, |
54 | GivenName, | 54 | GivenName, |
55 | AdditionalName, | 55 | AdditionalName, |
56 | Prefix, | 56 | Prefix, |
57 | Suffix, | 57 | Suffix, |
58 | NickName, | 58 | NickName, |
59 | Birthday, | 59 | Birthday, |
60 | Category, | 60 | Category, |
61 | HomeAddressStreet, | 61 | HomeAddressStreet, |
62 | HomeAddressLocality, | 62 | HomeAddressLocality, |
63 | HomeAddressRegion, | 63 | HomeAddressRegion, |
64 | HomeAddressPostalCode, | 64 | HomeAddressPostalCode, |
65 | HomeAddressCountry, | 65 | HomeAddressCountry, |
66 | HomeAddressLabel, | 66 | HomeAddressLabel, |
67 | BusinessAddressStreet, | 67 | BusinessAddressStreet, |
68 | BusinessAddressLocality, | 68 | BusinessAddressLocality, |
69 | BusinessAddressRegion, | 69 | BusinessAddressRegion, |
70 | BusinessAddressPostalCode, | 70 | BusinessAddressPostalCode, |
71 | BusinessAddressCountry, | 71 | BusinessAddressCountry, |
72 | BusinessAddressLabel, | 72 | BusinessAddressLabel, |
73 | HomePhone, | 73 | HomePhone, |
74 | BusinessPhone, | 74 | BusinessPhone, |
75 | MobilePhone, | 75 | MobilePhone, |
76 | HomeFax, | 76 | HomeFax, |
77 | BusinessFax, | 77 | BusinessFax, |
78 | CarPhone, | ||
79 | Isdn, | 78 | Isdn, |
80 | Pager, | 79 | Pager, |
81 | Email, | 80 | Email, |
82 | Mailer, | 81 | Mailer, |
83 | Title, | 82 | Title, |
84 | Role, | 83 | Role, |
85 | Organization, | 84 | Organization, |
86 | Note, | 85 | Note, |
87 | Url, | 86 | Url, |
88 | Resource, | 87 | Resource, |
89 | Sip, | 88 | Sip, |
90 | MobileWorkPhone, | 89 | MobileWorkPhone, |
91 | MobileHomePhone, | ||
92 | OtherPhone | 90 | OtherPhone |
93 | }; | 91 | }; |
94 | 92 | ||
95 | int fieldId() { return mFieldId; } | 93 | int fieldId() { return mFieldId; } |
96 | int category() { return mCategory; } | 94 | int category() { return mCategory; } |
97 | 95 | ||
98 | QString label() { return mLabel; } | 96 | QString label() { return mLabel; } |
99 | QString key() { return mKey; } | 97 | QString key() { return mKey; } |
100 | QString app() { return mApp; } | 98 | QString app() { return mApp; } |
101 | 99 | ||
102 | private: | 100 | private: |
103 | int mFieldId; | 101 | int mFieldId; |
104 | int mCategory; | 102 | int mCategory; |
105 | 103 | ||
106 | QString mLabel; | 104 | QString mLabel; |
107 | QString mKey; | 105 | QString mKey; |
108 | QString mApp; | 106 | QString mApp; |
109 | }; | 107 | }; |
110 | 108 | ||
111 | 109 | ||
112 | Field::List Field::mAllFields; | 110 | Field::List Field::mAllFields; |
113 | Field::List Field::mDefaultFields; | 111 | Field::List Field::mDefaultFields; |
114 | Field::List Field::mCustomFields; | 112 | Field::List Field::mCustomFields; |
115 | 113 | ||
116 | 114 | ||
117 | Field::Field( FieldImpl *impl ) | 115 | Field::Field( FieldImpl *impl ) |
118 | { | 116 | { |
119 | mImpl = impl; | 117 | mImpl = impl; |
120 | } | 118 | } |
121 | 119 | ||
122 | Field::~Field() | 120 | Field::~Field() |
123 | { | 121 | { |
124 | delete mImpl; | 122 | delete mImpl; |
125 | } | 123 | } |
126 | 124 | ||
127 | QString Field::label() | 125 | QString Field::label() |
128 | { | 126 | { |
129 | switch ( mImpl->fieldId() ) { | 127 | switch ( mImpl->fieldId() ) { |
130 | case FieldImpl::FormattedName: | 128 | case FieldImpl::FormattedName: |
131 | return Addressee::formattedNameLabel(); | 129 | return Addressee::formattedNameLabel(); |
132 | case FieldImpl::FamilyName: | 130 | case FieldImpl::FamilyName: |
133 | return Addressee::familyNameLabel(); | 131 | return Addressee::familyNameLabel(); |
134 | case FieldImpl::GivenName: | 132 | case FieldImpl::GivenName: |
135 | return Addressee::givenNameLabel(); | 133 | return Addressee::givenNameLabel(); |
136 | case FieldImpl::AdditionalName: | 134 | case FieldImpl::AdditionalName: |
137 | return Addressee::additionalNameLabel(); | 135 | return Addressee::additionalNameLabel(); |
138 | case FieldImpl::Prefix: | 136 | case FieldImpl::Prefix: |
139 | return Addressee::prefixLabel(); | 137 | return Addressee::prefixLabel(); |
140 | case FieldImpl::Suffix: | 138 | case FieldImpl::Suffix: |
141 | return Addressee::suffixLabel(); | 139 | return Addressee::suffixLabel(); |
142 | case FieldImpl::NickName: | 140 | case FieldImpl::NickName: |
143 | return Addressee::nickNameLabel(); | 141 | return Addressee::nickNameLabel(); |
144 | case FieldImpl::Birthday: | 142 | case FieldImpl::Birthday: |
145 | return Addressee::birthdayLabel(); | 143 | return Addressee::birthdayLabel(); |
146 | case FieldImpl::HomeAddressStreet: | 144 | case FieldImpl::HomeAddressStreet: |
147 | return Addressee::homeAddressStreetLabel(); | 145 | return Addressee::homeAddressStreetLabel(); |
148 | case FieldImpl::HomeAddressLocality: | 146 | case FieldImpl::HomeAddressLocality: |
149 | return Addressee::homeAddressLocalityLabel(); | 147 | return Addressee::homeAddressLocalityLabel(); |
150 | case FieldImpl::HomeAddressRegion: | 148 | case FieldImpl::HomeAddressRegion: |
151 | return Addressee::homeAddressRegionLabel(); | 149 | return Addressee::homeAddressRegionLabel(); |
152 | case FieldImpl::HomeAddressPostalCode: | 150 | case FieldImpl::HomeAddressPostalCode: |
153 | return Addressee::homeAddressPostalCodeLabel(); | 151 | return Addressee::homeAddressPostalCodeLabel(); |
154 | case FieldImpl::HomeAddressCountry: | 152 | case FieldImpl::HomeAddressCountry: |
155 | return Addressee::homeAddressCountryLabel(); | 153 | return Addressee::homeAddressCountryLabel(); |
156 | case FieldImpl::HomeAddressLabel: | 154 | case FieldImpl::HomeAddressLabel: |
157 | return Addressee::homeAddressLabelLabel(); | 155 | return Addressee::homeAddressLabelLabel(); |
158 | case FieldImpl::BusinessAddressStreet: | 156 | case FieldImpl::BusinessAddressStreet: |
159 | return Addressee::businessAddressStreetLabel(); | 157 | return Addressee::businessAddressStreetLabel(); |
160 | case FieldImpl::BusinessAddressLocality: | 158 | case FieldImpl::BusinessAddressLocality: |
161 | return Addressee::businessAddressLocalityLabel(); | 159 | return Addressee::businessAddressLocalityLabel(); |
162 | case FieldImpl::BusinessAddressRegion: | 160 | case FieldImpl::BusinessAddressRegion: |
163 | return Addressee::businessAddressRegionLabel(); | 161 | return Addressee::businessAddressRegionLabel(); |
164 | case FieldImpl::BusinessAddressPostalCode: | 162 | case FieldImpl::BusinessAddressPostalCode: |
165 | return Addressee::businessAddressPostalCodeLabel(); | 163 | return Addressee::businessAddressPostalCodeLabel(); |
166 | case FieldImpl::BusinessAddressCountry: | 164 | case FieldImpl::BusinessAddressCountry: |
167 | return Addressee::businessAddressCountryLabel(); | 165 | return Addressee::businessAddressCountryLabel(); |
168 | case FieldImpl::BusinessAddressLabel: | 166 | case FieldImpl::BusinessAddressLabel: |
169 | return Addressee::businessAddressLabelLabel(); | 167 | return Addressee::businessAddressLabelLabel(); |
170 | case FieldImpl::HomePhone: | 168 | case FieldImpl::HomePhone: |
171 | return Addressee::homePhoneLabel(); | 169 | return Addressee::homePhoneLabel(); |
172 | case FieldImpl::BusinessPhone: | 170 | case FieldImpl::BusinessPhone: |
173 | return Addressee::businessPhoneLabel(); | 171 | return Addressee::businessPhoneLabel(); |
174 | case FieldImpl::MobilePhone: | 172 | case FieldImpl::MobilePhone: |
175 | return Addressee::mobilePhoneLabel(); | 173 | return Addressee::mobilePhoneLabel(); |
176 | case FieldImpl::MobileHomePhone: | ||
177 | return Addressee::mobileHomePhoneLabel(); | ||
178 | case FieldImpl::MobileWorkPhone: | 174 | case FieldImpl::MobileWorkPhone: |
179 | return Addressee::mobileWorkPhoneLabel(); | 175 | return Addressee::mobileWorkPhoneLabel(); |
180 | case FieldImpl::HomeFax: | 176 | case FieldImpl::HomeFax: |
181 | return Addressee::homeFaxLabel(); | 177 | return Addressee::homeFaxLabel(); |
182 | case FieldImpl::BusinessFax: | 178 | case FieldImpl::BusinessFax: |
183 | return Addressee::businessFaxLabel(); | 179 | return Addressee::businessFaxLabel(); |
184 | case FieldImpl::CarPhone: | ||
185 | return Addressee::carPhoneLabel(); | ||
186 | case FieldImpl::Isdn: | 180 | case FieldImpl::Isdn: |
187 | return Addressee::isdnLabel(); | 181 | return Addressee::isdnLabel(); |
188 | case FieldImpl::Pager: | 182 | case FieldImpl::Pager: |
189 | return Addressee::pagerLabel(); | 183 | return Addressee::pagerLabel(); |
190 | case FieldImpl::Email: | 184 | case FieldImpl::Email: |
191 | return Addressee::emailLabel(); | 185 | return Addressee::emailLabel(); |
192 | case FieldImpl::Mailer: | 186 | case FieldImpl::Mailer: |
193 | return Addressee::mailerLabel(); | 187 | return Addressee::mailerLabel(); |
194 | case FieldImpl::Title: | 188 | case FieldImpl::Title: |
195 | return Addressee::titleLabel(); | 189 | return Addressee::titleLabel(); |
196 | case FieldImpl::Role: | 190 | case FieldImpl::Role: |
197 | return Addressee::roleLabel(); | 191 | return Addressee::roleLabel(); |
198 | case FieldImpl::Organization: | 192 | case FieldImpl::Organization: |
199 | return Addressee::organizationLabel(); | 193 | return Addressee::organizationLabel(); |
200 | case FieldImpl::Note: | 194 | case FieldImpl::Note: |
201 | return Addressee::noteLabel(); | 195 | return Addressee::noteLabel(); |
202 | case FieldImpl::Url: | 196 | case FieldImpl::Url: |
203 | return Addressee::urlLabel(); | 197 | return Addressee::urlLabel(); |
204 | case FieldImpl::Resource: | 198 | case FieldImpl::Resource: |
205 | return Addressee::resourceLabel(); | 199 | return Addressee::resourceLabel(); |
206 | case FieldImpl::Category: | 200 | case FieldImpl::Category: |
207 | return Addressee::categoryLabel(); | 201 | return Addressee::categoryLabel(); |
208 | case FieldImpl::Sip: | 202 | case FieldImpl::Sip: |
209 | return Addressee::sipLabel(); | 203 | return Addressee::sipLabel(); |
210 | case FieldImpl::OtherPhone: | 204 | case FieldImpl::OtherPhone: |
211 | return Addressee::otherPhoneLabel(); | 205 | return Addressee::otherPhoneLabel(); |
212 | case FieldImpl::CustomField: | 206 | case FieldImpl::CustomField: |
213 | return mImpl->label(); | 207 | return mImpl->label(); |
214 | default: | 208 | default: |
215 | return i18n("Unknown Field"); | 209 | return i18n("Unknown Field"); |
216 | } | 210 | } |
217 | } | 211 | } |
218 | 212 | ||
219 | int Field::category() | 213 | int Field::category() |
220 | { | 214 | { |
221 | return mImpl->category(); | 215 | return mImpl->category(); |
222 | } | 216 | } |
223 | 217 | ||
224 | QString Field::categoryLabel( int category ) | 218 | QString Field::categoryLabel( int category ) |
225 | { | 219 | { |
226 | switch ( category ) { | 220 | switch ( category ) { |
227 | case All: | 221 | case All: |
228 | return i18n("All"); | 222 | return i18n("All"); |
229 | case Frequent: | 223 | case Frequent: |
230 | return i18n("Frequent"); | 224 | return i18n("Frequent"); |
231 | case Address: | 225 | case Address: |
232 | return i18n("Address"); | 226 | return i18n("Address"); |
233 | case Email: | 227 | case Email: |
234 | return i18n("Email"); | 228 | return i18n("Email"); |
235 | case Personal: | 229 | case Personal: |
236 | return i18n("Personal"); | 230 | return i18n("Personal"); |
237 | case Organization: | 231 | case Organization: |
238 | return i18n("Organization"); | 232 | return i18n("Organization"); |
239 | case CustomCategory: | 233 | case CustomCategory: |
240 | return i18n("Custom"); | 234 | return i18n("Custom"); |
241 | default: | 235 | default: |
242 | return i18n("Undefined"); | 236 | return i18n("Undefined"); |
243 | } | 237 | } |
244 | } | 238 | } |
245 | 239 | ||
246 | QString Field::value( const KABC::Addressee &a ) | 240 | QString Field::value( const KABC::Addressee &a ) |
247 | { | 241 | { |
248 | switch ( mImpl->fieldId() ) { | 242 | switch ( mImpl->fieldId() ) { |
249 | case FieldImpl::FormattedName: | 243 | case FieldImpl::FormattedName: |
250 | return a.formattedName(); | 244 | return a.formattedName(); |
251 | case FieldImpl::FamilyName: | 245 | case FieldImpl::FamilyName: |
252 | return a.familyName(); | 246 | return a.familyName(); |
253 | case FieldImpl::GivenName: | 247 | case FieldImpl::GivenName: |
254 | return a.givenName(); | 248 | return a.givenName(); |
255 | case FieldImpl::AdditionalName: | 249 | case FieldImpl::AdditionalName: |
256 | return a.additionalName(); | 250 | return a.additionalName(); |
257 | case FieldImpl::Prefix: | 251 | case FieldImpl::Prefix: |
258 | return a.prefix(); | 252 | return a.prefix(); |
259 | case FieldImpl::Suffix: | 253 | case FieldImpl::Suffix: |
260 | return a.suffix(); | 254 | return a.suffix(); |
261 | case FieldImpl::NickName: | 255 | case FieldImpl::NickName: |
262 | return a.nickName(); | 256 | return a.nickName(); |
263 | case FieldImpl::Mailer: | 257 | case FieldImpl::Mailer: |
264 | return a.mailer(); | 258 | return a.mailer(); |
265 | case FieldImpl::Title: | 259 | case FieldImpl::Title: |
266 | return a.title(); | 260 | return a.title(); |
267 | case FieldImpl::Role: | 261 | case FieldImpl::Role: |
268 | return a.role(); | 262 | return a.role(); |
269 | case FieldImpl::Organization: | 263 | case FieldImpl::Organization: |
270 | return a.organization(); | 264 | return a.organization(); |
271 | case FieldImpl::Note: | 265 | case FieldImpl::Note: |
272 | return a.note(); | 266 | return a.note(); |
273 | case FieldImpl::Email: | 267 | case FieldImpl::Email: |
274 | return a.preferredEmail(); | 268 | return a.preferredEmail(); |
275 | case FieldImpl::Birthday: | 269 | case FieldImpl::Birthday: |
276 | if ( a.birthday().isValid() ) { | 270 | if ( a.birthday().isValid() ) { |
277 | //the generated code had the following format: return a.birthday().date().toString( Qt::ISODate ); | 271 | //the generated code had the following format: return a.birthday().date().toString( Qt::ISODate ); |
278 | // But Qt::IsoDate was not specified. | 272 | // But Qt::IsoDate was not specified. |
279 | // QString _oldFormat = KGlobal::locale()->dateFormat(); | 273 | // QString _oldFormat = KGlobal::locale()->dateFormat(); |
280 | // KGlobal::locale()->setDateFormat("%Y-%m-%d"); // = Qt::ISODate | 274 | // KGlobal::locale()->setDateFormat("%Y-%m-%d"); // = Qt::ISODate |
281 | QString dt = KGlobal::locale()->formatDate(a.birthday().date(), false, KLocale::ISODate); | 275 | QString dt = KGlobal::locale()->formatDate(a.birthday().date(), false, KLocale::ISODate); |
282 | // KGlobal::locale()->setDateFormat(_oldFormat); | 276 | // KGlobal::locale()->setDateFormat(_oldFormat); |
283 | return dt; | 277 | return dt; |
284 | } | 278 | } |
285 | else | 279 | else |
286 | return QString::null; | 280 | return QString::null; |
287 | case FieldImpl::Url: | 281 | case FieldImpl::Url: |
288 | return a.url().prettyURL(); | 282 | return a.url().prettyURL(); |
289 | //US | 283 | //US |
290 | case FieldImpl::Resource: | 284 | case FieldImpl::Resource: |
291 | return a.resource()->resourceName(); | 285 | return a.resource()->resourceName(); |
292 | case FieldImpl::Category: | 286 | case FieldImpl::Category: |
293 | return a.categories().join(","); | 287 | return a.categories().join(","); |
294 | case FieldImpl::HomePhone: | 288 | case FieldImpl::HomePhone: |
295 | return a.phoneNumber( PhoneNumber::Home| PhoneNumber::Pref ).number(); | 289 | return a.phoneNumber( PhoneNumber::Home| PhoneNumber::Pref ).number(); |
296 | case FieldImpl::BusinessPhone: | 290 | case FieldImpl::BusinessPhone: |
297 | return a.phoneNumber( PhoneNumber::Work| PhoneNumber::Pref ).number(); | 291 | return a.phoneNumber( PhoneNumber::Work| PhoneNumber::Pref ).number(); |
298 | case FieldImpl::MobilePhone: | 292 | case FieldImpl::MobilePhone: |
299 | return a.phoneNumber( PhoneNumber::Cell ).number(); | 293 | return a.phoneNumber( PhoneNumber::Cell ).number(); |
300 | case FieldImpl::MobileWorkPhone: | 294 | case FieldImpl::MobileWorkPhone: |
301 | return a.phoneNumber( PhoneNumber::Car ).number(); | 295 | return a.phoneNumber( PhoneNumber::Car ).number(); |
302 | case FieldImpl::MobileHomePhone: | ||
303 | return a.phoneNumber( PhoneNumber::Cell ).number(); | ||
304 | case FieldImpl::HomeFax: | 296 | case FieldImpl::HomeFax: |
305 | return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); | 297 | return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); |
306 | case FieldImpl::BusinessFax: | 298 | case FieldImpl::BusinessFax: |
307 | return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); | 299 | return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); |
308 | case FieldImpl::CarPhone: | ||
309 | return a.phoneNumber( PhoneNumber::Car ).number(); | ||
310 | case FieldImpl::Isdn: | 300 | case FieldImpl::Isdn: |
311 | return a.phoneNumber( PhoneNumber::Isdn ).number(); | 301 | return a.phoneNumber( PhoneNumber::Isdn ).number(); |
312 | case FieldImpl::Pager: | 302 | case FieldImpl::Pager: |
313 | return a.phoneNumber( PhoneNumber::Pager ).number(); | 303 | return a.phoneNumber( PhoneNumber::Pager ).number(); |
314 | case FieldImpl::Sip: | 304 | case FieldImpl::Sip: |
315 | return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number(); | 305 | return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number(); |
316 | case FieldImpl::OtherPhone: | 306 | case FieldImpl::OtherPhone: |
317 | return a.phoneNumber( PhoneNumber::Voice ).number(); | 307 | return a.phoneNumber( PhoneNumber::Voice ).number(); |
318 | case FieldImpl::HomeAddressStreet: | 308 | case FieldImpl::HomeAddressStreet: |
319 | return a.address( Address::Home ).street(); | 309 | return a.address( Address::Home ).street(); |
320 | case FieldImpl::HomeAddressLocality: | 310 | case FieldImpl::HomeAddressLocality: |
321 | return a.address( Address::Home ).locality(); | 311 | return a.address( Address::Home ).locality(); |
322 | case FieldImpl::HomeAddressRegion: | 312 | case FieldImpl::HomeAddressRegion: |
323 | return a.address( Address::Home ).region(); | 313 | return a.address( Address::Home ).region(); |
324 | case FieldImpl::HomeAddressPostalCode: | 314 | case FieldImpl::HomeAddressPostalCode: |
325 | return a.address( Address::Home ).postalCode(); | 315 | return a.address( Address::Home ).postalCode(); |
326 | case FieldImpl::HomeAddressCountry: | 316 | case FieldImpl::HomeAddressCountry: |
327 | return a.address( Address::Home ).country(); | 317 | return a.address( Address::Home ).country(); |
328 | case FieldImpl::BusinessAddressStreet: | 318 | case FieldImpl::BusinessAddressStreet: |
329 | return a.address( Address::Work ).street(); | 319 | return a.address( Address::Work ).street(); |
330 | case FieldImpl::BusinessAddressLocality: | 320 | case FieldImpl::BusinessAddressLocality: |
331 | return a.address( Address::Work ).locality(); | 321 | return a.address( Address::Work ).locality(); |
332 | case FieldImpl::BusinessAddressRegion: | 322 | case FieldImpl::BusinessAddressRegion: |
333 | return a.address( Address::Work ).region(); | 323 | return a.address( Address::Work ).region(); |
334 | case FieldImpl::BusinessAddressPostalCode: | 324 | case FieldImpl::BusinessAddressPostalCode: |
335 | return a.address( Address::Work ).postalCode(); | 325 | return a.address( Address::Work ).postalCode(); |
336 | case FieldImpl::BusinessAddressCountry: | 326 | case FieldImpl::BusinessAddressCountry: |
337 | return a.address( Address::Work ).country(); | 327 | return a.address( Address::Work ).country(); |
338 | case FieldImpl::CustomField: | 328 | case FieldImpl::CustomField: |
339 | return a.custom( mImpl->app(), mImpl->key() ); | 329 | return a.custom( mImpl->app(), mImpl->key() ); |
340 | default: | 330 | default: |
341 | return QString::null; | 331 | return QString::null; |
342 | } | 332 | } |
343 | } | 333 | } |
344 | 334 | ||
345 | bool Field::setValue( KABC::Addressee &a, const QString &value ) | 335 | bool Field::setValue( KABC::Addressee &a, const QString &value ) |
346 | { | 336 | { |
347 | switch ( mImpl->fieldId() ) { | 337 | switch ( mImpl->fieldId() ) { |
348 | case FieldImpl::FormattedName: | 338 | case FieldImpl::FormattedName: |
349 | a.setFormattedName( value ); | 339 | a.setFormattedName( value ); |
350 | return true; | 340 | return true; |
351 | case FieldImpl::FamilyName: | 341 | case FieldImpl::FamilyName: |
352 | a.setFamilyName( value ); | 342 | a.setFamilyName( value ); |
353 | return true; | 343 | return true; |
354 | case FieldImpl::GivenName: | 344 | case FieldImpl::GivenName: |
355 | a.setGivenName( value ); | 345 | a.setGivenName( value ); |
356 | return true; | 346 | return true; |
357 | case FieldImpl::AdditionalName: | 347 | case FieldImpl::AdditionalName: |
358 | a.setAdditionalName( value ); | 348 | a.setAdditionalName( value ); |
359 | return true; | 349 | return true; |
360 | case FieldImpl::Prefix: | 350 | case FieldImpl::Prefix: |
361 | a.setPrefix( value ); | 351 | a.setPrefix( value ); |
362 | return true; | 352 | return true; |
363 | case FieldImpl::Suffix: | 353 | case FieldImpl::Suffix: |
364 | a.setSuffix( value ); | 354 | a.setSuffix( value ); |
365 | return true; | 355 | return true; |
366 | case FieldImpl::NickName: | 356 | case FieldImpl::NickName: |
367 | a.setNickName( value ); | 357 | a.setNickName( value ); |
368 | return true; | 358 | return true; |
369 | case FieldImpl::Mailer: | 359 | case FieldImpl::Mailer: |
370 | a.setMailer( value ); | 360 | a.setMailer( value ); |
371 | return true; | 361 | return true; |
372 | case FieldImpl::Title: | 362 | case FieldImpl::Title: |
373 | a.setTitle( value ); | 363 | a.setTitle( value ); |
374 | return true; | 364 | return true; |
375 | case FieldImpl::Role: | 365 | case FieldImpl::Role: |
376 | a.setRole( value ); | 366 | a.setRole( value ); |
377 | return true; | 367 | return true; |
378 | case FieldImpl::Organization: | 368 | case FieldImpl::Organization: |
379 | a.setOrganization( value ); | 369 | a.setOrganization( value ); |
380 | return true; | 370 | return true; |
381 | case FieldImpl::Note: | 371 | case FieldImpl::Note: |
382 | a.setNote( value ); | 372 | a.setNote( value ); |
383 | return true; | 373 | return true; |
384 | case FieldImpl::Birthday: | 374 | case FieldImpl::Birthday: |
385 | //US | 375 | //US |
386 | //the generated code had the following format: return a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); | 376 | //the generated code had the following format: return a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); |
387 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? | 377 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? |
388 | { | 378 | { |
389 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate | 379 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate |
390 | a.setBirthday(dt); | 380 | a.setBirthday(dt); |
391 | } | 381 | } |
392 | return true; | 382 | return true; |
393 | case FieldImpl::CustomField: | 383 | case FieldImpl::CustomField: |
394 | a.insertCustom( mImpl->app(), mImpl->key(), value ); | 384 | a.insertCustom( mImpl->app(), mImpl->key(), value ); |
395 | //US never copy the resourcename back to the adressee. | 385 | //US never copy the resourcename back to the adressee. |
396 | case FieldImpl::Resource: | 386 | case FieldImpl::Resource: |
397 | default: | 387 | default: |
398 | return false; | 388 | return false; |
399 | } | 389 | } |
400 | } | 390 | } |
401 | 391 | ||
402 | bool Field::isCustom() | 392 | bool Field::isCustom() |
403 | { | 393 | { |
404 | return mImpl->fieldId() == FieldImpl::CustomField; | 394 | return mImpl->fieldId() == FieldImpl::CustomField; |
405 | } | 395 | } |
406 | 396 | ||
407 | Field::List Field::allFields() | 397 | Field::List Field::allFields() |
408 | { | 398 | { |
409 | if ( mAllFields.isEmpty() ) { | 399 | if ( mAllFields.isEmpty() ) { |
410 | createField( FieldImpl::FormattedName, Frequent ); | 400 | createField( FieldImpl::FormattedName, Frequent ); |
411 | createField( FieldImpl::FamilyName, Frequent ); | 401 | createField( FieldImpl::FamilyName, Frequent ); |
412 | createField( FieldImpl::GivenName, Frequent ); | 402 | createField( FieldImpl::GivenName, Frequent ); |
413 | createField( FieldImpl::AdditionalName ); | 403 | createField( FieldImpl::AdditionalName ); |
414 | createField( FieldImpl::Prefix ); | 404 | createField( FieldImpl::Prefix ); |
415 | createField( FieldImpl::Suffix ); | 405 | createField( FieldImpl::Suffix ); |
416 | createField( FieldImpl::NickName, Personal ); | 406 | createField( FieldImpl::NickName, Personal ); |
417 | createField( FieldImpl::Birthday, Personal ); | 407 | createField( FieldImpl::Birthday, Personal ); |
418 | createField( FieldImpl::Category ); | 408 | createField( FieldImpl::Category ); |
419 | createField( FieldImpl::HomeAddressStreet, Address|Personal ); | 409 | createField( FieldImpl::HomeAddressStreet, Address|Personal ); |
420 | createField( FieldImpl::HomeAddressLocality, Address|Personal ); | 410 | createField( FieldImpl::HomeAddressLocality, Address|Personal ); |
421 | createField( FieldImpl::HomeAddressRegion, Address|Personal ); | 411 | createField( FieldImpl::HomeAddressRegion, Address|Personal ); |
422 | createField( FieldImpl::HomeAddressPostalCode, Address|Personal ); | 412 | createField( FieldImpl::HomeAddressPostalCode, Address|Personal ); |
423 | createField( FieldImpl::HomeAddressCountry, Address|Personal ); | 413 | createField( FieldImpl::HomeAddressCountry, Address|Personal ); |
424 | createField( FieldImpl::HomeAddressLabel, Address|Personal ); | 414 | createField( FieldImpl::HomeAddressLabel, Address|Personal ); |
425 | createField( FieldImpl::BusinessAddressStreet, Address|Organization ); | 415 | createField( FieldImpl::BusinessAddressStreet, Address|Organization ); |
426 | createField( FieldImpl::BusinessAddressLocality, Address|Organization ); | 416 | createField( FieldImpl::BusinessAddressLocality, Address|Organization ); |
427 | createField( FieldImpl::BusinessAddressRegion, Address|Organization ); | 417 | createField( FieldImpl::BusinessAddressRegion, Address|Organization ); |
428 | createField( FieldImpl::BusinessAddressPostalCode, Address|Organization ); | 418 | createField( FieldImpl::BusinessAddressPostalCode, Address|Organization ); |
429 | createField( FieldImpl::BusinessAddressCountry, Address|Organization ); | 419 | createField( FieldImpl::BusinessAddressCountry, Address|Organization ); |
430 | createField( FieldImpl::BusinessAddressLabel, Address|Organization ); | 420 | createField( FieldImpl::BusinessAddressLabel, Address|Organization ); |
431 | createField( FieldImpl::HomePhone, Personal|Frequent ); | 421 | createField( FieldImpl::HomePhone, Personal|Frequent ); |
432 | createField( FieldImpl::BusinessPhone, Organization|Frequent ); | 422 | createField( FieldImpl::BusinessPhone, Organization|Frequent ); |
433 | createField( FieldImpl::MobilePhone, Frequent ); | 423 | createField( FieldImpl::MobilePhone, Frequent ); |
434 | createField( FieldImpl::MobileHomePhone, Frequent ); | ||
435 | createField( FieldImpl::MobileWorkPhone, Frequent ); | 424 | createField( FieldImpl::MobileWorkPhone, Frequent ); |
436 | createField( FieldImpl::HomeFax ); | 425 | createField( FieldImpl::HomeFax ); |
437 | createField( FieldImpl::BusinessFax ); | 426 | createField( FieldImpl::BusinessFax ); |
438 | createField( FieldImpl::CarPhone ); | ||
439 | createField( FieldImpl::Isdn ); | 427 | createField( FieldImpl::Isdn ); |
440 | createField( FieldImpl::Pager ); | 428 | createField( FieldImpl::Pager ); |
441 | createField( FieldImpl::Email, Email|Frequent ); | 429 | createField( FieldImpl::Email, Email|Frequent ); |
442 | createField( FieldImpl::Mailer, Email ); | 430 | createField( FieldImpl::Mailer, Email ); |
443 | createField( FieldImpl::Title, Organization ); | 431 | createField( FieldImpl::Title, Organization ); |
444 | createField( FieldImpl::Role, Organization ); | 432 | createField( FieldImpl::Role, Organization ); |
445 | createField( FieldImpl::Organization, Organization ); | 433 | createField( FieldImpl::Organization, Organization ); |
446 | createField( FieldImpl::Note ); | 434 | createField( FieldImpl::Note ); |
447 | createField( FieldImpl::Url ); | 435 | createField( FieldImpl::Url ); |
448 | createField( FieldImpl::Resource ); | 436 | createField( FieldImpl::Resource ); |
449 | createField( FieldImpl::Sip ); | 437 | createField( FieldImpl::Sip ); |
450 | createField( FieldImpl::OtherPhone ); | 438 | createField( FieldImpl::OtherPhone ); |
451 | } | 439 | } |
452 | 440 | ||
453 | return mAllFields; | 441 | return mAllFields; |
454 | } | 442 | } |
455 | 443 | ||
456 | Field::List Field::defaultFields() | 444 | Field::List Field::defaultFields() |
457 | { | 445 | { |
458 | if ( mDefaultFields.isEmpty() ) { | 446 | if ( mDefaultFields.isEmpty() ) { |
459 | createDefaultField( FieldImpl::GivenName ); | 447 | createDefaultField( FieldImpl::GivenName ); |
460 | createDefaultField( FieldImpl::FamilyName ); | 448 | createDefaultField( FieldImpl::FamilyName ); |
461 | createDefaultField( FieldImpl::Email ); | 449 | createDefaultField( FieldImpl::Email ); |
462 | } | 450 | } |
463 | 451 | ||
464 | return mDefaultFields; | 452 | return mDefaultFields; |
465 | } | 453 | } |
466 | 454 | ||
467 | void Field::createField( int id, int category ) | 455 | void Field::createField( int id, int category ) |
468 | { | 456 | { |
469 | mAllFields.append( new Field( new FieldImpl( id, category ) ) ); | 457 | mAllFields.append( new Field( new FieldImpl( id, category ) ) ); |
470 | } | 458 | } |
471 | 459 | ||
472 | void Field::createDefaultField( int id, int category ) | 460 | void Field::createDefaultField( int id, int category ) |
473 | { | 461 | { |
474 | mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); | 462 | mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); |
475 | } | 463 | } |
476 | 464 | ||
477 | void Field::deleteFields() | 465 | void Field::deleteFields() |
478 | { | 466 | { |
479 | Field::List::ConstIterator it; | 467 | Field::List::ConstIterator it; |
480 | 468 | ||
481 | for( it = mAllFields.begin(); it != mAllFields.end(); ++it ) { | 469 | for( it = mAllFields.begin(); it != mAllFields.end(); ++it ) { |
482 | delete (*it); | 470 | delete (*it); |
483 | } | 471 | } |
484 | mAllFields.clear(); | 472 | mAllFields.clear(); |
485 | 473 | ||
486 | for( it = mDefaultFields.begin(); it != mDefaultFields.end(); ++it ) { | 474 | for( it = mDefaultFields.begin(); it != mDefaultFields.end(); ++it ) { |
487 | delete (*it); | 475 | delete (*it); |
488 | } | 476 | } |
489 | mDefaultFields.clear(); | 477 | mDefaultFields.clear(); |
490 | 478 | ||
491 | for( it = mCustomFields.begin(); it != mCustomFields.end(); ++it ) { | 479 | for( it = mCustomFields.begin(); it != mCustomFields.end(); ++it ) { |
492 | delete (*it); | 480 | delete (*it); |
493 | } | 481 | } |
494 | mCustomFields.clear(); | 482 | mCustomFields.clear(); |
495 | } | 483 | } |
496 | 484 | ||
497 | void Field::saveFields( const QString &identifier, | 485 | void Field::saveFields( const QString &identifier, |
498 | const Field::List &fields ) | 486 | const Field::List &fields ) |
499 | { | 487 | { |
500 | KConfig *cfg = KGlobal::config(); | 488 | KConfig *cfg = KGlobal::config(); |
501 | KConfigGroupSaver( cfg, "KABCFields" ); | 489 | KConfigGroupSaver( cfg, "KABCFields" ); |
502 | saveFields( cfg, identifier, fields ); | 490 | saveFields( cfg, identifier, fields ); |
503 | } | 491 | } |
504 | 492 | ||
505 | void Field::saveFields( KConfig *cfg, const QString &identifier, | 493 | void Field::saveFields( KConfig *cfg, const QString &identifier, |
506 | const Field::List &fields ) | 494 | const Field::List &fields ) |
507 | { | 495 | { |
508 | QValueList<int> fieldIds; | 496 | QValueList<int> fieldIds; |
509 | 497 | ||
510 | //US | 498 | //US |
511 | // qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1()); | 499 | // qDebug("Field::saveFields to %s %s", cfg->getFileName().latin1(), identifier.latin1()); |
512 | 500 | ||
513 | int custom = 0; | 501 | int custom = 0; |
514 | Field::List::ConstIterator it; | 502 | Field::List::ConstIterator it; |
515 | for( it = fields.begin(); it != fields.end(); ++it ) { | 503 | for( it = fields.begin(); it != fields.end(); ++it ) { |
516 | //US | 504 | //US |
517 | // qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId()); | 505 | // qDebug("Field::saveFields field:%i", (*it)->mImpl->fieldId()); |
518 | 506 | ||
519 | fieldIds.append( (*it)->mImpl->fieldId() ); | 507 | fieldIds.append( (*it)->mImpl->fieldId() ); |
520 | if( (*it)->isCustom() ) { | 508 | if( (*it)->isCustom() ) { |
521 | QStringList customEntry; | 509 | QStringList customEntry; |
522 | customEntry << (*it)->mImpl->label(); | 510 | customEntry << (*it)->mImpl->label(); |
523 | customEntry << (*it)->mImpl->key(); | 511 | customEntry << (*it)->mImpl->key(); |
524 | customEntry << (*it)->mImpl->app(); | 512 | customEntry << (*it)->mImpl->app(); |
525 | cfg->writeEntry( "KABC_CustomEntry_" + identifier + "_" + | 513 | cfg->writeEntry( "KABC_CustomEntry_" + identifier + "_" + |
526 | QString::number( custom++ ), customEntry ); | 514 | QString::number( custom++ ), customEntry ); |
527 | } | 515 | } |
528 | } | 516 | } |
529 | cfg->writeEntry( identifier, fieldIds ); | 517 | cfg->writeEntry( identifier, fieldIds ); |
530 | } | 518 | } |
531 | 519 | ||
532 | Field::List Field::restoreFields( const QString &identifier ) | 520 | Field::List Field::restoreFields( const QString &identifier ) |
533 | { | 521 | { |
534 | //US | 522 | //US |
535 | // qDebug("Field::restoreFields, identifier: %s", identifier.latin1()); | 523 | // qDebug("Field::restoreFields, identifier: %s", identifier.latin1()); |
536 | 524 | ||
537 | KConfig *cfg = KGlobal::config(); | 525 | KConfig *cfg = KGlobal::config(); |
538 | KConfigGroupSaver( cfg, "KABCFields" ); | 526 | KConfigGroupSaver( cfg, "KABCFields" ); |
539 | cfg->setGroup( "KABCFields" ); | 527 | cfg->setGroup( "KABCFields" ); |
540 | 528 | ||
541 | Field::List l = restoreFields( cfg, identifier ); | 529 | Field::List l = restoreFields( cfg, identifier ); |
542 | 530 | ||
543 | return l; | 531 | return l; |
544 | } | 532 | } |
545 | 533 | ||
546 | Field::List Field::restoreFields( KConfig *cfg, const QString &identifier ) | 534 | Field::List Field::restoreFields( KConfig *cfg, const QString &identifier ) |
547 | { | 535 | { |
548 | QValueList<int> fieldIds = cfg->readIntListEntry( identifier); | 536 | QValueList<int> fieldIds = cfg->readIntListEntry( identifier); |
549 | //US | 537 | //US |
550 | // qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1()); | 538 | // qDebug("Field::restoreFields from %s, identifier: %s", cfg->getFileName().latin1(), identifier.latin1()); |
551 | 539 | ||
552 | Field::List fields; | 540 | Field::List fields; |
553 | 541 | ||
554 | int custom = 0; | 542 | int custom = 0; |
555 | QValueList<int>::ConstIterator it; | 543 | QValueList<int>::ConstIterator it; |
556 | for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { | 544 | for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { |
557 | FieldImpl *f = 0; | 545 | FieldImpl *f = 0; |
558 | if ( (*it) == FieldImpl::CustomField ) { | 546 | if ( (*it) == FieldImpl::CustomField ) { |
559 | QStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + | 547 | QStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + |
560 | identifier + "_" + | 548 | identifier + "_" + |
561 | QString::number( custom++ ) ); | 549 | QString::number( custom++ ) ); |
562 | f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], | 550 | f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], |
563 | customEntry[ 1 ], customEntry[ 2 ] ); | 551 | customEntry[ 1 ], customEntry[ 2 ] ); |
564 | } else { | 552 | } else { |
565 | f = new FieldImpl( *it ); | 553 | f = new FieldImpl( *it ); |
566 | } | 554 | } |
567 | fields.append( new Field( f ) ); | 555 | fields.append( new Field( f ) ); |
568 | } | 556 | } |
569 | 557 | ||
570 | return fields; | 558 | return fields; |
571 | } | 559 | } |
572 | 560 | ||
573 | bool Field::equals( Field *field ) | 561 | bool Field::equals( Field *field ) |
574 | { | 562 | { |
575 | bool sameId = ( mImpl->fieldId() == field->mImpl->fieldId() ); | 563 | bool sameId = ( mImpl->fieldId() == field->mImpl->fieldId() ); |
576 | 564 | ||
577 | if ( !sameId ) return false; | 565 | if ( !sameId ) return false; |
578 | 566 | ||
579 | if ( mImpl->fieldId() != FieldImpl::CustomField ) return true; | 567 | if ( mImpl->fieldId() != FieldImpl::CustomField ) return true; |
580 | 568 | ||
581 | return mImpl->key() == field->mImpl->key(); | 569 | return mImpl->key() == field->mImpl->key(); |
582 | } | 570 | } |
583 | 571 | ||
584 | Field *Field::createCustomField( const QString &label, int category, | 572 | Field *Field::createCustomField( const QString &label, int category, |
585 | const QString &key, const QString &app ) | 573 | const QString &key, const QString &app ) |
586 | { | 574 | { |
587 | Field *field = new Field( new FieldImpl( FieldImpl::CustomField, | 575 | Field *field = new Field( new FieldImpl( FieldImpl::CustomField, |
588 | category | CustomCategory, | 576 | category | CustomCategory, |
589 | label, key, app ) ); | 577 | label, key, app ) ); |
590 | //US | 578 | //US |
591 | // qDebug("Field::createCustomField label %s", label.latin1() ); | 579 | // qDebug("Field::createCustomField label %s", label.latin1() ); |
592 | 580 | ||
593 | mCustomFields.append( field ); | 581 | mCustomFields.append( field ); |
594 | 582 | ||
595 | return field; | 583 | return field; |
596 | } | 584 | } |
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 90cc4cf..6db1bcf 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp | |||
@@ -1,369 +1,369 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <kapplication.h> | 28 | #include <kapplication.h> |
29 | #include <klocale.h> | 29 | #include <klocale.h> |
30 | 30 | ||
31 | #include "phonenumber.h" | 31 | #include "phonenumber.h" |
32 | 32 | ||
33 | using namespace KABC; | 33 | using namespace KABC; |
34 | 34 | ||
35 | PhoneNumber::PhoneNumber() : | 35 | PhoneNumber::PhoneNumber() : |
36 | mType( Home ) | 36 | mType( Home ) |
37 | { | 37 | { |
38 | init(); | 38 | init(); |
39 | } | 39 | } |
40 | 40 | ||
41 | PhoneNumber::PhoneNumber( const QString &number, int type ) : | 41 | PhoneNumber::PhoneNumber( const QString &number, int type ) : |
42 | mType( type ), mNumber( number ) | 42 | mType( type ), mNumber( number ) |
43 | { | 43 | { |
44 | init(); | 44 | init(); |
45 | } | 45 | } |
46 | 46 | ||
47 | PhoneNumber::~PhoneNumber() | 47 | PhoneNumber::~PhoneNumber() |
48 | { | 48 | { |
49 | } | 49 | } |
50 | 50 | ||
51 | void PhoneNumber::init() | 51 | void PhoneNumber::init() |
52 | { | 52 | { |
53 | mId = KApplication::randomString( 8 ); | 53 | mId = KApplication::randomString( 8 ); |
54 | } | 54 | } |
55 | 55 | ||
56 | bool PhoneNumber::operator==( const PhoneNumber &p ) const | 56 | bool PhoneNumber::operator==( const PhoneNumber &p ) const |
57 | { | 57 | { |
58 | if ( mNumber != p.mNumber ) return false; | 58 | if ( mNumber != p.mNumber ) return false; |
59 | if ( mType != p.mType ) return false; | 59 | if ( mType != p.mType ) return false; |
60 | 60 | ||
61 | return true; | 61 | return true; |
62 | } | 62 | } |
63 | 63 | ||
64 | bool PhoneNumber::operator!=( const PhoneNumber &p ) const | 64 | bool PhoneNumber::operator!=( const PhoneNumber &p ) const |
65 | { | 65 | { |
66 | return !( p == *this ); | 66 | return !( p == *this ); |
67 | } | 67 | } |
68 | void PhoneNumber::makeCompat() | 68 | void PhoneNumber::makeCompat() |
69 | { | 69 | { |
70 | mType = getCompatType( mType ); | 70 | mType = getCompatType( mType ); |
71 | } | 71 | } |
72 | int PhoneNumber::getCompatType( int type ) | 72 | int PhoneNumber::getCompatType( int type ) |
73 | { | 73 | { |
74 | 74 | ||
75 | if ((type & Cell) == Cell) { | 75 | if ((type & Cell) == Cell) { |
76 | if ((type & Work) == Work) | 76 | if ((type & Work) == Work) |
77 | return Car; | 77 | return Car; |
78 | return Cell; | 78 | return Cell; |
79 | } | 79 | } |
80 | if ((type & Home) == Home) { | 80 | if ((type & Home) == Home) { |
81 | if ((type & Pref) == Pref) | 81 | if ((type & Pref) == Pref) |
82 | return (Home | Pref); | 82 | return (Home | Pref); |
83 | if ((type & Fax) == Fax) | 83 | if ((type & Fax) == Fax) |
84 | return (Home | Fax); | 84 | return (Home | Fax); |
85 | return (Home); | 85 | return (Home); |
86 | } | 86 | } |
87 | if ((type & Work) == Work) { | 87 | if ((type & Work) == Work) { |
88 | if ((type & Pref) == Pref) | 88 | if ((type & Pref) == Pref) |
89 | return (Work| Pref); | 89 | return (Work| Pref); |
90 | if ((type & Fax) == Fax) | 90 | if ((type & Fax) == Fax) |
91 | return (Fax |Work); | 91 | return (Fax |Work); |
92 | if ((type & Msg) == Msg) { | 92 | if ((type & Msg) == Msg) { |
93 | if ((type & Voice) == Voice) | 93 | if ((type & Voice) == Voice) |
94 | return ( Msg | Voice |Work); | 94 | return ( Msg | Voice |Work); |
95 | return ( Msg | Work); | 95 | return ( Msg | Work); |
96 | } | 96 | } |
97 | return Work; | 97 | return Work; |
98 | } | 98 | } |
99 | if ((type & Pcs) == Pcs) { | 99 | if ((type & Pcs) == Pcs) { |
100 | if ((type & Pref) == Pref) | 100 | if ((type & Pref) == Pref) |
101 | return Pcs | Pref; | 101 | return Pcs | Pref; |
102 | return Pcs; | 102 | return Pcs; |
103 | } | 103 | } |
104 | if ((type & Car) == Car) | 104 | if ((type & Car) == Car) |
105 | return Car; | 105 | return Car; |
106 | if ((type & Pager) == Pager) | 106 | if ((type & Pager) == Pager) |
107 | return Pager; | 107 | return Pager; |
108 | if ((type & Isdn) == Isdn) | 108 | if ((type & Isdn) == Isdn) |
109 | return Isdn; | 109 | return Isdn; |
110 | if ((type & Video) == Video) | 110 | if ((type & Video) == Video) |
111 | return Video; | 111 | return Video; |
112 | 112 | ||
113 | if ((type & Msg) == Msg) | 113 | if ((type & Msg) == Msg) |
114 | return Msg; | 114 | return Msg; |
115 | if ((type & Fax) == Fax) | 115 | if ((type & Fax) == Fax) |
116 | return Fax; | 116 | return Fax; |
117 | 117 | ||
118 | if ((type & Pref) == Pref) | 118 | if ((type & Pref) == Pref) |
119 | return Pref; | 119 | return Pref; |
120 | 120 | ||
121 | return Voice; | 121 | return Voice; |
122 | 122 | ||
123 | } | 123 | } |
124 | bool PhoneNumber::simplifyNumber() | 124 | bool PhoneNumber::simplifyNumber() |
125 | { | 125 | { |
126 | QString Number; | 126 | QString Number; |
127 | int i; | 127 | int i; |
128 | Number = mNumber.stripWhiteSpace (); | 128 | Number = mNumber.stripWhiteSpace (); |
129 | mNumber = ""; | 129 | mNumber = ""; |
130 | for ( i = 0; i < Number.length(); ++i) { | 130 | for ( i = 0; i < Number.length(); ++i) { |
131 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) | 131 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) |
132 | mNumber += Number.at(i); | 132 | mNumber += Number.at(i); |
133 | } | 133 | } |
134 | return ( mNumber.length() > 0 ); | 134 | return ( mNumber.length() > 0 ); |
135 | } | 135 | } |
136 | // make cellphone compatible | 136 | // make cellphone compatible |
137 | void PhoneNumber::simplifyType() | 137 | void PhoneNumber::simplifyType() |
138 | { | 138 | { |
139 | if ( mType & Fax ) mType = Fax; | 139 | if ( mType & Fax ) mType = Fax; |
140 | else if ( mType & Cell ) mType = Cell; | 140 | else if ( mType & Cell ) mType = Cell; |
141 | else if ( mType & Work ) mType = Work ; | 141 | else if ( mType & Work ) mType = Work ; |
142 | else if ( mType & Home ) mType = Home; | 142 | else if ( mType & Home ) mType = Home; |
143 | else mType = Pref; | 143 | else mType = Pref; |
144 | } | 144 | } |
145 | bool PhoneNumber::contains( const PhoneNumber &p ) | 145 | bool PhoneNumber::contains( const PhoneNumber &p ) |
146 | { | 146 | { |
147 | PhoneNumber myself; | 147 | PhoneNumber myself; |
148 | PhoneNumber other; | 148 | PhoneNumber other; |
149 | myself = *this; | 149 | myself = *this; |
150 | other = p; | 150 | other = p; |
151 | myself.simplifyNumber(); | 151 | myself.simplifyNumber(); |
152 | other.simplifyNumber(); | 152 | other.simplifyNumber(); |
153 | if ( myself.number() != other.number ()) | 153 | if ( myself.number() != other.number ()) |
154 | return false; | 154 | return false; |
155 | myself.simplifyType(); | 155 | myself.simplifyType(); |
156 | other.simplifyType(); | 156 | other.simplifyType(); |
157 | if ( myself.type() == other.type()) | 157 | if ( myself.type() == other.type()) |
158 | return true; | 158 | return true; |
159 | return false; | 159 | return false; |
160 | } | 160 | } |
161 | 161 | ||
162 | void PhoneNumber::setId( const QString &id ) | 162 | void PhoneNumber::setId( const QString &id ) |
163 | { | 163 | { |
164 | mId = id; | 164 | mId = id; |
165 | } | 165 | } |
166 | 166 | ||
167 | QString PhoneNumber::id() const | 167 | QString PhoneNumber::id() const |
168 | { | 168 | { |
169 | return mId; | 169 | return mId; |
170 | } | 170 | } |
171 | 171 | ||
172 | void PhoneNumber::setNumber( const QString &number ) | 172 | void PhoneNumber::setNumber( const QString &number ) |
173 | { | 173 | { |
174 | mNumber = number; | 174 | mNumber = number; |
175 | } | 175 | } |
176 | 176 | ||
177 | QString PhoneNumber::number() const | 177 | QString PhoneNumber::number() const |
178 | { | 178 | { |
179 | return mNumber; | 179 | return mNumber; |
180 | } | 180 | } |
181 | 181 | ||
182 | void PhoneNumber::setType( int type ) | 182 | void PhoneNumber::setType( int type ) |
183 | { | 183 | { |
184 | mType = type; | 184 | mType = type; |
185 | } | 185 | } |
186 | 186 | ||
187 | int PhoneNumber::type() const | 187 | int PhoneNumber::type() const |
188 | { | 188 | { |
189 | return mType; | 189 | return mType; |
190 | } | 190 | } |
191 | 191 | ||
192 | QString PhoneNumber::typeLabel() const | 192 | QString PhoneNumber::typeLabel() const |
193 | { | 193 | { |
194 | QString label; | 194 | QString label; |
195 | bool first = true; | 195 | bool first = true; |
196 | 196 | ||
197 | TypeList list = typeList(); | 197 | TypeList list = typeList(); |
198 | 198 | ||
199 | TypeList::Iterator it; | 199 | TypeList::Iterator it; |
200 | for ( it = list.begin(); it != list.end(); ++it ) { | 200 | for ( it = list.begin(); it != list.end(); ++it ) { |
201 | if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { | 201 | if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { |
202 | label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); | 202 | label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); |
203 | if ( first ) | 203 | if ( first ) |
204 | first = false; | 204 | first = false; |
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | return label; | 208 | return label; |
209 | } | 209 | } |
210 | 210 | ||
211 | QString PhoneNumber::label() const | 211 | QString PhoneNumber::label() const |
212 | { | 212 | { |
213 | return typeLabel( type() ); | 213 | return typeLabel( type() ); |
214 | } | 214 | } |
215 | 215 | ||
216 | PhoneNumber::TypeList PhoneNumber::typeList() | 216 | PhoneNumber::TypeList PhoneNumber::typeList() |
217 | { | 217 | { |
218 | TypeList list; | 218 | TypeList list; |
219 | 219 | ||
220 | list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video | 220 | list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video |
221 | << Bbs << Modem << Car << Isdn << Pcs << Pager; | 221 | << Bbs << Modem << Car << Isdn << Pcs << Pager; |
222 | 222 | ||
223 | return list; | 223 | return list; |
224 | } | 224 | } |
225 | PhoneNumber::TypeList PhoneNumber::supportedTypeList() | 225 | PhoneNumber::TypeList PhoneNumber::supportedTypeList() |
226 | { | 226 | { |
227 | static TypeList list; | 227 | static TypeList list; |
228 | if ( list.count() == 0 ) | 228 | if ( list.count() == 0 ) |
229 | list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< Pcs<< Home << Work << Car << (Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Video << Msg << Pref << Voice; | 229 | list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< Pcs<< Home << Work << Car << (Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Video << Msg << Pref << Voice; |
230 | return list; | 230 | return list; |
231 | } | 231 | } |
232 | QStringList PhoneNumber::supportedTypeListNames() | 232 | QStringList PhoneNumber::supportedTypeListNames() |
233 | { | 233 | { |
234 | static QStringList list; | 234 | static QStringList list; |
235 | if ( list.count() == 0 ) | 235 | if ( list.count() == 0 ) |
236 | list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2 (Work)") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Video") << i18n("Callback") << i18n("Primary")<< i18n("Other"); | 236 | list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Video") << i18n("Callback") << i18n("Primary")<< i18n("Other"); |
237 | return list; | 237 | return list; |
238 | } | 238 | } |
239 | 239 | ||
240 | int PhoneNumber::typeListIndex4Type(int type ) | 240 | int PhoneNumber::typeListIndex4Type(int type ) |
241 | { | 241 | { |
242 | TypeList list = supportedTypeList(); | 242 | TypeList list = supportedTypeList(); |
243 | int i = 0; | 243 | int i = 0; |
244 | while ( i < list.count() ) { | 244 | while ( i < list.count() ) { |
245 | if ( list [i] == type ) | 245 | if ( list [i] == type ) |
246 | return i; | 246 | return i; |
247 | ++i; | 247 | ++i; |
248 | } | 248 | } |
249 | return list.count()-1; | 249 | return list.count()-1; |
250 | } | 250 | } |
251 | 251 | ||
252 | QString PhoneNumber::label( int type ) | 252 | QString PhoneNumber::label( int type ) |
253 | { | 253 | { |
254 | return typeLabel( type ); | 254 | return typeLabel( type ); |
255 | } | 255 | } |
256 | 256 | ||
257 | QString PhoneNumber::typeLabel( int type ) | 257 | QString PhoneNumber::typeLabel( int type ) |
258 | { | 258 | { |
259 | if ((type & Cell) == Cell) | 259 | if ((type & Cell) == Cell) |
260 | return i18n("Mobile"); | 260 | return i18n("Mobile"); |
261 | if ((type & Home) == Home) { | 261 | if ((type & Home) == Home) { |
262 | if ((type & Pref) == Pref) | 262 | if ((type & Pref) == Pref) |
263 | return i18n("Home"); | 263 | return i18n("Home"); |
264 | if ((type & Fax) == Fax) | 264 | if ((type & Fax) == Fax) |
265 | return i18n("Fax (Home)"); | 265 | return i18n("Fax (Home)"); |
266 | return i18n("Home2"); | 266 | return i18n("Home2"); |
267 | } | 267 | } |
268 | 268 | ||
269 | if ((type & Work) == Work) { | 269 | if ((type & Work) == Work) { |
270 | if ((type & Pref) == Pref) | 270 | if ((type & Pref) == Pref) |
271 | return i18n("Work"); | 271 | return i18n("Work"); |
272 | if ((type & Fax) == Fax) | 272 | if ((type & Fax) == Fax) |
273 | return i18n("Fax (Work)"); | 273 | return i18n("Fax (Work)"); |
274 | if ((type & Msg) == Msg) { | 274 | if ((type & Msg) == Msg) { |
275 | if ((type & Voice) == Voice) | 275 | if ((type & Voice) == Voice) |
276 | return i18n("Assistent"); | 276 | return i18n("Assistent"); |
277 | return i18n("Company"); | 277 | return i18n("Company"); |
278 | } | 278 | } |
279 | return i18n("Work2"); | 279 | return i18n("Work2"); |
280 | } | 280 | } |
281 | if ((type & Pcs) == Pcs) { | 281 | if ((type & Pcs) == Pcs) { |
282 | if ((type & Pref) == Pref) | 282 | if ((type & Pref) == Pref) |
283 | return i18n("SIP"); | 283 | return i18n("SIP"); |
284 | return i18n("VoIP"); | 284 | return i18n("VoIP"); |
285 | } | 285 | } |
286 | if ((type & Car) == Car) | 286 | if ((type & Car) == Car) |
287 | return i18n("Mobile2 (Work)"); | 287 | return i18n("Mobile2"); |
288 | if ((type & Pager) == Pager) | 288 | if ((type & Pager) == Pager) |
289 | return i18n("Pager"); | 289 | return i18n("Pager"); |
290 | if ((type & Isdn) == Isdn) | 290 | if ((type & Isdn) == Isdn) |
291 | return i18n("ISDN"); | 291 | return i18n("ISDN"); |
292 | if ((type & Video) == Video) | 292 | if ((type & Video) == Video) |
293 | return i18n("Video"); | 293 | return i18n("Video"); |
294 | 294 | ||
295 | if ((type & Msg) == Msg) | 295 | if ((type & Msg) == Msg) |
296 | return i18n("Callback"); | 296 | return i18n("Callback"); |
297 | if ((type & Fax) == Fax) | 297 | if ((type & Fax) == Fax) |
298 | return i18n("Fax (Other)"); | 298 | return i18n("Fax (Other)"); |
299 | 299 | ||
300 | if ((type & Pref) == Pref) | 300 | if ((type & Pref) == Pref) |
301 | return i18n("Primary"); | 301 | return i18n("Primary"); |
302 | 302 | ||
303 | 303 | ||
304 | return i18n("Other"); | 304 | return i18n("Other"); |
305 | 305 | ||
306 | 306 | ||
307 | #if 0 | 307 | #if 0 |
308 | 308 | ||
309 | 309 | ||
310 | 310 | ||
311 | QString typeString; | 311 | QString typeString; |
312 | 312 | ||
313 | 313 | ||
314 | if ((type & Cell) == Cell) | 314 | if ((type & Cell) == Cell) |
315 | typeString += i18n("Mobile") +" "; | 315 | typeString += i18n("Mobile") +" "; |
316 | if ((type & Home) == Home) | 316 | if ((type & Home) == Home) |
317 | typeString += i18n("Home")+" "; | 317 | typeString += i18n("Home")+" "; |
318 | else if ((type & Work) == Work) | 318 | else if ((type & Work) == Work) |
319 | typeString += i18n("Work")+" "; | 319 | typeString += i18n("Work")+" "; |
320 | 320 | ||
321 | if ((type & Sip) == Sip) | 321 | if ((type & Sip) == Sip) |
322 | typeString += i18n("SIP")+" "; | 322 | typeString += i18n("SIP")+" "; |
323 | if ((type & Car) == Car) | 323 | if ((type & Car) == Car) |
324 | typeString += i18n("Car")+" "; | 324 | typeString += i18n("Car")+" "; |
325 | 325 | ||
326 | if ((type & Fax) == Fax) | 326 | if ((type & Fax) == Fax) |
327 | typeString += i18n("Fax"); | 327 | typeString += i18n("Fax"); |
328 | else if ((type & Msg) == Msg) | 328 | else if ((type & Msg) == Msg) |
329 | typeString += i18n("Messenger"); | 329 | typeString += i18n("Messenger"); |
330 | else if ((type & Video) == Video) | 330 | else if ((type & Video) == Video) |
331 | typeString += i18n("Video"); | 331 | typeString += i18n("Video"); |
332 | else if ((type & Bbs) == Bbs) | 332 | else if ((type & Bbs) == Bbs) |
333 | typeString += i18n("Mailbox"); | 333 | typeString += i18n("Mailbox"); |
334 | else if ((type & Modem) == Modem) | 334 | else if ((type & Modem) == Modem) |
335 | typeString += i18n("Modem"); | 335 | typeString += i18n("Modem"); |
336 | else if ((type & Isdn) == Isdn) | 336 | else if ((type & Isdn) == Isdn) |
337 | typeString += i18n("ISDN"); | 337 | typeString += i18n("ISDN"); |
338 | else if ((type & Pcs) == Pcs) | 338 | else if ((type & Pcs) == Pcs) |
339 | typeString += i18n("PCS"); | 339 | typeString += i18n("PCS"); |
340 | else if ((type & Pager) == Pager) | 340 | else if ((type & Pager) == Pager) |
341 | typeString += i18n("Pager"); | 341 | typeString += i18n("Pager"); |
342 | // add the prefered flag | 342 | // add the prefered flag |
343 | /* | 343 | /* |
344 | if ((type & Pref) == Pref) | 344 | if ((type & Pref) == Pref) |
345 | typeString += i18n("(p)"); | 345 | typeString += i18n("(p)"); |
346 | */ | 346 | */ |
347 | //if we still have no match, return "other" | 347 | //if we still have no match, return "other" |
348 | if (typeString.isEmpty()) { | 348 | if (typeString.isEmpty()) { |
349 | if ((type & Voice) == Voice) | 349 | if ((type & Voice) == Voice) |
350 | return i18n("Voice"); | 350 | return i18n("Voice"); |
351 | else | 351 | else |
352 | return i18n("Other"); | 352 | return i18n("Other"); |
353 | } | 353 | } |
354 | 354 | ||
355 | return typeString.stripWhiteSpace(); | 355 | return typeString.stripWhiteSpace(); |
356 | #endif | 356 | #endif |
357 | } | 357 | } |
358 | 358 | ||
359 | QDataStream &KABC::operator<<( QDataStream &s, const PhoneNumber &phone ) | 359 | QDataStream &KABC::operator<<( QDataStream &s, const PhoneNumber &phone ) |
360 | { | 360 | { |
361 | return s << phone.mId << phone.mType << phone.mNumber; | 361 | return s << phone.mId << phone.mType << phone.mNumber; |
362 | } | 362 | } |
363 | 363 | ||
364 | QDataStream &KABC::operator>>( QDataStream &s, PhoneNumber &phone ) | 364 | QDataStream &KABC::operator>>( QDataStream &s, PhoneNumber &phone ) |
365 | { | 365 | { |
366 | s >> phone.mId >> phone.mType >> phone.mNumber; | 366 | s >> phone.mId >> phone.mType >> phone.mNumber; |
367 | 367 | ||
368 | return s; | 368 | return s; |
369 | } | 369 | } |
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index 4044fa8..862241e 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp | |||
@@ -1,969 +1,969 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> |
4 | based on the code of KSpread's CSV Import Dialog | 4 | based on the code of KSpread's CSV Import Dialog |
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 | 29 | ||
30 | #include <qbuttongroup.h> | 30 | #include <qbuttongroup.h> |
31 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #ifdef DESKTOP_VERSION | 33 | #ifdef DESKTOP_VERSION |
34 | #include <qinputdialog.h> | 34 | #include <qinputdialog.h> |
35 | #else | 35 | #else |
36 | #include <qtcompat/qinputdialog.h> | 36 | #include <qtcompat/qinputdialog.h> |
37 | #endif | 37 | #endif |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qtable.h> | 42 | #include <qtable.h> |
43 | #include <qlayout.h> | 43 | #include <qlayout.h> |
44 | #include <qtextstream.h> | 44 | #include <qtextstream.h> |
45 | #include <qfile.h> | 45 | #include <qfile.h> |
46 | 46 | ||
47 | #include <kapplication.h> | 47 | #include <kapplication.h> |
48 | #include <kdebug.h> | 48 | #include <kdebug.h> |
49 | #include <kdialogbase.h> | 49 | #include <kdialogbase.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <klineedit.h> | 51 | #include <klineedit.h> |
52 | #include <klocale.h> | 52 | #include <klocale.h> |
53 | #include <kglobal.h> | 53 | #include <kglobal.h> |
54 | #include <kmessagebox.h> | 54 | #include <kmessagebox.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | #include <kurlrequester.h> | 56 | #include <kurlrequester.h> |
57 | 57 | ||
58 | #ifdef DESKTOP_VERSION | 58 | #ifdef DESKTOP_VERSION |
59 | #include "qtable.h" | 59 | #include "qtable.h" |
60 | #else | 60 | #else |
61 | #include "qcombotableitem.h" | 61 | #include "qcombotableitem.h" |
62 | #endif | 62 | #endif |
63 | #include "csvimportdialog.h" | 63 | #include "csvimportdialog.h" |
64 | 64 | ||
65 | CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, | 65 | CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, |
66 | const char * name ) | 66 | const char * name ) |
67 | : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 | | 67 | : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 | |
68 | User2, Ok, parent, name, true, true ), | 68 | User2, Ok, parent, name, true, true ), |
69 | mAdjustRows( false ), | 69 | mAdjustRows( false ), |
70 | mStartLine( 0 ), | 70 | mStartLine( 0 ), |
71 | mTextQuote( '"' ), | 71 | mTextQuote( '"' ), |
72 | mDelimiter( "," ), | 72 | mDelimiter( "," ), |
73 | mAddressBook( ab ) | 73 | mAddressBook( ab ) |
74 | { | 74 | { |
75 | initGUI(); | 75 | initGUI(); |
76 | 76 | ||
77 | mTypeMap.insert( i18n( "Undefined" ), Undefined ); | 77 | mTypeMap.insert( i18n( "Undefined" ), Undefined ); |
78 | mTypeMap.insert( KABC::Addressee::formattedNameLabel(), FormattedName ); | 78 | mTypeMap.insert( KABC::Addressee::formattedNameLabel(), FormattedName ); |
79 | mTypeMap.insert( KABC::Addressee::familyNameLabel(), FamilyName ); | 79 | mTypeMap.insert( KABC::Addressee::familyNameLabel(), FamilyName ); |
80 | mTypeMap.insert( KABC::Addressee::givenNameLabel(), GivenName ); | 80 | mTypeMap.insert( KABC::Addressee::givenNameLabel(), GivenName ); |
81 | mTypeMap.insert( KABC::Addressee::additionalNameLabel(), AdditionalName ); | 81 | mTypeMap.insert( KABC::Addressee::additionalNameLabel(), AdditionalName ); |
82 | mTypeMap.insert( KABC::Addressee::prefixLabel(), Prefix ); | 82 | mTypeMap.insert( KABC::Addressee::prefixLabel(), Prefix ); |
83 | mTypeMap.insert( KABC::Addressee::suffixLabel(), Suffix ); | 83 | mTypeMap.insert( KABC::Addressee::suffixLabel(), Suffix ); |
84 | mTypeMap.insert( KABC::Addressee::nickNameLabel(), NickName ); | 84 | mTypeMap.insert( KABC::Addressee::nickNameLabel(), NickName ); |
85 | mTypeMap.insert( KABC::Addressee::birthdayLabel(), Birthday ); | 85 | mTypeMap.insert( KABC::Addressee::birthdayLabel(), Birthday ); |
86 | 86 | ||
87 | mTypeMap.insert( KABC::Addressee::homeAddressStreetLabel(), HomeAddressStreet ); | 87 | mTypeMap.insert( KABC::Addressee::homeAddressStreetLabel(), HomeAddressStreet ); |
88 | mTypeMap.insert( KABC::Addressee::homeAddressLocalityLabel(), | 88 | mTypeMap.insert( KABC::Addressee::homeAddressLocalityLabel(), |
89 | HomeAddressLocality ); | 89 | HomeAddressLocality ); |
90 | mTypeMap.insert( KABC::Addressee::homeAddressRegionLabel(), HomeAddressRegion ); | 90 | mTypeMap.insert( KABC::Addressee::homeAddressRegionLabel(), HomeAddressRegion ); |
91 | mTypeMap.insert( KABC::Addressee::homeAddressPostalCodeLabel(), | 91 | mTypeMap.insert( KABC::Addressee::homeAddressPostalCodeLabel(), |
92 | HomeAddressPostalCode ); | 92 | HomeAddressPostalCode ); |
93 | mTypeMap.insert( KABC::Addressee::homeAddressCountryLabel(), | 93 | mTypeMap.insert( KABC::Addressee::homeAddressCountryLabel(), |
94 | HomeAddressCountry ); | 94 | HomeAddressCountry ); |
95 | mTypeMap.insert( KABC::Addressee::homeAddressLabelLabel(), HomeAddressLabel ); | 95 | mTypeMap.insert( KABC::Addressee::homeAddressLabelLabel(), HomeAddressLabel ); |
96 | 96 | ||
97 | mTypeMap.insert( KABC::Addressee::businessAddressStreetLabel(), | 97 | mTypeMap.insert( KABC::Addressee::businessAddressStreetLabel(), |
98 | BusinessAddressStreet ); | 98 | BusinessAddressStreet ); |
99 | mTypeMap.insert( KABC::Addressee::businessAddressLocalityLabel(), | 99 | mTypeMap.insert( KABC::Addressee::businessAddressLocalityLabel(), |
100 | BusinessAddressLocality ); | 100 | BusinessAddressLocality ); |
101 | mTypeMap.insert( KABC::Addressee::businessAddressRegionLabel(), | 101 | mTypeMap.insert( KABC::Addressee::businessAddressRegionLabel(), |
102 | BusinessAddressRegion ); | 102 | BusinessAddressRegion ); |
103 | mTypeMap.insert( KABC::Addressee::businessAddressPostalCodeLabel(), | 103 | mTypeMap.insert( KABC::Addressee::businessAddressPostalCodeLabel(), |
104 | BusinessAddressPostalCode ); | 104 | BusinessAddressPostalCode ); |
105 | mTypeMap.insert( KABC::Addressee::businessAddressCountryLabel(), | 105 | mTypeMap.insert( KABC::Addressee::businessAddressCountryLabel(), |
106 | BusinessAddressCountry ); | 106 | BusinessAddressCountry ); |
107 | mTypeMap.insert( KABC::Addressee::businessAddressLabelLabel(), | 107 | mTypeMap.insert( KABC::Addressee::businessAddressLabelLabel(), |
108 | BusinessAddressLabel ); | 108 | BusinessAddressLabel ); |
109 | 109 | ||
110 | mTypeMap.insert( KABC::Addressee::homePhoneLabel(), HomePhone ); | 110 | mTypeMap.insert( KABC::Addressee::homePhoneLabel(), HomePhone ); |
111 | mTypeMap.insert( KABC::Addressee::businessPhoneLabel(), BusinessPhone ); | 111 | mTypeMap.insert( KABC::Addressee::businessPhoneLabel(), BusinessPhone ); |
112 | mTypeMap.insert( KABC::Addressee::mobilePhoneLabel(), MobilePhone ); | 112 | mTypeMap.insert( KABC::Addressee::mobilePhoneLabel(), MobilePhone ); |
113 | mTypeMap.insert( KABC::Addressee::homeFaxLabel(), HomeFax ); | 113 | mTypeMap.insert( KABC::Addressee::homeFaxLabel(), HomeFax ); |
114 | mTypeMap.insert( KABC::Addressee::businessFaxLabel(), BusinessFax ); | 114 | mTypeMap.insert( KABC::Addressee::businessFaxLabel(), BusinessFax ); |
115 | mTypeMap.insert( KABC::Addressee::carPhoneLabel(), CarPhone ); | 115 | mTypeMap.insert( KABC::Addressee::mobileWorkPhoneLabel(), MobileWorkPhone ); |
116 | mTypeMap.insert( KABC::Addressee::isdnLabel(), Isdn ); | 116 | mTypeMap.insert( KABC::Addressee::isdnLabel(), Isdn ); |
117 | mTypeMap.insert( KABC::Addressee::pagerLabel(), Pager ); | 117 | mTypeMap.insert( KABC::Addressee::pagerLabel(), Pager ); |
118 | mTypeMap.insert( KABC::Addressee::emailLabel(), Email ); | 118 | mTypeMap.insert( KABC::Addressee::emailLabel(), Email ); |
119 | mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer ); | 119 | mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer ); |
120 | mTypeMap.insert( KABC::Addressee::titleLabel(), Title ); | 120 | mTypeMap.insert( KABC::Addressee::titleLabel(), Title ); |
121 | mTypeMap.insert( KABC::Addressee::roleLabel(), Role ); | 121 | mTypeMap.insert( KABC::Addressee::roleLabel(), Role ); |
122 | mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization ); | 122 | mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization ); |
123 | mTypeMap.insert( KABC::Addressee::noteLabel(), Note ); | 123 | mTypeMap.insert( KABC::Addressee::noteLabel(), Note ); |
124 | mTypeMap.insert( KABC::Addressee::urlLabel(), URL ); | 124 | mTypeMap.insert( KABC::Addressee::urlLabel(), URL ); |
125 | mTypeMap.insert( KABC::Addressee::categoryLabel(), Categories ); | 125 | mTypeMap.insert( KABC::Addressee::categoryLabel(), Categories ); |
126 | 126 | ||
127 | mCustomCounter = mTypeMap.count(); | 127 | mCustomCounter = mTypeMap.count(); |
128 | int count = mCustomCounter; | 128 | int count = mCustomCounter; |
129 | 129 | ||
130 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); | 130 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); |
131 | KABC::Field::List::Iterator it; | 131 | KABC::Field::List::Iterator it; |
132 | for ( it = fields.begin(); it != fields.end(); ++it, ++count ) | 132 | for ( it = fields.begin(); it != fields.end(); ++it, ++count ) |
133 | mTypeMap.insert( (*it)->label(), count ); | 133 | mTypeMap.insert( (*it)->label(), count ); |
134 | 134 | ||
135 | connect( mDelimiterBox, SIGNAL( clicked( int ) ), | 135 | connect( mDelimiterBox, SIGNAL( clicked( int ) ), |
136 | this, SLOT( delimiterClicked( int ) ) ); | 136 | this, SLOT( delimiterClicked( int ) ) ); |
137 | connect( mDelimiterEdit, SIGNAL( returnPressed() ), | 137 | connect( mDelimiterEdit, SIGNAL( returnPressed() ), |
138 | this, SLOT( returnPressed() ) ); | 138 | this, SLOT( returnPressed() ) ); |
139 | connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), | 139 | connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), |
140 | this, SLOT( textChanged ( const QString& ) ) ); | 140 | this, SLOT( textChanged ( const QString& ) ) ); |
141 | connect( mComboLine, SIGNAL( activated( const QString& ) ), | 141 | connect( mComboLine, SIGNAL( activated( const QString& ) ), |
142 | this, SLOT( lineSelected( const QString& ) ) ); | 142 | this, SLOT( lineSelected( const QString& ) ) ); |
143 | connect( mComboCodec, SIGNAL( activated( const QString& ) ), | 143 | connect( mComboCodec, SIGNAL( activated( const QString& ) ), |
144 | this, SLOT( codecChanged( const QString& ) ) ); | 144 | this, SLOT( codecChanged( const QString& ) ) ); |
145 | connect( mComboQuote, SIGNAL( activated( const QString& ) ), | 145 | connect( mComboQuote, SIGNAL( activated( const QString& ) ), |
146 | this, SLOT( textquoteSelected( const QString& ) ) ); | 146 | this, SLOT( textquoteSelected( const QString& ) ) ); |
147 | connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), | 147 | connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), |
148 | this, SLOT( ignoreDuplicatesChanged( int ) ) ); | 148 | this, SLOT( ignoreDuplicatesChanged( int ) ) ); |
149 | 149 | ||
150 | connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), | 150 | connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), |
151 | this, SLOT( setFile( const QString& ) ) ); | 151 | this, SLOT( setFile( const QString& ) ) ); |
152 | connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ), | 152 | connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ), |
153 | this, SLOT( setFile( const QString& ) ) ); | 153 | this, SLOT( setFile( const QString& ) ) ); |
154 | connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ), | 154 | connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ), |
155 | this, SLOT( urlChanged( const QString& ) ) ); | 155 | this, SLOT( urlChanged( const QString& ) ) ); |
156 | 156 | ||
157 | connect( this, SIGNAL( user1Clicked() ), | 157 | connect( this, SIGNAL( user1Clicked() ), |
158 | this, SLOT( applyTemplate() ) ); | 158 | this, SLOT( applyTemplate() ) ); |
159 | 159 | ||
160 | connect( this, SIGNAL( user2Clicked() ), | 160 | connect( this, SIGNAL( user2Clicked() ), |
161 | this, SLOT( saveTemplate() ) ); | 161 | this, SLOT( saveTemplate() ) ); |
162 | 162 | ||
163 | // if ( QApplication::desktop()->width() < 321 ) | 163 | // if ( QApplication::desktop()->width() < 321 ) |
164 | QIconSet icon = SmallIcon("filesave"); | 164 | QIconSet icon = SmallIcon("filesave"); |
165 | 165 | ||
166 | findButton( User2 )->setIconSet (icon ) ; | 166 | findButton( User2 )->setIconSet (icon ) ; |
167 | icon = SmallIcon("fileopen"); | 167 | icon = SmallIcon("fileopen"); |
168 | findButton( User1 )->setIconSet (icon ) ; | 168 | findButton( User1 )->setIconSet (icon ) ; |
169 | int wid = findButton( User2 )->sizeHint().height(); | 169 | int wid = findButton( User2 )->sizeHint().height(); |
170 | findButton( User2 )->setMaximumWidth( wid+4 ); | 170 | findButton( User2 )->setMaximumWidth( wid+4 ); |
171 | findButton( User1 )->setMaximumWidth( wid+4 ); | 171 | findButton( User1 )->setMaximumWidth( wid+4 ); |
172 | } | 172 | } |
173 | 173 | ||
174 | CSVImportDialog::~CSVImportDialog() | 174 | CSVImportDialog::~CSVImportDialog() |
175 | { | 175 | { |
176 | } | 176 | } |
177 | 177 | ||
178 | KABC::AddresseeList CSVImportDialog::contacts() const | 178 | KABC::AddresseeList CSVImportDialog::contacts() const |
179 | { | 179 | { |
180 | KABC::AddresseeList contacts; | 180 | KABC::AddresseeList contacts; |
181 | 181 | ||
182 | for ( int row = 1; row < mTable->numRows(); ++row ) { | 182 | for ( int row = 1; row < mTable->numRows(); ++row ) { |
183 | KABC::Addressee a; | 183 | KABC::Addressee a; |
184 | bool emptyRow = true; | 184 | bool emptyRow = true; |
185 | KABC::Address addrHome( KABC::Address::Home ); | 185 | KABC::Address addrHome( KABC::Address::Home ); |
186 | KABC::Address addrWork( KABC::Address::Work ); | 186 | KABC::Address addrWork( KABC::Address::Work ); |
187 | for ( int col = 0; col < mTable->numCols(); ++col ) { | 187 | for ( int col = 0; col < mTable->numCols(); ++col ) { |
188 | 188 | ||
189 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); | 189 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); |
190 | 190 | ||
191 | if ( !item ) { | 191 | if ( !item ) { |
192 | qDebug( "ERROR: item cast failed" ); | 192 | qDebug( "ERROR: item cast failed" ); |
193 | continue; | 193 | continue; |
194 | } | 194 | } |
195 | 195 | ||
196 | QString value = mTable->text( row, col ); | 196 | QString value = mTable->text( row, col ); |
197 | if ( !value.isEmpty() ) | 197 | if ( !value.isEmpty() ) |
198 | emptyRow = false; | 198 | emptyRow = false; |
199 | 199 | ||
200 | switch ( posToType( item->currentItem() ) ) | 200 | switch ( posToType( item->currentItem() ) ) |
201 | { | 201 | { |
202 | case Undefined: | 202 | case Undefined: |
203 | continue; | 203 | continue; |
204 | break; | 204 | break; |
205 | case FormattedName: | 205 | case FormattedName: |
206 | a.setFormattedName( value ); | 206 | a.setFormattedName( value ); |
207 | break; | 207 | break; |
208 | case GivenName: | 208 | case GivenName: |
209 | a.setGivenName( value ); | 209 | a.setGivenName( value ); |
210 | break; | 210 | break; |
211 | case FamilyName: | 211 | case FamilyName: |
212 | a.setFamilyName( value ); | 212 | a.setFamilyName( value ); |
213 | break; | 213 | break; |
214 | case AdditionalName: | 214 | case AdditionalName: |
215 | a.setAdditionalName( value ); | 215 | a.setAdditionalName( value ); |
216 | break; | 216 | break; |
217 | case Prefix: | 217 | case Prefix: |
218 | a.setPrefix( value ); | 218 | a.setPrefix( value ); |
219 | break; | 219 | break; |
220 | case Suffix: | 220 | case Suffix: |
221 | a.setSuffix( value ); | 221 | a.setSuffix( value ); |
222 | break; | 222 | break; |
223 | case NickName: | 223 | case NickName: |
224 | a.setNickName( value ); | 224 | a.setNickName( value ); |
225 | break; | 225 | break; |
226 | case Birthday: | 226 | case Birthday: |
227 | //US | 227 | //US |
228 | //the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); | 228 | //the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); |
229 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? | 229 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? |
230 | { | 230 | { |
231 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate | 231 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate |
232 | a.setBirthday(dt); | 232 | a.setBirthday(dt); |
233 | } | 233 | } |
234 | break; | 234 | break; |
235 | case Email: | 235 | case Email: |
236 | if ( !value.isEmpty() ) | 236 | if ( !value.isEmpty() ) |
237 | a.insertEmail( value, true ); | 237 | a.insertEmail( value, true ); |
238 | break; | 238 | break; |
239 | case Role: | 239 | case Role: |
240 | a.setRole( value ); | 240 | a.setRole( value ); |
241 | break; | 241 | break; |
242 | case Title: | 242 | case Title: |
243 | a.setTitle( value ); | 243 | a.setTitle( value ); |
244 | break; | 244 | break; |
245 | case Mailer: | 245 | case Mailer: |
246 | a.setMailer( value ); | 246 | a.setMailer( value ); |
247 | break; | 247 | break; |
248 | case URL: | 248 | case URL: |
249 | a.setUrl( value ); | 249 | a.setUrl( value ); |
250 | break; | 250 | break; |
251 | case Organization: | 251 | case Organization: |
252 | a.setOrganization( value ); | 252 | a.setOrganization( value ); |
253 | break; | 253 | break; |
254 | case Note: | 254 | case Note: |
255 | if ( a.note().isEmpty() ) | 255 | if ( a.note().isEmpty() ) |
256 | a.setNote( value ); | 256 | a.setNote( value ); |
257 | else { | 257 | else { |
258 | a.setNote( a.note()+"\n"+value ); | 258 | a.setNote( a.note()+"\n"+value ); |
259 | } | 259 | } |
260 | break; | 260 | break; |
261 | case Categories: | 261 | case Categories: |
262 | a.insertCategory( value ); | 262 | a.insertCategory( value ); |
263 | break; | 263 | break; |
264 | case HomePhone: | 264 | case HomePhone: |
265 | if ( !value.isEmpty() ) { | 265 | if ( !value.isEmpty() ) { |
266 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home ); | 266 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home ); |
267 | a.insertPhoneNumber( number ); | 267 | a.insertPhoneNumber( number ); |
268 | } | 268 | } |
269 | break; | 269 | break; |
270 | case BusinessPhone: | 270 | case BusinessPhone: |
271 | if ( !value.isEmpty() ) { | 271 | if ( !value.isEmpty() ) { |
272 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work ); | 272 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work ); |
273 | a.insertPhoneNumber( number ); | 273 | a.insertPhoneNumber( number ); |
274 | } | 274 | } |
275 | break; | 275 | break; |
276 | case MobilePhone: | 276 | case MobilePhone: |
277 | if ( !value.isEmpty() ) { | 277 | if ( !value.isEmpty() ) { |
278 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Cell ); | 278 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Cell ); |
279 | a.insertPhoneNumber( number ); | 279 | a.insertPhoneNumber( number ); |
280 | } | 280 | } |
281 | break; | 281 | break; |
282 | case HomeFax: | 282 | case HomeFax: |
283 | if ( !value.isEmpty() ) { | 283 | if ( !value.isEmpty() ) { |
284 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home | | 284 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home | |
285 | KABC::PhoneNumber::Fax ); | 285 | KABC::PhoneNumber::Fax ); |
286 | a.insertPhoneNumber( number ); | 286 | a.insertPhoneNumber( number ); |
287 | } | 287 | } |
288 | break; | 288 | break; |
289 | case BusinessFax: | 289 | case BusinessFax: |
290 | if ( !value.isEmpty() ) { | 290 | if ( !value.isEmpty() ) { |
291 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work | | 291 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work | |
292 | KABC::PhoneNumber::Fax ); | 292 | KABC::PhoneNumber::Fax ); |
293 | a.insertPhoneNumber( number ); | 293 | a.insertPhoneNumber( number ); |
294 | } | 294 | } |
295 | break; | 295 | break; |
296 | case CarPhone: | 296 | case MobileWorkPhone: |
297 | if ( !value.isEmpty() ) { | 297 | if ( !value.isEmpty() ) { |
298 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Car ); | 298 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Car ); |
299 | a.insertPhoneNumber( number ); | 299 | a.insertPhoneNumber( number ); |
300 | } | 300 | } |
301 | break; | 301 | break; |
302 | case Isdn: | 302 | case Isdn: |
303 | if ( !value.isEmpty() ) { | 303 | if ( !value.isEmpty() ) { |
304 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Isdn ); | 304 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Isdn ); |
305 | a.insertPhoneNumber( number ); | 305 | a.insertPhoneNumber( number ); |
306 | } | 306 | } |
307 | break; | 307 | break; |
308 | case Pager: | 308 | case Pager: |
309 | if ( !value.isEmpty() ) { | 309 | if ( !value.isEmpty() ) { |
310 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Pager ); | 310 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Pager ); |
311 | a.insertPhoneNumber( number ); | 311 | a.insertPhoneNumber( number ); |
312 | } | 312 | } |
313 | break; | 313 | break; |
314 | 314 | ||
315 | case HomeAddressStreet: | 315 | case HomeAddressStreet: |
316 | addrHome.setStreet( value ); | 316 | addrHome.setStreet( value ); |
317 | break; | 317 | break; |
318 | case HomeAddressLocality: | 318 | case HomeAddressLocality: |
319 | addrHome.setLocality( value ); | 319 | addrHome.setLocality( value ); |
320 | break; | 320 | break; |
321 | case HomeAddressRegion: | 321 | case HomeAddressRegion: |
322 | addrHome.setRegion( value ); | 322 | addrHome.setRegion( value ); |
323 | break; | 323 | break; |
324 | case HomeAddressPostalCode: | 324 | case HomeAddressPostalCode: |
325 | addrHome.setPostalCode( value ); | 325 | addrHome.setPostalCode( value ); |
326 | break; | 326 | break; |
327 | case HomeAddressCountry: | 327 | case HomeAddressCountry: |
328 | addrHome.setCountry( value ); | 328 | addrHome.setCountry( value ); |
329 | break; | 329 | break; |
330 | case HomeAddressLabel: | 330 | case HomeAddressLabel: |
331 | addrHome.setLabel( value ); | 331 | addrHome.setLabel( value ); |
332 | break; | 332 | break; |
333 | 333 | ||
334 | case BusinessAddressStreet: | 334 | case BusinessAddressStreet: |
335 | addrWork.setStreet( value ); | 335 | addrWork.setStreet( value ); |
336 | break; | 336 | break; |
337 | case BusinessAddressLocality: | 337 | case BusinessAddressLocality: |
338 | addrWork.setLocality( value ); | 338 | addrWork.setLocality( value ); |
339 | break; | 339 | break; |
340 | case BusinessAddressRegion: | 340 | case BusinessAddressRegion: |
341 | addrWork.setRegion( value ); | 341 | addrWork.setRegion( value ); |
342 | break; | 342 | break; |
343 | case BusinessAddressPostalCode: | 343 | case BusinessAddressPostalCode: |
344 | addrWork.setPostalCode( value ); | 344 | addrWork.setPostalCode( value ); |
345 | break; | 345 | break; |
346 | case BusinessAddressCountry: | 346 | case BusinessAddressCountry: |
347 | addrWork.setCountry( value ); | 347 | addrWork.setCountry( value ); |
348 | break; | 348 | break; |
349 | case BusinessAddressLabel: | 349 | case BusinessAddressLabel: |
350 | addrWork.setLabel( value ); | 350 | addrWork.setLabel( value ); |
351 | break; | 351 | break; |
352 | default: | 352 | default: |
353 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); | 353 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); |
354 | KABC::Field::List::Iterator it; | 354 | KABC::Field::List::Iterator it; |
355 | 355 | ||
356 | int counter = 0; | 356 | int counter = 0; |
357 | for ( it = fields.begin(); it != fields.end(); ++it ) { | 357 | for ( it = fields.begin(); it != fields.end(); ++it ) { |
358 | if ( counter == (int)( posToType( item->currentItem() ) - mCustomCounter ) ) | 358 | if ( counter == (int)( posToType( item->currentItem() ) - mCustomCounter ) ) |
359 | { | 359 | { |
360 | (*it)->setValue( a, value ); | 360 | (*it)->setValue( a, value ); |
361 | break; | 361 | break; |
362 | } | 362 | } |
363 | ++counter; | 363 | ++counter; |
364 | } | 364 | } |
365 | break; | 365 | break; |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | if ( !addrHome.isEmpty() ) | 369 | if ( !addrHome.isEmpty() ) |
370 | a.insertAddress( addrHome ); | 370 | a.insertAddress( addrHome ); |
371 | if ( !addrWork.isEmpty() ) | 371 | if ( !addrWork.isEmpty() ) |
372 | a.insertAddress( addrWork ); | 372 | a.insertAddress( addrWork ); |
373 | 373 | ||
374 | if ( !emptyRow && !a.isEmpty() ) | 374 | if ( !emptyRow && !a.isEmpty() ) |
375 | contacts.append( a ); | 375 | contacts.append( a ); |
376 | } | 376 | } |
377 | 377 | ||
378 | return contacts; | 378 | return contacts; |
379 | } | 379 | } |
380 | 380 | ||
381 | void CSVImportDialog::initGUI() | 381 | void CSVImportDialog::initGUI() |
382 | { | 382 | { |
383 | QWidget* page = plainPage(); | 383 | QWidget* page = plainPage(); |
384 | 384 | ||
385 | QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), | 385 | QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), |
386 | spacingHintSmall() ); | 386 | spacingHintSmall() ); |
387 | QHBoxLayout *hbox = new QHBoxLayout(); | 387 | QHBoxLayout *hbox = new QHBoxLayout(); |
388 | hbox->setSpacing( spacingHint() ); | 388 | hbox->setSpacing( spacingHint() ); |
389 | 389 | ||
390 | QLabel *label = new QLabel( i18n( "File to import:" ), page ); | 390 | QLabel *label = new QLabel( i18n( "File to import:" ), page ); |
391 | hbox->addWidget( label ); | 391 | hbox->addWidget( label ); |
392 | 392 | ||
393 | mUrlRequester = new KURLRequester( page ); | 393 | mUrlRequester = new KURLRequester( page ); |
394 | mUrlRequester->setFilter( "*.csv" ); | 394 | mUrlRequester->setFilter( "*.csv" ); |
395 | hbox->addWidget( mUrlRequester ); | 395 | hbox->addWidget( mUrlRequester ); |
396 | 396 | ||
397 | layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); | 397 | layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); |
398 | 398 | ||
399 | // Delimiter: comma, semicolon, tab, space, other | 399 | // Delimiter: comma, semicolon, tab, space, other |
400 | mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); | 400 | mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); |
401 | mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); | 401 | mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); |
402 | mDelimiterBox->layout()->setSpacing( spacingHint() ); | 402 | mDelimiterBox->layout()->setSpacing( spacingHint() ); |
403 | mDelimiterBox->layout()->setMargin( marginHint() ); | 403 | mDelimiterBox->layout()->setMargin( marginHint() ); |
404 | QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); | 404 | QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); |
405 | delimiterLayout->setAlignment( Qt::AlignTop ); | 405 | delimiterLayout->setAlignment( Qt::AlignTop ); |
406 | layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); | 406 | layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); |
407 | 407 | ||
408 | mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); | 408 | mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); |
409 | mRadioComma->setChecked( true ); | 409 | mRadioComma->setChecked( true ); |
410 | delimiterLayout->addWidget( mRadioComma, 0, 0 ); | 410 | delimiterLayout->addWidget( mRadioComma, 0, 0 ); |
411 | 411 | ||
412 | mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); | 412 | mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); |
413 | delimiterLayout->addWidget( mRadioSemicolon, 0, 1 ); | 413 | delimiterLayout->addWidget( mRadioSemicolon, 0, 1 ); |
414 | 414 | ||
415 | mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox ); | 415 | mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox ); |
416 | delimiterLayout->addWidget( mRadioTab, 1, 0 ); | 416 | delimiterLayout->addWidget( mRadioTab, 1, 0 ); |
417 | 417 | ||
418 | mRadioSpace = new QRadioButton( i18n( "Space" ), mDelimiterBox ); | 418 | mRadioSpace = new QRadioButton( i18n( "Space" ), mDelimiterBox ); |
419 | delimiterLayout->addWidget( mRadioSpace, 1, 1 ); | 419 | delimiterLayout->addWidget( mRadioSpace, 1, 1 ); |
420 | 420 | ||
421 | mRadioOther = new QRadioButton( i18n( "Other" ), mDelimiterBox ); | 421 | mRadioOther = new QRadioButton( i18n( "Other" ), mDelimiterBox ); |
422 | delimiterLayout->addWidget( mRadioOther, 0, 2 ); | 422 | delimiterLayout->addWidget( mRadioOther, 0, 2 ); |
423 | 423 | ||
424 | mDelimiterEdit = new QLineEdit( mDelimiterBox ); | 424 | mDelimiterEdit = new QLineEdit( mDelimiterBox ); |
425 | delimiterLayout->addWidget( mDelimiterEdit, 1, 2 ); | 425 | delimiterLayout->addWidget( mDelimiterEdit, 1, 2 ); |
426 | 426 | ||
427 | mComboLine = new QComboBox( false, page ); | 427 | mComboLine = new QComboBox( false, page ); |
428 | mComboLine->insertItem( i18n( "1" ) ); | 428 | mComboLine->insertItem( i18n( "1" ) ); |
429 | layout->addWidget( mComboLine, 3, 1 ); | 429 | layout->addWidget( mComboLine, 3, 1 ); |
430 | 430 | ||
431 | mComboQuote = new QComboBox( false, page ); | 431 | mComboQuote = new QComboBox( false, page ); |
432 | mComboQuote->insertItem( i18n( "\"" ), 0 ); | 432 | mComboQuote->insertItem( i18n( "\"" ), 0 ); |
433 | mComboQuote->insertItem( i18n( "'" ), 1 ); | 433 | mComboQuote->insertItem( i18n( "'" ), 1 ); |
434 | mComboQuote->insertItem( i18n( "None" ), 2 ); | 434 | mComboQuote->insertItem( i18n( "None" ), 2 ); |
435 | layout->addWidget( mComboQuote, 3, 0 ); | 435 | layout->addWidget( mComboQuote, 3, 0 ); |
436 | mComboCodec = new QComboBox( false, page ); | 436 | mComboCodec = new QComboBox( false, page ); |
437 | mComboCodec->insertItem( i18n( "UTF8" ), 0 ); | 437 | mComboCodec->insertItem( i18n( "UTF8" ), 0 ); |
438 | mComboCodec->insertItem( i18n( "LATIN1" ), 1 ); | 438 | mComboCodec->insertItem( i18n( "LATIN1" ), 1 ); |
439 | mComboCodec->insertItem( i18n( "LOCALE" ), 2 ); | 439 | mComboCodec->insertItem( i18n( "LOCALE" ), 2 ); |
440 | layout->addWidget( mComboCodec, 3, 2 ); | 440 | layout->addWidget( mComboCodec, 3, 2 ); |
441 | label = new QLabel( i18n( "Start at line:" ), page ); | 441 | label = new QLabel( i18n( "Start at line:" ), page ); |
442 | layout->addWidget( label, 2, 1 ); | 442 | layout->addWidget( label, 2, 1 ); |
443 | 443 | ||
444 | label = new QLabel( i18n( "Textquote:" ), page ); | 444 | label = new QLabel( i18n( "Textquote:" ), page ); |
445 | layout->addWidget( label, 2, 0 ); | 445 | layout->addWidget( label, 2, 0 ); |
446 | label = new QLabel( i18n( "Codec:" ), page ); | 446 | label = new QLabel( i18n( "Codec:" ), page ); |
447 | layout->addWidget( label, 2, 2 ); | 447 | layout->addWidget( label, 2, 2 ); |
448 | 448 | ||
449 | mIgnoreDuplicates = new QCheckBox( page ); | 449 | mIgnoreDuplicates = new QCheckBox( page ); |
450 | mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); | 450 | mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); |
451 | layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); | 451 | layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); |
452 | 452 | ||
453 | mTable = new QTable( 0, 0, page ); | 453 | mTable = new QTable( 0, 0, page ); |
454 | mTable->setSelectionMode( QTable::NoSelection ); | 454 | mTable->setSelectionMode( QTable::NoSelection ); |
455 | //mTable->horizontalHeader()->hide(); | 455 | //mTable->horizontalHeader()->hide(); |
456 | layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); | 456 | layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); |
457 | /*US | 457 | /*US |
458 | setButtonText( User1, i18n( "Apply Template" ) ); | 458 | setButtonText( User1, i18n( "Apply Template" ) ); |
459 | setButtonText( User2, i18n( "Save Template" ) ); | 459 | setButtonText( User2, i18n( "Save Template" ) ); |
460 | */ | 460 | */ |
461 | 461 | ||
462 | enableButtonOK( false ); | 462 | enableButtonOK( false ); |
463 | 463 | ||
464 | findButton( User1 )->setEnabled( false ); | 464 | findButton( User1 )->setEnabled( false ); |
465 | findButton( User2 )->setEnabled( false ); | 465 | findButton( User2 )->setEnabled( false ); |
466 | 466 | ||
467 | #ifdef DESKTOP_VERSION | 467 | #ifdef DESKTOP_VERSION |
468 | resize( 640, 480 ); | 468 | resize( 640, 480 ); |
469 | #else | 469 | #else |
470 | showMaximized(); | 470 | showMaximized(); |
471 | #endif | 471 | #endif |
472 | } | 472 | } |
473 | 473 | ||
474 | void CSVImportDialog::fillTable() | 474 | void CSVImportDialog::fillTable() |
475 | { | 475 | { |
476 | int row, column; | 476 | int row, column; |
477 | bool lastCharDelimiter = false; | 477 | bool lastCharDelimiter = false; |
478 | bool ignoreDups = mIgnoreDuplicates->isChecked(); | 478 | bool ignoreDups = mIgnoreDuplicates->isChecked(); |
479 | enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD, | 479 | enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD, |
480 | S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; | 480 | S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; |
481 | 481 | ||
482 | QChar x; | 482 | QChar x; |
483 | QString field = ""; | 483 | QString field = ""; |
484 | 484 | ||
485 | // store previous assignment | 485 | // store previous assignment |
486 | QValueList<int> mTypeOld = mTypeStore; | 486 | QValueList<int> mTypeOld = mTypeStore; |
487 | 487 | ||
488 | mTypeStore.clear(); | 488 | mTypeStore.clear(); |
489 | for ( column = 0; column < mTable->numCols(); ++column ) { | 489 | for ( column = 0; column < mTable->numCols(); ++column ) { |
490 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); | 490 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); |
491 | 491 | ||
492 | if ( !item || mClearTypeStore ) | 492 | if ( !item || mClearTypeStore ) |
493 | mTypeStore.append( typeToPos( Undefined ) ); | 493 | mTypeStore.append( typeToPos( Undefined ) ); |
494 | else if ( item ) | 494 | else if ( item ) |
495 | mTypeStore.append( item->currentItem() ); | 495 | mTypeStore.append( item->currentItem() ); |
496 | } | 496 | } |
497 | 497 | ||
498 | clearTable(); | 498 | clearTable(); |
499 | 499 | ||
500 | row = column = 1; | 500 | row = column = 1; |
501 | if ( mComboCodec->currentItem () == 0 ) { | 501 | if ( mComboCodec->currentItem () == 0 ) { |
502 | mData = QString::fromUtf8( mFileArray.data() ); | 502 | mData = QString::fromUtf8( mFileArray.data() ); |
503 | } else if ( mComboCodec->currentItem () == 1 ) { | 503 | } else if ( mComboCodec->currentItem () == 1 ) { |
504 | mData = QString::fromLatin1( mFileArray.data() ); | 504 | mData = QString::fromLatin1( mFileArray.data() ); |
505 | } else { | 505 | } else { |
506 | mData = QString::fromLocal8Bit( mFileArray.data() ); | 506 | mData = QString::fromLocal8Bit( mFileArray.data() ); |
507 | } | 507 | } |
508 | 508 | ||
509 | QTextStream inputStream( mData, IO_ReadOnly ); | 509 | QTextStream inputStream( mData, IO_ReadOnly ); |
510 | 510 | ||
511 | if ( mComboCodec->currentItem () == 0 ) { | 511 | if ( mComboCodec->currentItem () == 0 ) { |
512 | inputStream.setEncoding( QTextStream::UnicodeUTF8 ); | 512 | inputStream.setEncoding( QTextStream::UnicodeUTF8 ); |
513 | } else if ( mComboCodec->currentItem () == 1 ) { | 513 | } else if ( mComboCodec->currentItem () == 1 ) { |
514 | inputStream.setEncoding( QTextStream::Latin1 ); | 514 | inputStream.setEncoding( QTextStream::Latin1 ); |
515 | } else { | 515 | } else { |
516 | inputStream.setEncoding( QTextStream::Locale ); | 516 | inputStream.setEncoding( QTextStream::Locale ); |
517 | } | 517 | } |
518 | 518 | ||
519 | int maxColumn = 0; | 519 | int maxColumn = 0; |
520 | while ( !inputStream.atEnd() ) { | 520 | while ( !inputStream.atEnd() ) { |
521 | inputStream >> x; // read one char | 521 | inputStream >> x; // read one char |
522 | 522 | ||
523 | if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly | 523 | if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly |
524 | 524 | ||
525 | switch ( state ) { | 525 | switch ( state ) { |
526 | case S_START : | 526 | case S_START : |
527 | if ( x == mTextQuote ) { | 527 | if ( x == mTextQuote ) { |
528 | state = S_QUOTED_FIELD; | 528 | state = S_QUOTED_FIELD; |
529 | } else if ( x == mDelimiter ) { | 529 | } else if ( x == mDelimiter ) { |
530 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 530 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
531 | ++column; | 531 | ++column; |
532 | lastCharDelimiter = true; | 532 | lastCharDelimiter = true; |
533 | } else if ( x == '\n' ) { | 533 | } else if ( x == '\n' ) { |
534 | ++row; | 534 | ++row; |
535 | column = 1; | 535 | column = 1; |
536 | } else { | 536 | } else { |
537 | field += x; | 537 | field += x; |
538 | state = S_MAYBE_NORMAL_FIELD; | 538 | state = S_MAYBE_NORMAL_FIELD; |
539 | } | 539 | } |
540 | break; | 540 | break; |
541 | case S_QUOTED_FIELD : | 541 | case S_QUOTED_FIELD : |
542 | if ( x == mTextQuote ) { | 542 | if ( x == mTextQuote ) { |
543 | state = S_MAYBE_END_OF_QUOTED_FIELD; | 543 | state = S_MAYBE_END_OF_QUOTED_FIELD; |
544 | } else if ( x == '\n' && mTextQuote.isNull() ) { | 544 | } else if ( x == '\n' && mTextQuote.isNull() ) { |
545 | setText( row - mStartLine + 1, column, field ); | 545 | setText( row - mStartLine + 1, column, field ); |
546 | field = ""; | 546 | field = ""; |
547 | if ( x == '\n' ) { | 547 | if ( x == '\n' ) { |
548 | ++row; | 548 | ++row; |
549 | column = 1; | 549 | column = 1; |
550 | } else { | 550 | } else { |
551 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 551 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
552 | ++column; | 552 | ++column; |
553 | lastCharDelimiter = true; | 553 | lastCharDelimiter = true; |
554 | } | 554 | } |
555 | state = S_START; | 555 | state = S_START; |
556 | } else { | 556 | } else { |
557 | field += x; | 557 | field += x; |
558 | } | 558 | } |
559 | break; | 559 | break; |
560 | case S_MAYBE_END_OF_QUOTED_FIELD : | 560 | case S_MAYBE_END_OF_QUOTED_FIELD : |
561 | if ( x == mTextQuote ) { | 561 | if ( x == mTextQuote ) { |
562 | field += x; | 562 | field += x; |
563 | state = S_QUOTED_FIELD; | 563 | state = S_QUOTED_FIELD; |
564 | } else if ( x == mDelimiter || x == '\n' ) { | 564 | } else if ( x == mDelimiter || x == '\n' ) { |
565 | setText( row - mStartLine + 1, column, field ); | 565 | setText( row - mStartLine + 1, column, field ); |
566 | field = ""; | 566 | field = ""; |
567 | if ( x == '\n' ) { | 567 | if ( x == '\n' ) { |
568 | ++row; | 568 | ++row; |
569 | column = 1; | 569 | column = 1; |
570 | } else { | 570 | } else { |
571 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 571 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
572 | ++column; | 572 | ++column; |
573 | lastCharDelimiter = true; | 573 | lastCharDelimiter = true; |
574 | } | 574 | } |
575 | state = S_START; | 575 | state = S_START; |
576 | } else { | 576 | } else { |
577 | state = S_END_OF_QUOTED_FIELD; | 577 | state = S_END_OF_QUOTED_FIELD; |
578 | } | 578 | } |
579 | break; | 579 | break; |
580 | case S_END_OF_QUOTED_FIELD : | 580 | case S_END_OF_QUOTED_FIELD : |
581 | if ( x == mDelimiter || x == '\n' ) { | 581 | if ( x == mDelimiter || x == '\n' ) { |
582 | setText( row - mStartLine + 1, column, field ); | 582 | setText( row - mStartLine + 1, column, field ); |
583 | field = ""; | 583 | field = ""; |
584 | if ( x == '\n' ) { | 584 | if ( x == '\n' ) { |
585 | ++row; | 585 | ++row; |
586 | column = 1; | 586 | column = 1; |
587 | } else { | 587 | } else { |
588 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 588 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
589 | ++column; | 589 | ++column; |
590 | lastCharDelimiter = true; | 590 | lastCharDelimiter = true; |
591 | } | 591 | } |
592 | state = S_START; | 592 | state = S_START; |
593 | } else { | 593 | } else { |
594 | state = S_END_OF_QUOTED_FIELD; | 594 | state = S_END_OF_QUOTED_FIELD; |
595 | } | 595 | } |
596 | break; | 596 | break; |
597 | case S_MAYBE_NORMAL_FIELD : | 597 | case S_MAYBE_NORMAL_FIELD : |
598 | if ( x == mTextQuote ) { | 598 | if ( x == mTextQuote ) { |
599 | field = ""; | 599 | field = ""; |
600 | state = S_QUOTED_FIELD; | 600 | state = S_QUOTED_FIELD; |
601 | break; | 601 | break; |
602 | } | 602 | } |
603 | case S_NORMAL_FIELD : | 603 | case S_NORMAL_FIELD : |
604 | if ( x == mDelimiter || x == '\n' ) { | 604 | if ( x == mDelimiter || x == '\n' ) { |
605 | setText( row - mStartLine + 1, column, field ); | 605 | setText( row - mStartLine + 1, column, field ); |
606 | field = ""; | 606 | field = ""; |
607 | if ( x == '\n' ) { | 607 | if ( x == '\n' ) { |
608 | ++row; | 608 | ++row; |
609 | column = 1; | 609 | column = 1; |
610 | } else { | 610 | } else { |
611 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 611 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
612 | ++column; | 612 | ++column; |
613 | lastCharDelimiter = true; | 613 | lastCharDelimiter = true; |
614 | } | 614 | } |
615 | state = S_START; | 615 | state = S_START; |
616 | } else { | 616 | } else { |
617 | field += x; | 617 | field += x; |
618 | } | 618 | } |
619 | } | 619 | } |
620 | if ( x != mDelimiter ) | 620 | if ( x != mDelimiter ) |
621 | lastCharDelimiter = false; | 621 | lastCharDelimiter = false; |
622 | 622 | ||
623 | if ( column > maxColumn ) | 623 | if ( column > maxColumn ) |
624 | maxColumn = column; | 624 | maxColumn = column; |
625 | } | 625 | } |
626 | 626 | ||
627 | // file with only one line without '\n' | 627 | // file with only one line without '\n' |
628 | if ( field.length() > 0 ) { | 628 | if ( field.length() > 0 ) { |
629 | setText( row - mStartLine + 1, column, field ); | 629 | setText( row - mStartLine + 1, column, field ); |
630 | ++row; | 630 | ++row; |
631 | field = ""; | 631 | field = ""; |
632 | } | 632 | } |
633 | 633 | ||
634 | adjustRows( row - mStartLine ); | 634 | adjustRows( row - mStartLine ); |
635 | mTable->setNumCols( maxColumn ); | 635 | mTable->setNumCols( maxColumn ); |
636 | 636 | ||
637 | //US begin | 637 | //US begin |
638 | QStringList keys; | 638 | QStringList keys; |
639 | uint iii = 0, count = mTypeMap.count(); | 639 | uint iii = 0, count = mTypeMap.count(); |
640 | while ( iii < count ) { | 640 | while ( iii < count ) { |
641 | keys << "dummy"; | 641 | keys << "dummy"; |
642 | ++iii; | 642 | ++iii; |
643 | } | 643 | } |
644 | QMap<QString, uint>::ConstIterator it; | 644 | QMap<QString, uint>::ConstIterator it; |
645 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) | 645 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) |
646 | keys[( it.data() )] = it.key(); | 646 | keys[( it.data() )] = it.key(); |
647 | //US end | 647 | //US end |
648 | 648 | ||
649 | for ( column = 0; column < mTable->numCols(); ++column ) { | 649 | for ( column = 0; column < mTable->numCols(); ++column ) { |
650 | 650 | ||
651 | //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); | 651 | //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); |
652 | QComboTableItem *item = new QComboTableItem( mTable, keys ); | 652 | QComboTableItem *item = new QComboTableItem( mTable, keys ); |
653 | mTable->setItem( 0, column, item ); | 653 | mTable->setItem( 0, column, item ); |
654 | if ( column < mTypeStore.count() ) | 654 | if ( column < mTypeStore.count() ) |
655 | item->setCurrentItem( mTypeStore[ column ] ); | 655 | item->setCurrentItem( mTypeStore[ column ] ); |
656 | else | 656 | else |
657 | item->setCurrentItem( typeToPos( Undefined ) ); | 657 | item->setCurrentItem( typeToPos( Undefined ) ); |
658 | 658 | ||
659 | mTable->adjustColumn( column ); | 659 | mTable->adjustColumn( column ); |
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
663 | void CSVImportDialog::clearTable() | 663 | void CSVImportDialog::clearTable() |
664 | { | 664 | { |
665 | for ( int row = 0; row < mTable->numRows(); ++row ) | 665 | for ( int row = 0; row < mTable->numRows(); ++row ) |
666 | for ( int column = 0; column < mTable->numCols(); ++column ) | 666 | for ( int column = 0; column < mTable->numCols(); ++column ) |
667 | mTable->clearCell( row, column ); | 667 | mTable->clearCell( row, column ); |
668 | } | 668 | } |
669 | 669 | ||
670 | void CSVImportDialog::fillComboBox() | 670 | void CSVImportDialog::fillComboBox() |
671 | { | 671 | { |
672 | mComboLine->clear(); | 672 | mComboLine->clear(); |
673 | for ( int row = 1; row < mTable->numRows() + 1; ++row ) | 673 | for ( int row = 1; row < mTable->numRows() + 1; ++row ) |
674 | mComboLine->insertItem( QString::number( row ), row - 1 ); | 674 | mComboLine->insertItem( QString::number( row ), row - 1 ); |
675 | } | 675 | } |
676 | 676 | ||
677 | void CSVImportDialog::setText( int row, int col, const QString& text ) | 677 | void CSVImportDialog::setText( int row, int col, const QString& text ) |
678 | { | 678 | { |
679 | if ( row < 1 ) // skipped by the user | 679 | if ( row < 1 ) // skipped by the user |
680 | return; | 680 | return; |
681 | 681 | ||
682 | if ( mTable->numRows() < row ) { | 682 | if ( mTable->numRows() < row ) { |
683 | mTable->setNumRows( row + 5000 ); // We add 5000 at a time to limit recalculations | 683 | mTable->setNumRows( row + 5000 ); // We add 5000 at a time to limit recalculations |
684 | mAdjustRows = true; | 684 | mAdjustRows = true; |
685 | } | 685 | } |
686 | 686 | ||
687 | if ( mTable->numCols() < col ) | 687 | if ( mTable->numCols() < col ) |
688 | mTable->setNumCols( col + 50 ); // We add 50 at a time to limit recalculation | 688 | mTable->setNumCols( col + 50 ); // We add 50 at a time to limit recalculation |
689 | 689 | ||
690 | mTable->setText( row - 1, col - 1, text ); | 690 | mTable->setText( row - 1, col - 1, text ); |
691 | } | 691 | } |
692 | 692 | ||
693 | /* | 693 | /* |
694 | * Called after the first fillTable() when number of rows are unknown. | 694 | * Called after the first fillTable() when number of rows are unknown. |
695 | */ | 695 | */ |
696 | void CSVImportDialog::adjustRows( int rows ) | 696 | void CSVImportDialog::adjustRows( int rows ) |
697 | { | 697 | { |
698 | if ( mAdjustRows ) { | 698 | if ( mAdjustRows ) { |
699 | mTable->setNumRows( rows ); | 699 | mTable->setNumRows( rows ); |
700 | mAdjustRows = false; | 700 | mAdjustRows = false; |
701 | } | 701 | } |
702 | } | 702 | } |
703 | 703 | ||
704 | void CSVImportDialog::returnPressed() | 704 | void CSVImportDialog::returnPressed() |
705 | { | 705 | { |
706 | if ( mDelimiterBox->id( mDelimiterBox->selected() ) != 4 ) | 706 | if ( mDelimiterBox->id( mDelimiterBox->selected() ) != 4 ) |
707 | return; | 707 | return; |
708 | 708 | ||
709 | mDelimiter = mDelimiterEdit->text(); | 709 | mDelimiter = mDelimiterEdit->text(); |
710 | fillTable(); | 710 | fillTable(); |
711 | } | 711 | } |
712 | 712 | ||
713 | void CSVImportDialog::textChanged ( const QString& ) | 713 | void CSVImportDialog::textChanged ( const QString& ) |
714 | { | 714 | { |
715 | mRadioOther->setChecked ( true ); | 715 | mRadioOther->setChecked ( true ); |
716 | delimiterClicked( 4 ); // other | 716 | delimiterClicked( 4 ); // other |
717 | } | 717 | } |
718 | void CSVImportDialog::codecChanged ( const QString& ) | 718 | void CSVImportDialog::codecChanged ( const QString& ) |
719 | { | 719 | { |
720 | fillTable(); | 720 | fillTable(); |
721 | } | 721 | } |
722 | 722 | ||
723 | void CSVImportDialog::delimiterClicked( int id ) | 723 | void CSVImportDialog::delimiterClicked( int id ) |
724 | { | 724 | { |
725 | switch ( id ) { | 725 | switch ( id ) { |
726 | case 0: // comma | 726 | case 0: // comma |
727 | mDelimiter = ","; | 727 | mDelimiter = ","; |
728 | break; | 728 | break; |
729 | case 4: // other | 729 | case 4: // other |
730 | mDelimiter = mDelimiterEdit->text(); | 730 | mDelimiter = mDelimiterEdit->text(); |
731 | break; | 731 | break; |
732 | case 2: // tab | 732 | case 2: // tab |
733 | mDelimiter = "\t"; | 733 | mDelimiter = "\t"; |
734 | break; | 734 | break; |
735 | case 3: // space | 735 | case 3: // space |
736 | mDelimiter = " "; | 736 | mDelimiter = " "; |
737 | break; | 737 | break; |
738 | case 1: // semicolon | 738 | case 1: // semicolon |
739 | mDelimiter = ";"; | 739 | mDelimiter = ";"; |
740 | break; | 740 | break; |
741 | } | 741 | } |
742 | 742 | ||
743 | fillTable(); | 743 | fillTable(); |
744 | } | 744 | } |
745 | 745 | ||
746 | void CSVImportDialog::textquoteSelected( const QString& mark ) | 746 | void CSVImportDialog::textquoteSelected( const QString& mark ) |
747 | { | 747 | { |
748 | if ( mComboQuote->currentItem() == 2 ) | 748 | if ( mComboQuote->currentItem() == 2 ) |
749 | mTextQuote = 0; | 749 | mTextQuote = 0; |
750 | else | 750 | else |
751 | mTextQuote = mark[ 0 ]; | 751 | mTextQuote = mark[ 0 ]; |
752 | 752 | ||
753 | fillTable(); | 753 | fillTable(); |
754 | } | 754 | } |
755 | 755 | ||
756 | void CSVImportDialog::lineSelected( const QString& line ) | 756 | void CSVImportDialog::lineSelected( const QString& line ) |
757 | { | 757 | { |
758 | mStartLine = line.toInt() - 1; | 758 | mStartLine = line.toInt() - 1; |
759 | fillTable(); | 759 | fillTable(); |
760 | } | 760 | } |
761 | 761 | ||
762 | void CSVImportDialog::slotOk() | 762 | void CSVImportDialog::slotOk() |
763 | { | 763 | { |
764 | bool assigned = false; | 764 | bool assigned = false; |
765 | 765 | ||
766 | for ( int column = 0; column < mTable->numCols(); ++column ) { | 766 | for ( int column = 0; column < mTable->numCols(); ++column ) { |
767 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, | 767 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, |
768 | column ) ); | 768 | column ) ); |
769 | if ( item && posToType( item->currentItem() ) != Undefined ) | 769 | if ( item && posToType( item->currentItem() ) != Undefined ) |
770 | assigned = true; | 770 | assigned = true; |
771 | } | 771 | } |
772 | 772 | ||
773 | if ( assigned ) | 773 | if ( assigned ) |
774 | KDialogBase::slotOk(); | 774 | KDialogBase::slotOk(); |
775 | else | 775 | else |
776 | KMessageBox::sorry( this, i18n( "You have to assign at least one column." ) ); | 776 | KMessageBox::sorry( this, i18n( "You have to assign at least one column." ) ); |
777 | } | 777 | } |
778 | 778 | ||
779 | void CSVImportDialog::applyTemplate() | 779 | void CSVImportDialog::applyTemplate() |
780 | { | 780 | { |
781 | QMap<uint,int> columnMap; | 781 | QMap<uint,int> columnMap; |
782 | QMap<QString, QString> fileMap; | 782 | QMap<QString, QString> fileMap; |
783 | QStringList templates; | 783 | QStringList templates; |
784 | 784 | ||
785 | // load all template files | 785 | // load all template files |
786 | /*US QStringList list = KGlobal::dirs()->findAllResources( "data" , QString( kapp->name() ) + | 786 | /*US QStringList list = KGlobal::dirs()->findAllResources( "data" , QString( kapp->name() ) + |
787 | "/csv-templates/*.desktop", true, true ); | 787 | "/csv-templates/*.desktop", true, true ); |
788 | */ | 788 | */ |
789 | QStringList list = KGlobal::dirs()->findAllResources( "data" , KGlobal::getAppName() + | 789 | QStringList list = KGlobal::dirs()->findAllResources( "data" , KGlobal::getAppName() + |
790 | "/csv-templates/*.desktop", true, true ); | 790 | "/csv-templates/*.desktop", true, true ); |
791 | 791 | ||
792 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 792 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
793 | { | 793 | { |
794 | 794 | ||
795 | //US KSimpleConfig config( *it, true ); | 795 | //US KSimpleConfig config( *it, true ); |
796 | KConfig config( *it ); | 796 | KConfig config( *it ); |
797 | 797 | ||
798 | if ( !config.hasGroup( "csv column map" ) ) | 798 | if ( !config.hasGroup( "csv column map" ) ) |
799 | continue; | 799 | continue; |
800 | 800 | ||
801 | config.setGroup( "Misc" ); | 801 | config.setGroup( "Misc" ); |
802 | templates.append( config.readEntry( "Name" ) ); | 802 | templates.append( config.readEntry( "Name" ) ); |
803 | fileMap.insert( config.readEntry( "Name" ), *it ); | 803 | fileMap.insert( config.readEntry( "Name" ), *it ); |
804 | } | 804 | } |
805 | 805 | ||
806 | // let the user chose, what to take | 806 | // let the user chose, what to take |
807 | bool ok = false; | 807 | bool ok = false; |
808 | QString tmp; | 808 | QString tmp; |
809 | tmp = QInputDialog::getItem( i18n( "Template Selection" ), | 809 | tmp = QInputDialog::getItem( i18n( "Template Selection" ), |
810 | i18n( "Please select a template\nthat matches the CSV file." ), | 810 | i18n( "Please select a template\nthat matches the CSV file." ), |
811 | templates, 0, false, &ok, this ); | 811 | templates, 0, false, &ok, this ); |
812 | 812 | ||
813 | if ( !ok ) | 813 | if ( !ok ) |
814 | return; | 814 | return; |
815 | 815 | ||
816 | //US KSimpleConfig config( fileMap[ tmp ], true ); | 816 | //US KSimpleConfig config( fileMap[ tmp ], true ); |
817 | KConfig config( fileMap[ tmp ] ); | 817 | KConfig config( fileMap[ tmp ] ); |
818 | config.setGroup( "General" ); | 818 | config.setGroup( "General" ); |
819 | //US uint numColumns = config.readUnsignedNumEntry( "Columns" ); | 819 | //US uint numColumns = config.readUnsignedNumEntry( "Columns" ); |
820 | uint numColumns = (uint)config.readNumEntry( "Columns" ); | 820 | uint numColumns = (uint)config.readNumEntry( "Columns" ); |
821 | 821 | ||
822 | mDelimiterEdit->setText( config.readEntry( "DelimiterOther" ) ); | 822 | mDelimiterEdit->setText( config.readEntry( "DelimiterOther" ) ); |
823 | mDelimiterBox->setButton( config.readNumEntry( "DelimiterType" ) ); | 823 | mDelimiterBox->setButton( config.readNumEntry( "DelimiterType" ) ); |
824 | delimiterClicked( config.readNumEntry( "DelimiterType" ) ); | 824 | delimiterClicked( config.readNumEntry( "DelimiterType" ) ); |
825 | int quoteType = config.readNumEntry( "QuoteType" ); | 825 | int quoteType = config.readNumEntry( "QuoteType" ); |
826 | mComboQuote->setCurrentItem( quoteType ); | 826 | mComboQuote->setCurrentItem( quoteType ); |
827 | textquoteSelected( mComboQuote->currentText() ); | 827 | textquoteSelected( mComboQuote->currentText() ); |
828 | 828 | ||
829 | // create the column map | 829 | // create the column map |
830 | config.setGroup( "csv column map" ); | 830 | config.setGroup( "csv column map" ); |
831 | for ( uint i = 0; i < numColumns; ++i ) { | 831 | for ( uint i = 0; i < numColumns; ++i ) { |
832 | int col = config.readNumEntry( QString::number( i ) ); | 832 | int col = config.readNumEntry( QString::number( i ) ); |
833 | columnMap.insert( i, col ); | 833 | columnMap.insert( i, col ); |
834 | } | 834 | } |
835 | 835 | ||
836 | // apply the column map | 836 | // apply the column map |
837 | for ( uint column = 0; column < columnMap.count(); ++column ) { | 837 | for ( uint column = 0; column < columnMap.count(); ++column ) { |
838 | int type = columnMap[ column ]; | 838 | int type = columnMap[ column ]; |
839 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, | 839 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, |
840 | column ) ); | 840 | column ) ); |
841 | if ( item ) | 841 | if ( item ) |
842 | item->setCurrentItem( typeToPos( type ) ); | 842 | item->setCurrentItem( typeToPos( type ) ); |
843 | } | 843 | } |
844 | } | 844 | } |
845 | 845 | ||
846 | void CSVImportDialog::saveTemplate() | 846 | void CSVImportDialog::saveTemplate() |
847 | { | 847 | { |
848 | /*US | 848 | /*US |
849 | QString fileName = KFileDialog::getSaveFileName( | 849 | QString fileName = KFileDialog::getSaveFileName( |
850 | locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ), | 850 | locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ), |
851 | "*.desktop", this ); | 851 | "*.desktop", this ); |
852 | */ | 852 | */ |
853 | QString fileName = KFileDialog::getSaveFileName( | 853 | QString fileName = KFileDialog::getSaveFileName( |
854 | locateLocal( "data", KGlobal::getAppName() + "/csv-templates/" )+ | 854 | locateLocal( "data", KGlobal::getAppName() + "/csv-templates/" )+ |
855 | "*.desktop",i18n("Save file name") , this ); | 855 | "*.desktop",i18n("Save file name") , this ); |
856 | 856 | ||
857 | if ( fileName.isEmpty() ) | 857 | if ( fileName.isEmpty() ) |
858 | return; | 858 | return; |
859 | 859 | ||
860 | if ( !fileName.contains( ".desktop" ) ) | 860 | if ( !fileName.contains( ".desktop" ) ) |
861 | fileName += ".desktop"; | 861 | fileName += ".desktop"; |
862 | 862 | ||
863 | QString name = QInputDialog::getText( i18n( "Template name" ), i18n( "Please enter a name for the template" ) ); | 863 | QString name = QInputDialog::getText( i18n( "Template name" ), i18n( "Please enter a name for the template" ) ); |
864 | 864 | ||
865 | if ( name.isEmpty() ) | 865 | if ( name.isEmpty() ) |
866 | return; | 866 | return; |
867 | 867 | ||
868 | KConfig config( fileName ); | 868 | KConfig config( fileName ); |
869 | config.setGroup( "General" ); | 869 | config.setGroup( "General" ); |
870 | config.writeEntry( "Columns", mTable->numCols() ); | 870 | config.writeEntry( "Columns", mTable->numCols() ); |
871 | config.writeEntry( "DelimiterType", mDelimiterBox->id( mDelimiterBox->selected() ) ); | 871 | config.writeEntry( "DelimiterType", mDelimiterBox->id( mDelimiterBox->selected() ) ); |
872 | config.writeEntry( "DelimiterOther", mDelimiterEdit->text() ); | 872 | config.writeEntry( "DelimiterOther", mDelimiterEdit->text() ); |
873 | config.writeEntry( "QuoteType", mComboQuote->currentItem() ); | 873 | config.writeEntry( "QuoteType", mComboQuote->currentItem() ); |
874 | 874 | ||
875 | config.setGroup( "Misc" ); | 875 | config.setGroup( "Misc" ); |
876 | config.writeEntry( "Name", name ); | 876 | config.writeEntry( "Name", name ); |
877 | 877 | ||
878 | config.setGroup( "csv column map" ); | 878 | config.setGroup( "csv column map" ); |
879 | 879 | ||
880 | for ( uint column = 0; column < mTable->numCols(); ++column ) { | 880 | for ( uint column = 0; column < mTable->numCols(); ++column ) { |
881 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, | 881 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, |
882 | column ) ); | 882 | column ) ); |
883 | if ( item ) | 883 | if ( item ) |
884 | config.writeEntry( QString::number( column ), posToType( | 884 | config.writeEntry( QString::number( column ), posToType( |
885 | item->currentItem() ) ); | 885 | item->currentItem() ) ); |
886 | else | 886 | else |
887 | config.writeEntry( QString::number( column ), 0 ); | 887 | config.writeEntry( QString::number( column ), 0 ); |
888 | } | 888 | } |
889 | 889 | ||
890 | config.sync(); | 890 | config.sync(); |
891 | } | 891 | } |
892 | 892 | ||
893 | QString CSVImportDialog::getText( int row, int col ) | 893 | QString CSVImportDialog::getText( int row, int col ) |
894 | { | 894 | { |
895 | return mTable->text( row, col ); | 895 | return mTable->text( row, col ); |
896 | } | 896 | } |
897 | 897 | ||
898 | uint CSVImportDialog::posToType( int pos ) const | 898 | uint CSVImportDialog::posToType( int pos ) const |
899 | { | 899 | { |
900 | return pos; | 900 | return pos; |
901 | #if 0 | 901 | #if 0 |
902 | uint counter = 0; | 902 | uint counter = 0; |
903 | QMap<QString, uint>::ConstIterator it; | 903 | QMap<QString, uint>::ConstIterator it; |
904 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) | 904 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) |
905 | if ( counter == (uint)pos ) | 905 | if ( counter == (uint)pos ) |
906 | return it.data(); | 906 | return it.data(); |
907 | 907 | ||
908 | return 0; | 908 | return 0; |
909 | #endif | 909 | #endif |
910 | } | 910 | } |
911 | 911 | ||
912 | int CSVImportDialog::typeToPos( uint type ) const | 912 | int CSVImportDialog::typeToPos( uint type ) const |
913 | { | 913 | { |
914 | return type; | 914 | return type; |
915 | #if 0 | 915 | #if 0 |
916 | uint counter = 0; | 916 | uint counter = 0; |
917 | QMap<QString, uint>::ConstIterator it; | 917 | QMap<QString, uint>::ConstIterator it; |
918 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) | 918 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) |
919 | if ( it.data() == type ) | 919 | if ( it.data() == type ) |
920 | return counter; | 920 | return counter; |
921 | 921 | ||
922 | return -1; | 922 | return -1; |
923 | #endif | 923 | #endif |
924 | } | 924 | } |
925 | 925 | ||
926 | void CSVImportDialog::ignoreDuplicatesChanged( int ) | 926 | void CSVImportDialog::ignoreDuplicatesChanged( int ) |
927 | { | 927 | { |
928 | fillTable(); | 928 | fillTable(); |
929 | } | 929 | } |
930 | 930 | ||
931 | void CSVImportDialog::setFile( const QString &fileName ) | 931 | void CSVImportDialog::setFile( const QString &fileName ) |
932 | { | 932 | { |
933 | if ( fileName.isEmpty() ) | 933 | if ( fileName.isEmpty() ) |
934 | return; | 934 | return; |
935 | 935 | ||
936 | QFile file( fileName ); | 936 | QFile file( fileName ); |
937 | if ( !file.open( IO_ReadOnly ) ) { | 937 | if ( !file.open( IO_ReadOnly ) ) { |
938 | KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); | 938 | KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); |
939 | file.close(); | 939 | file.close(); |
940 | return; | 940 | return; |
941 | } | 941 | } |
942 | 942 | ||
943 | mFileArray = file.readAll(); | 943 | mFileArray = file.readAll(); |
944 | file.close(); | 944 | file.close(); |
945 | 945 | ||
946 | mClearTypeStore = true; | 946 | mClearTypeStore = true; |
947 | clearTable(); | 947 | clearTable(); |
948 | mTable->setNumCols( 0 ); | 948 | mTable->setNumCols( 0 ); |
949 | mTable->setNumRows( 0 ); | 949 | mTable->setNumRows( 0 ); |
950 | fillTable(); | 950 | fillTable(); |
951 | mClearTypeStore = false; | 951 | mClearTypeStore = false; |
952 | 952 | ||
953 | fillComboBox(); | 953 | fillComboBox(); |
954 | } | 954 | } |
955 | 955 | ||
956 | void CSVImportDialog::urlChanged( const QString &file ) | 956 | void CSVImportDialog::urlChanged( const QString &file ) |
957 | { | 957 | { |
958 | bool state = !file.isEmpty(); | 958 | bool state = !file.isEmpty(); |
959 | 959 | ||
960 | enableButtonOK( state ); | 960 | enableButtonOK( state ); |
961 | 961 | ||
962 | findButton( User1 )->setEnabled( state ); | 962 | findButton( User1 )->setEnabled( state ); |
963 | findButton( User2 )->setEnabled( state ); | 963 | findButton( User2 )->setEnabled( state ); |
964 | 964 | ||
965 | } | 965 | } |
966 | 966 | ||
967 | #ifndef KAB_EMBEDDED | 967 | #ifndef KAB_EMBEDDED |
968 | #include <csvimportdialog.moc> | 968 | #include <csvimportdialog.moc> |
969 | #endif //KAB_EMBEDDED | 969 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h index 5f55ab2..2661420 100644 --- a/kaddressbook/xxport/csvimportdialog.h +++ b/kaddressbook/xxport/csvimportdialog.h | |||
@@ -1,126 +1,126 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> |
4 | based on the code of KSpread's CSV Import Dialog | 4 | based on the code of KSpread's CSV Import Dialog |
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 | #ifndef CSV_IMPORT_DLG_H | 29 | #ifndef CSV_IMPORT_DLG_H |
30 | #define CSV_IMPORT_DLG_H | 30 | #define CSV_IMPORT_DLG_H |
31 | 31 | ||
32 | #include <kabc/addressbook.h> | 32 | #include <kabc/addressbook.h> |
33 | #include <kabc/addresseelist.h> | 33 | #include <kabc/addresseelist.h> |
34 | #include <kdialogbase.h> | 34 | #include <kdialogbase.h> |
35 | 35 | ||
36 | #include <qvaluelist.h> | 36 | #include <qvaluelist.h> |
37 | 37 | ||
38 | class KURLRequester; | 38 | class KURLRequester; |
39 | 39 | ||
40 | class QButtonGroup; | 40 | class QButtonGroup; |
41 | class QComboBox; | 41 | class QComboBox; |
42 | class QCheckBox; | 42 | class QCheckBox; |
43 | class QLineEdit; | 43 | class QLineEdit; |
44 | class QPushButton; | 44 | class QPushButton; |
45 | class QRadioButton; | 45 | class QRadioButton; |
46 | class QTable; | 46 | class QTable; |
47 | 47 | ||
48 | class CSVImportDialog : public KDialogBase | 48 | class CSVImportDialog : public KDialogBase |
49 | { | 49 | { |
50 | Q_OBJECT | 50 | Q_OBJECT |
51 | 51 | ||
52 | public: | 52 | public: |
53 | CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, | 53 | CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, |
54 | const char *name = 0 ); | 54 | const char *name = 0 ); |
55 | ~CSVImportDialog(); | 55 | ~CSVImportDialog(); |
56 | 56 | ||
57 | KABC::AddresseeList contacts() const; | 57 | KABC::AddresseeList contacts() const; |
58 | 58 | ||
59 | protected slots: | 59 | protected slots: |
60 | virtual void slotOk(); | 60 | virtual void slotOk(); |
61 | 61 | ||
62 | private slots: | 62 | private slots: |
63 | void returnPressed(); | 63 | void returnPressed(); |
64 | void delimiterClicked( int id ); | 64 | void delimiterClicked( int id ); |
65 | void lineSelected( const QString& line ); | 65 | void lineSelected( const QString& line ); |
66 | void textquoteSelected( const QString& mark ); | 66 | void textquoteSelected( const QString& mark ); |
67 | void textChanged ( const QString & ); | 67 | void textChanged ( const QString & ); |
68 | void ignoreDuplicatesChanged( int ); | 68 | void ignoreDuplicatesChanged( int ); |
69 | void setFile( const QString& ); | 69 | void setFile( const QString& ); |
70 | void urlChanged( const QString& ); | 70 | void urlChanged( const QString& ); |
71 | void codecChanged ( const QString& ); | 71 | void codecChanged ( const QString& ); |
72 | 72 | ||
73 | void applyTemplate(); | 73 | void applyTemplate(); |
74 | void saveTemplate(); | 74 | void saveTemplate(); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, | 77 | enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, |
78 | Prefix, Suffix, NickName, Birthday, | 78 | Prefix, Suffix, NickName, Birthday, |
79 | HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, | 79 | HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, |
80 | HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, | 80 | HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, |
81 | BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, | 81 | BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, |
82 | BusinessAddressPostalCode, BusinessAddressCountry, | 82 | BusinessAddressPostalCode, BusinessAddressCountry, |
83 | BusinessAddressLabel, | 83 | BusinessAddressLabel, |
84 | HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, | 84 | HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone, |
85 | Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories | 85 | Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories |
86 | }; | 86 | }; |
87 | 87 | ||
88 | QTable* mTable; | 88 | QTable* mTable; |
89 | QButtonGroup* mDelimiterBox; | 89 | QButtonGroup* mDelimiterBox; |
90 | QRadioButton* mRadioComma; | 90 | QRadioButton* mRadioComma; |
91 | QRadioButton* mRadioSemicolon; | 91 | QRadioButton* mRadioSemicolon; |
92 | QRadioButton* mRadioTab; | 92 | QRadioButton* mRadioTab; |
93 | QRadioButton* mRadioSpace; | 93 | QRadioButton* mRadioSpace; |
94 | QRadioButton* mRadioOther; | 94 | QRadioButton* mRadioOther; |
95 | QLineEdit* mDelimiterEdit; | 95 | QLineEdit* mDelimiterEdit; |
96 | QComboBox* mComboLine; | 96 | QComboBox* mComboLine; |
97 | QComboBox* mComboQuote; | 97 | QComboBox* mComboQuote; |
98 | QComboBox* mComboCodec; | 98 | QComboBox* mComboCodec; |
99 | QCheckBox* mIgnoreDuplicates; | 99 | QCheckBox* mIgnoreDuplicates; |
100 | KURLRequester* mUrlRequester; | 100 | KURLRequester* mUrlRequester; |
101 | 101 | ||
102 | void initGUI(); | 102 | void initGUI(); |
103 | void fillTable(); | 103 | void fillTable(); |
104 | void clearTable(); | 104 | void clearTable(); |
105 | void fillComboBox(); | 105 | void fillComboBox(); |
106 | void setText( int row, int col, const QString& text ); | 106 | void setText( int row, int col, const QString& text ); |
107 | void adjustRows( int rows ); | 107 | void adjustRows( int rows ); |
108 | QString getText( int row, int col ); | 108 | QString getText( int row, int col ); |
109 | uint posToType( int pos ) const; | 109 | uint posToType( int pos ) const; |
110 | int typeToPos( uint type ) const; | 110 | int typeToPos( uint type ) const; |
111 | 111 | ||
112 | bool mAdjustRows; | 112 | bool mAdjustRows; |
113 | int mStartLine; | 113 | int mStartLine; |
114 | QChar mTextQuote; | 114 | QChar mTextQuote; |
115 | QString mDelimiter; | 115 | QString mDelimiter; |
116 | QString mData; | 116 | QString mData; |
117 | QByteArray mFileArray; | 117 | QByteArray mFileArray; |
118 | QMap<QString, uint> mTypeMap; | 118 | QMap<QString, uint> mTypeMap; |
119 | KABC::AddressBook *mAddressBook; | 119 | KABC::AddressBook *mAddressBook; |
120 | int mCustomCounter; | 120 | int mCustomCounter; |
121 | bool mClearTypeStore; | 121 | bool mClearTypeStore; |
122 | QValueList<int> mTypeStore; | 122 | QValueList<int> mTypeStore; |
123 | 123 | ||
124 | }; | 124 | }; |
125 | 125 | ||
126 | #endif | 126 | #endif |