summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-09-28 00:19:15 (UTC)
committer zautrix <zautrix>2005-09-28 00:19:15 (UTC)
commite6112c5497b334d6dc38108b37963c5e803413d3 (patch) (side-by-side diff)
treeb9afccc4169ffcb3b360d79e659a4b1119f2aef4 /kaddressbook
parentfa126dfea03b4ebed9a4eed4f2104f93abb72e22 (diff)
downloadkdepimpi-e6112c5497b334d6dc38108b37963c5e803413d3.zip
kdepimpi-e6112c5497b334d6dc38108b37963c5e803413d3.tar.gz
kdepimpi-e6112c5497b334d6dc38108b37963c5e803413d3.tar.bz2
import latin1 kapi
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp8
1 files changed, 7 insertions, 1 deletions
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
@@ -190,49 +190,55 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
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" ) )