summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt6
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp8
3 files changed, 16 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index fd2da1a..f9b79ae 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,67 +1,70 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.2.4 ************
KO/Pi alarm applet: Made font smaller and added a dealy before starting KO/Pi to avoid problems accessing data storage when an alarm did wake up the Z.
KO/Pi:
Added export option for all data to File->Export menu.
Better management if a save error occours.
Added 15 sec delay in automatic saving when Z wake up from suspend and the automatic save timer did expire - to avoid problems accessing data storage directly after wake up.
Fix for displaying month names of an utf8 translated language (like Russian). Thanks to Tanya, Russian version of KO/Pi will be available soon.
+KA/Pi:
+Added for vCard import the option to import contact data in Latin1 format.
+
********** VERSION 2.2.3 ************
KO/Pi:
Fixed a problem with (non empty) exception dates in the exception date edit dialog of recurring events for newly created events.
Fixed usability problem in KA/Pi:
Now searching works for "all phone numbers and all addresses" if "all fields" is selected as search option.
Changed some behaviour in OM/Pi mail management to make it more usable.
********** VERSION 2.2.2 ************
KO/Pi:
Fixed a problem with the sort order of last modified date in list view.
KA/Pi:
Fixed a resource config read problem on windows.
********** VERSION 2.2.1 ************
KO/Pi:
Fixed a problem displaying very long allday events in agenda view in single day mode.
Fixed a problem with the default settings for new todos.
Added an error message dialog if saving of calendar files is not possible.
Made it impossible to close KO/Pi if saving fails.
Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick.
Added config options for conflict detection.
KA/Pi:
Added a config option to turn on asking before a contact is deleted.
Fixed a problem with the default view and view selection at startup.
Formatted name is now set on import, if formatted name is empty.
Fixed a problem of displaying images in the contact details view:
Now the wid/hei ratio is not changed.
I a picture is larger than 128 pixels in wid or hei it is downscaled to
max 128 pixels wid/hei.
********** VERSION 2.2.0 ************
New stable release!
Fixed some minor usability problems.
Added writing of next alarm to a file for usage on pdaXrom.
*************************************
You can find the complete changelog
from version 1.7.7 to 2.2.0
in the source package or on
http://www.pi-sync.net/html/changelog.html
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index ece26d2..8dd0a52 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -624,197 +624,203 @@
{ "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" },
{ "<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>" },
{ "Cut","Ausschneiden" },
{ "Paste","Einfügen" },
{ "Delete","Löschen" },
{ "Choose...","Wähle..." },
{ "Add View","Ansicht hinzufügen" },
{ "View name:","Ansicht Name:" },
{ "View Type","Typ der Ansicht" },
{ "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." },
{ "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." },
{ "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." },
{ "Draw &separators","Zeichne &Trennlinie" },
{ "Separator &width:","Trennlinien &Breite:" },
{ "&Padding:","Füllung:" },
{ "Cards","Karten" },
{ "&Margin:","&Rand:" },
{ "Draw &borders","Zeichne Ränder" },
{ "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." },
{ "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." },
{ "Sets the width of column separators","Sets the width of column separators" },
{ "&Layout","&Layout" },
{ "Show &empty fields","Zeige leere Felder" },
{ "Show field &labels","Zeige Feld Label" },
{ "Be&havior","Ver&halten" },
{ "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" },
{ "<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>" },
{ "Confirm Delete","Bestätige Löschen" },
{ "Edit Address Book Filter","Editiere Adressbuch Filter" },
{ "Category rule","Kategorie Regel" },
{ "Include categories","Inklusive" },
{ "Exclude categories","Exclusive" },
{ "Include contacts, that are:","Schließe folgende Kontakte ein:" },
{ "public","Öffentlich" },
{ "private","Privat" },
{ "confidential","Vertraulich" },
{ "Configure Resources","Konfiguriere Resourcen" },
{ "Resource Configuration","Resource Konfiguration" },
{ "Resources","Resourcen" },
{ "Standard","Standard" },
{ "&Use as Standard","Setze als Standard" },
{ "Select type of the new resource:","Selektiere Typ der neuen Resource:" },
{ "General Settings","Allgemeine Einstellungen" },
{ "Read-only","Nur-Lesen" },
{ "Include in sync","Schließe in Sync mit ein" },
{ "%1 Resource Settings","%1 Resource Einstellungen" },
{ "Format:","Format:" },
{ "Location:","Ort:" },
{ "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" },
{ "Language","Sprache" },
{ "Time Format","Zeit Format" },
{ "Time Zone","Zeit Zone" },
{ "Data storage path","Daten Speicherpfad" },
{ "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" },
{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
{ "Save settings","Speichere Einstellungen" },
{ "Save standard","Speichere Standard" },
{ "Save","Speichern" },
{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
{ "Multiple Sync options","Multi Sync Optionen" },
{ "Sync algo options","Sync Ablauf Optionen" },
{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
{ "Write back options","Optionen zum Zurückschreiben" },
{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
{ "Time period","Zeitspanne" },
{ "From ","Von " },
{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
{ " weeks in the future "," Wochen in der Zukunft " },
{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
{ "Local temp file:","Lokale temp Datei:" },
{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
{ "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." },
{ "Sorry","Tut mir leid" },
{ "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" },
{ "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" },
{ "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" },
{ "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" },
{ "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" },
{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
{ "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?" },
{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
{ "Error","Fehler" },
{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
{ "Warning","Warnung" },
{ "Select week number","Wähle Wochen Nummer" },
{ "Februar","Februar" },
{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
{ "Password for remote access:","Passwort für fernen Zugriff:" },
{ "Remote IP address:","Ferne IP Adresse:" },
{ "Remote port number:","Ferne Port Nummer:" },
{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
{ "Remote from: ","Fern von: " },
{ "Local from: ","Lokal von: " },
{ "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" },
{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
{ "Write back","Schreibe zurück" },
{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
{ "Received sync request","Sync Anfrage erhalten" },
{ "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." },
{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
{ "Sending file...","Sende Datei..." },
{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
{ "Receiving synced file...","Gesyncte Daten erhalten..." },
{ "Received %1 bytes","%1 Bytes erhalten" },
{ "Writing file to disk...","Speichere Datei..." },
{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
{ "Synchronize!","Synchronisiere!" },
{ "High clock skew!","Großer Uhrzeitunterschied!" },
{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
{ "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!" },
{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" },
{ "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" },
{ "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" },
{ "Edit new contact","Bearbeite neuen Kontakt" },
{ "Edit ","Bearbeite " },
{ "No contact changed!","Kein Kontakt verändert" },
{ "%1 contacts changed!","%1 Kontakte geändert!" },
{ "Mobile (home)","Handy (Arbeit)" },
{ "Mobile (work)","Handy (Privat)" },
{ "Def.Formatted Name","Def. Format. Name" },
{ "Colors","Farben" },
{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
{ "Backup enabled","Backup angeschaltet" },
{ "Use standard backup dir","Standard Backupverzeichnis" },
{ "Number of Backups:","Anzahl der Backups" },
{ "Make backup every ","Mache ein Backup alle " },
{ " days"," Tage" },
{ "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." },
{ "Backup Failed!","Backup Problem!" },
{ "Try again now","Versuche jetzt nochmal" },
{ "Try again later","Versuche später nochmal" },
{ "Try again tomorrow","Versuche morgen nochmal" },
{ "Disable backup","Schalte Backup ab" },
{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
{ "Choose action","Wähle Aktion" },
{ "&Configure KA/Pi...","Konfiguriere KA/Pi..." },
{ "Global Settings...","Globale Einstellungen..." },
{ "Spouse","Ehegatte" },
{ "Notes","Notizen" },
{ "Messanger","Messanger" },
{ "Assistant","Assistent" },
{ "Manager","Manager" },
{ "Secrecy","Sichtbar" },
{ "male","männlich" },
{ "female","weiblich" },
{ "Hide!","Verbergen!" },
{ "Show!","Anzeigen!" },
{ "Details","Details" },
{ "Search:","Suche:" },
{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
{ "<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?" },
{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
{ "Pi-Sync Error","Pi-Sync Fehler" },
{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
{ "Receiving file from remote...","Empfange entfernte Datei..." },
{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
{ "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" },
{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
{ "Writing back file ...","Schreibe Datei zurück..." },
{ "Sending back file ...","Sende Datei zurück..." },
{ "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" },
{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
{ "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" },
{ "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" },
{ "%1 contacts\nsuccessfully\nimported.","%1 Kontakte\nerfolgreich\nimportiert." },
{ "Import this contact?","Importiere diesen Kontakt?" },
{ "Import all!","Importiere alle!" },
{ "Loading addressbook data ... please wait","Lade Adressbuchdaten ... bitte warten" },
+{ "Import Format","Import Format" },
+{ "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." },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" }, \ No newline at end of file
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp
index 91df96d..9a8fa68 100644
--- a/kaddressbook/xxport/vcard_xxport.cpp
+++ b/kaddressbook/xxport/vcard_xxport.cpp
@@ -22,245 +22,251 @@
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#include <qfile.h>
#include <qtextstream.h>
#include <qfileinfo.h>
#include <kabc/vcardconverter.h>
#include <kabc/vcardparser/vcardtool.h>
#include <kfiledialog.h>
#ifndef KAB_EMBEDDED
#include <kio/netaccess.h>
#endif //KAB_EMBEDDED
#include <klocale.h>
#include <kmessagebox.h>
#include <ktempfile.h>
#include <kurl.h>
#include "xxportmanager.h"
#include "vcard_xxport.h"
#ifndef KAB_EMBEDDED
class VCardXXPortFactory : public XXPortFactory
{
public:
XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name )
{
return new VCardXXPort( ab, parent, name );
}
};
#endif //KAB_EMBEDDED
extern "C"
{
#ifndef KAB_EMBEDDED
void *init_libkaddrbk_vcard_xxport()
#else //KAB_EMBEDDED
void *init_microkaddrbk_vcard_xxport()
#endif //KAB_EMBEDDED
{
return ( new VCardXXPortFactory() );
}
}
VCardXXPort::VCardXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name )
: XXPortObject( ab, parent, name )
{
createImportAction( i18n( "Import vCard..." ) );
//US KABC::VCardConverter does not support the export of 2.1 addressbooks.
//US createExportAction( i18n( "Export vCard 2.1..." ), "v21" );
createExportAction( i18n( "Export vCard 3.0..." ), "v30" );
}
bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString &data )
{
QString name;
if ( list.count() == 1 )
name = list[ 0 ].givenName() + "_" + list[ 0 ].familyName() + ".vcf";
else
name = "addressbook.vcf";
#ifndef KAB_EMBEDDED
QString fileName = KFileDialog::getSaveFileName( name );
#else //KAB_EMBEDDED
QString fileName = KFileDialog::getSaveFileName( name, i18n("Save file"), parentWidget() );
#endif //KAB_EMBEDDED
if ( fileName.isEmpty() )
return false;
QFile outFile( fileName );
if ( !outFile.open( IO_WriteOnly ) ) {
QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
KMessageBox::error( parentWidget(), text.arg( fileName ) );
return false;
}
QTextStream t( &outFile );
t.setEncoding( QTextStream::UnicodeUTF8 );
KABC::Addressee::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
KABC::VCardConverter converter;
QString vcard;
KABC::VCardConverter::Version version;
if ( data == "v21" )
version = KABC::VCardConverter::v2_1;
else
version = KABC::VCardConverter::v3_0;
converter.addresseeToVCard( *it, vcard, version );
t << vcard << "\r\n\r\n";
}
outFile.close();
return true;
}
KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
{
QString fileName;
KABC::AddresseeList addrList;
KURL url;
#ifndef KAB_EMBEDDED
if ( !XXPortManager::importData.isEmpty() )
addrList = parseVCard( XXPortManager::importData );
else {
if ( XXPortManager::importURL.isEmpty() )
{
url = KFileDialog::getLoadFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
}
else
url = XXPortManager::importURL;
if ( url.isEmpty() )
return addrList;
QString caption( i18n( "vCard Import Failed" ) );
if ( KIO::NetAccess::download( url, fileName ) ) {
QFile file( fileName );
file.open( IO_ReadOnly );
QByteArray rawData = file.readAll();
file.close();
QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
addrList = parseVCard( data );
if ( !url.isLocalFile() )
KIO::NetAccess::removeTempFile( fileName );
} else {
QString text = i18n( "<qt>Unable to access <b>%1</b>.</qt>" );
KMessageBox::error( parentWidget(), text.arg( url.url() ), caption );
}
}
#else //KAB_EMBEDDED
if ( !XXPortManager::importData.isEmpty() )
addrList = parseVCard( XXPortManager::importData );
else {
if ( XXPortManager::importURL.isEmpty() )
{
fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
if ( fileName.isEmpty() )
return addrList;
QFileInfo fi ( fileName );
if ( !fi.isFile() )
return addrList;
}
else
{
//US url = XXPortManager::importURL;
qDebug("VCardXXPort::importContacts Urls at the moment not supported");
if ( url.isEmpty() )
return addrList;
}
QFile file( fileName );
if ( file.open( IO_ReadOnly ) ) {
QCString rawData ( file.readAll().data(),file.size()+1);
file.close();
int start = 0;
#ifndef DESKTOP_VERSION
while ( start < rawData.size()-2 ) {
if ( rawData.at( start ) == '\r' )
if ( rawData.at( start+1 ) == '\n' )
if ( rawData.at( start+2 ) == ' ' ) {
rawData.remove(start,3);
--start;
}
++start;
}
#endif
- addrList = parseVCard( QString::fromUtf8( rawData.data() ) );
+ int ret = KMessageBox::warningYesNoCancel( 0, i18n("Select import format!\nDefault and standard is Utf8.\nLatin1 may be the right\nfor some West Europian languages."), i18n("Import Format"), i18n("Utf8"), i18n("Latin1") );
+ if ( ret == KMessageBox::Cancel )
+ return addrList;
+ if ( ret == KMessageBox::Yes )
+ addrList = parseVCard( QString::fromUtf8( rawData.data() ) );
+ else
+ addrList = parseVCard( QString::fromLatin1( rawData.data() ) );
}
}
#endif //KAB_EMBEDDED
return addrList;
}
KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const
{
KABC::VCardTool tool;
KABC::AddresseeList addrList;
addrList = tool.parseVCards( data );
// LR : I switched to the code, which is in current cvs HEAD
/*
uint numVCards = data.contains( "BEGIN:VCARD", false );
QStringList dataList = QStringList::split( "\r\n\r\n", data );
for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) {
KABC::Addressee addr;
bool ok = false;
if ( dataList[ i ].contains( "VERSION:3.0" ) )
ok = converter.vCardToAddressee( dataList[ i ], addr, KABC::VCardConverter::v3_0 );
else if ( dataList[ i ].contains( "VERSION:2.1" ) )
ok = converter.vCardToAddressee( dataList[ i ], addr, KABC::VCardConverter::v2_1 );
else {
KMessageBox::sorry( parentWidget(), i18n( "Not supported vCard version." ) );
continue;
}
if ( !addr.isEmpty() && ok )
addrList.append( addr );
else {
QString text = i18n( "The selected file does not include a valid vCard. "
"Please check the file and try again." );
KMessageBox::sorry( parentWidget(), text );
}
}
*/
if ( addrList.isEmpty() ) {
QString text = i18n( "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n" );
KMessageBox::sorry( parentWidget(), text );
}
return addrList;
}
#ifndef KAB_EMBEDDED
#include "vcard_xxport.moc"
#endif //KAB_EMBEDDED