author | zautrix <zautrix> | 2005-04-04 11:29:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-04 11:29:55 (UTC) |
commit | 23db4aa99cb7a5feb540b6be578efaee8ec6ef80 (patch) (unidiff) | |
tree | f60d08e53dc09cf8a9ca901697797de9cf5dc669 | |
parent | 69a388bdef8d4a31063f983735d2b7d25775f3cf (diff) | |
download | kdepimpi-23db4aa99cb7a5feb540b6be578efaee8ec6ef80.zip kdepimpi-23db4aa99cb7a5feb540b6be578efaee8ec6ef80.tar.gz kdepimpi-23db4aa99cb7a5feb540b6be578efaee8ec6ef80.tar.bz2 |
sync fixes
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 4 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 17 |
3 files changed, 19 insertions, 4 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index 7879194..e54e140 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -690,69 +690,73 @@ | |||
690 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 690 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
691 | { "Write back options","Optionen zum Zurückschreiben" }, | 691 | { "Write back options","Optionen zum Zurückschreiben" }, |
692 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 692 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
693 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 693 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
694 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 694 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
695 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 695 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
696 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 696 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
697 | { "Time period","Zeitspanne" }, | 697 | { "Time period","Zeitspanne" }, |
698 | { "From ","Von " }, | 698 | { "From ","Von " }, |
699 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 699 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
700 | { " weeks in the future "," Wochen in der Zukunft " }, | 700 | { " weeks in the future "," Wochen in der Zukunft " }, |
701 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 701 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
702 | { "Local temp file:","Lokale temp Datei:" }, | 702 | { "Local temp file:","Lokale temp Datei:" }, |
703 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 703 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
704 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 704 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
705 | { "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 | { "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." }, |
706 | { "Sorry","Tut mir leid" }, | 706 | { "Sorry","Tut mir leid" }, |
707 | { "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, | 707 | { "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, |
708 | { "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 | { "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" }, |
709 | { "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 | { "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" }, |
710 | { "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, | 710 | { "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, |
711 | { "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, | 711 | { "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, |
712 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 712 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
713 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 713 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
714 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 714 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
715 | { "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 | { "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?" }, |
716 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 716 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
717 | { "Error","Fehler" }, | 717 | { "Error","Fehler" }, |
718 | { ""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 Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
719 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 719 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
720 | { "Warning","Warnung" }, | 720 | { "Warning","Warnung" }, |
721 | { "Select week number","Wähle Wochen Nummer" }, | 721 | { "Select week number","Wähle Wochen Nummer" }, |
722 | { "Februar","Februar" }, | 722 | { "Februar","Februar" }, |
723 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 723 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
724 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 724 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
725 | { "Remote IP address:","Ferne IP Adresse:" }, | 725 | { "Remote IP address:","Ferne IP Adresse:" }, |
726 | { "Remote port number:","Ferne Port Nummer:" }, | 726 | { "Remote port number:","Ferne Port Nummer:" }, |
727 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 727 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
728 | { "Remote from: ","Fern von: " }, | 728 | { "Remote from: ","Fern von: " }, |
729 | { "Local from: ","Lokal von: " }, | 729 | { "Local from: ","Lokal von: " }, |
730 | { "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 | { "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" }, |
731 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 731 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
732 | { "Write back","Schreibe zurück" }, | 732 | { "Write back","Schreibe zurück" }, |
733 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 733 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
734 | { "Received sync request","Sync Anfrage erhalten" }, | 734 | { "Received sync request","Sync Anfrage erhalten" }, |
735 | { "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 | { "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." }, |
736 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 736 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
737 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 737 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
738 | { "Sending file...","Sende Datei..." }, | 738 | { "Sending file...","Sende Datei..." }, |
739 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 739 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
740 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 740 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
741 | { "Received %1 bytes","%1 Bytes erhalten" }, | 741 | { "Received %1 bytes","%1 Bytes erhalten" }, |
742 | { "Writing file to disk...","Speichere Datei..." }, | 742 | { "Writing file to disk...","Speichere Datei..." }, |
743 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 743 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
744 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 744 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
745 | { "Synchronize!","Synchronisiere!" }, | 745 | { "Synchronize!","Synchronisiere!" }, |
746 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 746 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
747 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 747 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
748 | { "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 | { "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!" }, |
749 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, | 749 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, |
750 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, | 750 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, |
751 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, | 751 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, |
752 | { "Edit new contact","Bearbeite neuen Kontakt" }, | 752 | { "Edit new contact","Bearbeite neuen Kontakt" }, |
753 | { "Edit ","Bearbeite " }, | 753 | { "Edit ","Bearbeite " }, |
754 | { "No contact changed!","Kein Kontakt verändert" }, | ||
755 | { "%1 contacts changed!","%1 Kontakte geändert!" }, | ||
756 | { "","" }, | ||
757 | { "","" }, | ||
754 | { "","" }, | 758 | { "","" }, |
755 | { "","" }, | 759 | { "","" }, |
756 | { "","" }, | 760 | { "","" }, |
757 | { "","" }, | 761 | { "","" }, |
758 | { "","" }, \ No newline at end of file | 762 | { "","" }, \ No newline at end of file |
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index af76558..2bd9e71 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -140,129 +140,129 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) | |||
140 | return; | 140 | return; |
141 | } | 141 | } |
142 | 142 | ||
143 | } else { | 143 | } else { |
144 | qDebug("Local resource file found. Changing filename to: %s",localname.latin1() ); | 144 | qDebug("Local resource file found. Changing filename to: %s",localname.latin1() ); |
145 | setFileName( localname ); | 145 | setFileName( localname ); |
146 | return; | 146 | return; |
147 | } | 147 | } |
148 | 148 | ||
149 | } | 149 | } |
150 | setFileName( fileName ); | 150 | setFileName( fileName ); |
151 | } | 151 | } |
152 | 152 | ||
153 | ResourceFile::~ResourceFile() | 153 | ResourceFile::~ResourceFile() |
154 | { | 154 | { |
155 | delete mFormat; | 155 | delete mFormat; |
156 | mFormat = 0; | 156 | mFormat = 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | void ResourceFile::writeConfig( KConfig *config ) | 159 | void ResourceFile::writeConfig( KConfig *config ) |
160 | { | 160 | { |
161 | 161 | ||
162 | config->setGroup( "Resource_" + identifier() ); | 162 | config->setGroup( "Resource_" + identifier() ); |
163 | Resource::writeConfig( config ); | 163 | Resource::writeConfig( config ); |
164 | 164 | ||
165 | config->writeEntry( "FileName", fileName() ); | 165 | config->writeEntry( "FileName", fileName() ); |
166 | config->writeEntry( "FileFormat", mFormatName ); | 166 | config->writeEntry( "FileFormat", mFormatName ); |
167 | 167 | ||
168 | // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 168 | // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | Ticket *ResourceFile::requestSaveTicket() | 172 | Ticket *ResourceFile::requestSaveTicket() |
173 | { | 173 | { |
174 | kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; | 174 | kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; |
175 | 175 | ||
176 | if ( !addressBook() ) return 0; | 176 | if ( !addressBook() ) return 0; |
177 | 177 | ||
178 | #ifdef ALLOW_LOCKING | 178 | #ifdef ALLOW_LOCKING |
179 | if ( !lock( mFileName ) ) { | 179 | if ( !lock( mFileName ) ) { |
180 | qDebug("unablt to lock file "); | 180 | qDebug("unablt to lock file "); |
181 | return 0; | 181 | return 0; |
182 | } | 182 | } |
183 | #endif | 183 | #endif |
184 | return createTicket( this ); | 184 | return createTicket( this ); |
185 | } | 185 | } |
186 | 186 | ||
187 | 187 | ||
188 | bool ResourceFile::doOpen() | 188 | bool ResourceFile::doOpen() |
189 | { | 189 | { |
190 | QFile file( fileName() ); | 190 | QFile file( fileName() ); |
191 | qDebug("ResourceFile::openfile %s ", fileName().latin1()); | 191 | qDebug("ResourceFile::openfile %s ", fileName().latin1()); |
192 | 192 | ||
193 | if ( !file.exists() ) { | 193 | if ( !file.exists() ) { |
194 | // try to create the file | 194 | // try to create the file |
195 | bool ok = file.open( IO_WriteOnly ); | 195 | bool ok = file.open( IO_WriteOnly ); |
196 | if ( ok ) | 196 | if ( ok ) |
197 | file.close(); | 197 | file.close(); |
198 | 198 | ||
199 | return ok; | 199 | return ok; |
200 | } else { | 200 | } else { |
201 | if ( !file.open( IO_ReadWrite ) ) | 201 | if ( !file.open( IO_ReadWrite ) ) |
202 | return false; | 202 | return false; |
203 | 203 | ||
204 | if ( file.size() == 0 ) { | 204 | if ( file.size() < 10 ) { |
205 | file.close(); | 205 | file.close(); |
206 | return true; | 206 | return true; |
207 | } | 207 | } |
208 | 208 | ||
209 | bool ok = mFormat->checkFormat( &file ); | 209 | bool ok = mFormat->checkFormat( &file ); |
210 | file.close(); | 210 | file.close(); |
211 | 211 | ||
212 | return ok; | 212 | return ok; |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | void ResourceFile::doClose() | 216 | void ResourceFile::doClose() |
217 | { | 217 | { |
218 | } | 218 | } |
219 | 219 | ||
220 | bool ResourceFile::load() | 220 | bool ResourceFile::load() |
221 | { | 221 | { |
222 | 222 | ||
223 | QFile file( fileName() ); | 223 | QFile file( fileName() ); |
224 | if ( !file.open( IO_ReadOnly ) ) { | 224 | if ( !file.open( IO_ReadOnly ) ) { |
225 | addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); | 225 | addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); |
226 | return false; | 226 | return false; |
227 | } | 227 | } |
228 | 228 | ||
229 | // qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 229 | // qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
230 | 230 | ||
231 | return mFormat->loadAll( addressBook(), this, &file ); | 231 | return mFormat->loadAll( addressBook(), this, &file ); |
232 | } | 232 | } |
233 | 233 | ||
234 | bool ResourceFile::save( Ticket *ticket ) | 234 | bool ResourceFile::save( Ticket *ticket ) |
235 | { | 235 | { |
236 | // qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 236 | // qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
237 | 237 | ||
238 | 238 | ||
239 | // create backup file | 239 | // create backup file |
240 | QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() ); | 240 | QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() ); |
241 | 241 | ||
242 | /*US we use a simpler method to create a backupfile | 242 | /*US we use a simpler method to create a backupfile |
243 | 243 | ||
244 | (void) KSaveFile::backupFile( mFileName, QString::null | 244 | (void) KSaveFile::backupFile( mFileName, QString::null |
245 | ,extension ); | 245 | ,extension ); |
246 | 246 | ||
247 | KSaveFile saveFile( mFileName ); | 247 | KSaveFile saveFile( mFileName ); |
248 | bool ok = false; | 248 | bool ok = false; |
249 | if ( saveFile.status() == 0 && saveFile.file() ) | 249 | if ( saveFile.status() == 0 && saveFile.file() ) |
250 | { | 250 | { |
251 | mFormat->saveAll( addressBook(), this, saveFile.file() ); | 251 | mFormat->saveAll( addressBook(), this, saveFile.file() ); |
252 | ok = saveFile.close(); | 252 | ok = saveFile.close(); |
253 | } | 253 | } |
254 | */ | 254 | */ |
255 | 255 | ||
256 | //US ToDo: write backupfile | 256 | //US ToDo: write backupfile |
257 | #ifndef NO_DIRWATCH | 257 | #ifndef NO_DIRWATCH |
258 | mDirWatch.stopScan(); | 258 | mDirWatch.stopScan(); |
259 | #endif | 259 | #endif |
260 | QFile info; | 260 | QFile info; |
261 | info.setName( fileName() ); | 261 | info.setName( fileName() ); |
262 | bool ok = info.open( IO_WriteOnly ); | 262 | bool ok = info.open( IO_WriteOnly ); |
263 | if ( ok ) { | 263 | if ( ok ) { |
264 | mFormat->saveAll( addressBook(), this, &info ); | 264 | mFormat->saveAll( addressBook(), this, &info ); |
265 | 265 | ||
266 | info.close(); | 266 | info.close(); |
267 | ok = true; | 267 | ok = true; |
268 | } | 268 | } |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 20b107e..fa9f130 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2378,155 +2378,166 @@ void KABCore::manageCategories( ) | |||
2378 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2378 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2379 | ++cc; | 2379 | ++cc; |
2380 | if ( cc %10 == 0) | 2380 | if ( cc %10 == 0) |
2381 | message(i18n("Processing contact #%1").arg(cc)); | 2381 | message(i18n("Processing contact #%1").arg(cc)); |
2382 | QStringList catIncList = (*it).categories(); | 2382 | QStringList catIncList = (*it).categories(); |
2383 | int i; | 2383 | int i; |
2384 | if ( catIncList.count() ) { | 2384 | if ( catIncList.count() ) { |
2385 | newCatList.clear(); | 2385 | newCatList.clear(); |
2386 | for( i = 0; i< catIncList.count(); ++i ) { | 2386 | for( i = 0; i< catIncList.count(); ++i ) { |
2387 | if ( catList.contains (catIncList[i])) { | 2387 | if ( catList.contains (catIncList[i])) { |
2388 | newCatList.append( catIncList[i] ); | 2388 | newCatList.append( catIncList[i] ); |
2389 | } | 2389 | } |
2390 | } | 2390 | } |
2391 | newCatList.sort(); | 2391 | newCatList.sort(); |
2392 | (*it).setCategories( newCatList ); | 2392 | (*it).setCategories( newCatList ); |
2393 | mAddressBook->insertAddressee( (*it) ); | 2393 | mAddressBook->insertAddressee( (*it) ); |
2394 | } | 2394 | } |
2395 | } | 2395 | } |
2396 | setModified( true ); | 2396 | setModified( true ); |
2397 | mViewManager->refreshView(); | 2397 | mViewManager->refreshView(); |
2398 | message( i18n("Removing categories done!")); | 2398 | message( i18n("Removing categories done!")); |
2399 | } | 2399 | } |
2400 | delete cp; | 2400 | delete cp; |
2401 | } | 2401 | } |
2402 | void KABCore::removeVoice() | 2402 | void KABCore::removeVoice() |
2403 | { | 2403 | { |
2404 | if ( KMessageBox::questionYesNo( this, i18n("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?") ) == KMessageBox::No ) | 2404 | if ( KMessageBox::questionYesNo( this, i18n("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?") ) == KMessageBox::No ) |
2405 | return; | 2405 | return; |
2406 | XXPortSelectDialog dlg( this, false, this ); | 2406 | XXPortSelectDialog dlg( this, false, this ); |
2407 | if ( !dlg.exec() ) | 2407 | if ( !dlg.exec() ) |
2408 | return; | 2408 | return; |
2409 | mAddressBook->setUntagged(); | 2409 | mAddressBook->setUntagged(); |
2410 | dlg.tagSelected(); | 2410 | dlg.tagSelected(); |
2411 | message(i18n("Removing voice..."), false ); | 2411 | message(i18n("Removing voice..."), false ); |
2412 | KABC::AddressBook::Iterator it; | 2412 | KABC::AddressBook::Iterator it; |
2413 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2413 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2414 | if ( (*it).tagged() ) { | 2414 | if ( (*it).tagged() ) { |
2415 | (*it).removeVoice(); | 2415 | (*it).removeVoice(); |
2416 | } | 2416 | } |
2417 | } | 2417 | } |
2418 | message(i18n("Refreshing view...") ); | 2418 | message(i18n("Refreshing view...") ); |
2419 | qApp->processEvents(); | 2419 | qApp->processEvents(); |
2420 | mViewManager->refreshView( "" ); | 2420 | mViewManager->refreshView( "" ); |
2421 | Addressee add; | 2421 | Addressee add; |
2422 | mDetails->setAddressee( add ); | 2422 | mDetails->setAddressee( add ); |
2423 | message(i18n("Remove voice completed!") ); | 2423 | message(i18n("Remove voice completed!") ); |
2424 | 2424 | ||
2425 | 2425 | ||
2426 | 2426 | ||
2427 | } | 2427 | } |
2428 | 2428 | ||
2429 | void KABCore::setFormattedName() | 2429 | void KABCore::setFormattedName() |
2430 | { | 2430 | { |
2431 | KABFormatPrefs setpref; | 2431 | KABFormatPrefs setpref; |
2432 | if ( !setpref.exec() ) { | 2432 | if ( !setpref.exec() ) { |
2433 | return; | 2433 | return; |
2434 | } | 2434 | } |
2435 | XXPortSelectDialog dlg( this, false, this ); | 2435 | XXPortSelectDialog dlg( this, false, this ); |
2436 | if ( !dlg.exec() ) | 2436 | if ( !dlg.exec() ) |
2437 | return; | 2437 | return; |
2438 | mAddressBook->setUntagged(); | 2438 | mAddressBook->setUntagged(); |
2439 | dlg.tagSelected(); | 2439 | dlg.tagSelected(); |
2440 | int count = 0; | 2440 | int count = 0; |
2441 | KABC::AddressBook::Iterator it; | 2441 | KABC::AddressBook::Iterator it; |
2442 | bool modified = false; | ||
2442 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2443 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2443 | if ( (*it).tagged() ) { | 2444 | if ( (*it).tagged() ) { |
2445 | if ( (*it).uid().left( 2 ) == "la" ) | ||
2446 | if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) | ||
2447 | continue; | ||
2444 | ++count; | 2448 | ++count; |
2445 | if ( count %10 == 0 ) | 2449 | if ( count %10 == 0 ) |
2446 | message(i18n("Changing contact #%1").arg( count ) ); | 2450 | message(i18n("Changing contact #%1").arg( count ) ); |
2447 | qApp->processEvents(); | 2451 | qApp->processEvents(); |
2448 | QString fName; | 2452 | QString fName; |
2449 | if ( setpref.simple->isChecked() ) | 2453 | if ( setpref.simple->isChecked() ) |
2450 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); | 2454 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); |
2451 | else if ( setpref.full->isChecked() ) | 2455 | else if ( setpref.full->isChecked() ) |
2452 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); | 2456 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); |
2453 | else if ( setpref.reverse->isChecked() ) | 2457 | else if ( setpref.reverse->isChecked() ) |
2454 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); | 2458 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); |
2455 | else | 2459 | else |
2456 | fName = (*it).organization(); | 2460 | fName = (*it).organization(); |
2457 | if ( setpref.setCompany->isChecked() ) | 2461 | if ( setpref.setCompany->isChecked() ) |
2458 | if ( fName.isEmpty() || fName =="," ) | 2462 | if ( fName.isEmpty() || fName =="," ) |
2459 | fName = (*it).organization(); | 2463 | fName = (*it).organization(); |
2460 | (*it).setFormattedName( fName ); | 2464 | (*it).setFormattedName( fName ); |
2465 | (*it).setChanged( true ); | ||
2466 | modified = true; | ||
2467 | (*it).setRevision( QDateTime::currentDateTime() ); | ||
2461 | } | 2468 | } |
2462 | } | 2469 | } |
2463 | message(i18n("Refreshing view...") ); | 2470 | message(i18n("Refreshing view...") ); |
2464 | qApp->processEvents(); | 2471 | qApp->processEvents(); |
2465 | mViewManager->refreshView( "" ); | 2472 | if ( modified ) |
2473 | setModified( true ); | ||
2466 | Addressee add; | 2474 | Addressee add; |
2467 | mDetails->setAddressee( add ); | 2475 | mDetails->setAddressee( add ); |
2468 | message(i18n("Setting formatted name completed!") ); | 2476 | if ( count == 0 ) |
2477 | message(i18n("No contact changed!") ); | ||
2478 | else | ||
2479 | message(i18n("%1 contacts changed!").arg( count ) ); | ||
2469 | } | 2480 | } |
2470 | 2481 | ||
2471 | void KABCore::clipboardDataChanged() | 2482 | void KABCore::clipboardDataChanged() |
2472 | { | 2483 | { |
2473 | 2484 | ||
2474 | if ( mReadWrite ) | 2485 | if ( mReadWrite ) |
2475 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2486 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2476 | 2487 | ||
2477 | } | 2488 | } |
2478 | 2489 | ||
2479 | void KABCore::updateActionMenu() | 2490 | void KABCore::updateActionMenu() |
2480 | { | 2491 | { |
2481 | UndoStack *undo = UndoStack::instance(); | 2492 | UndoStack *undo = UndoStack::instance(); |
2482 | RedoStack *redo = RedoStack::instance(); | 2493 | RedoStack *redo = RedoStack::instance(); |
2483 | 2494 | ||
2484 | if ( undo->isEmpty() ) | 2495 | if ( undo->isEmpty() ) |
2485 | mActionUndo->setText( i18n( "Undo" ) ); | 2496 | mActionUndo->setText( i18n( "Undo" ) ); |
2486 | else | 2497 | else |
2487 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2498 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2488 | 2499 | ||
2489 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2500 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2490 | 2501 | ||
2491 | if ( !redo->top() ) | 2502 | if ( !redo->top() ) |
2492 | mActionRedo->setText( i18n( "Redo" ) ); | 2503 | mActionRedo->setText( i18n( "Redo" ) ); |
2493 | else | 2504 | else |
2494 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2505 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2495 | 2506 | ||
2496 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2507 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2497 | } | 2508 | } |
2498 | 2509 | ||
2499 | void KABCore::configureKeyBindings() | 2510 | void KABCore::configureKeyBindings() |
2500 | { | 2511 | { |
2501 | #ifndef KAB_EMBEDDED | 2512 | #ifndef KAB_EMBEDDED |
2502 | KKeyDialog::configure( actionCollection(), true ); | 2513 | KKeyDialog::configure( actionCollection(), true ); |
2503 | #else //KAB_EMBEDDED | 2514 | #else //KAB_EMBEDDED |
2504 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2515 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2505 | #endif //KAB_EMBEDDED | 2516 | #endif //KAB_EMBEDDED |
2506 | } | 2517 | } |
2507 | 2518 | ||
2508 | #ifdef KAB_EMBEDDED | 2519 | #ifdef KAB_EMBEDDED |
2509 | void KABCore::configureResources() | 2520 | void KABCore::configureResources() |
2510 | { | 2521 | { |
2511 | KRES::KCMKResources dlg( this, "" , 0 ); | 2522 | KRES::KCMKResources dlg( this, "" , 0 ); |
2512 | 2523 | ||
2513 | if ( !dlg.exec() ) | 2524 | if ( !dlg.exec() ) |
2514 | return; | 2525 | return; |
2515 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2526 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2516 | } | 2527 | } |
2517 | #endif //KAB_EMBEDDED | 2528 | #endif //KAB_EMBEDDED |
2518 | 2529 | ||
2519 | 2530 | ||
2520 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2531 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2521 | * for the attendees list of an event. | 2532 | * for the attendees list of an event. |
2522 | */ | 2533 | */ |
2523 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2534 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2524 | { | 2535 | { |
2525 | 2536 | ||
2526 | bool ok = false; | 2537 | bool ok = false; |
2527 | mEmailSourceChannel = sourceChannel; | 2538 | mEmailSourceChannel = sourceChannel; |
2528 | mEmailSourceUID = uid; | 2539 | mEmailSourceUID = uid; |
2529 | callContactdialog(); | 2540 | callContactdialog(); |
2530 | #if 0 | 2541 | #if 0 |
2531 | int wid = uid.toInt( &ok ); | 2542 | int wid = uid.toInt( &ok ); |
2532 | qDebug("UID %s ", uid.latin1()); | 2543 | qDebug("UID %s ", uid.latin1()); |