summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kaimportoldialog.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kaimportoldialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kaimportoldialog.cpp46
1 files changed, 42 insertions, 4 deletions
diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp
index 10e3c76..848d8af 100644
--- a/kaddressbook/kaimportoldialog.cpp
+++ b/kaddressbook/kaimportoldialog.cpp
@@ -29,6 +29,7 @@
#include <qwidgetstack.h>
#include <qdatetime.h>
#include <qdir.h>
+#include <qregexp.h>
#include <qapplication.h>
#include <qhbox.h>
#include <qheader.h>
@@ -267,8 +268,9 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
//addressee.setGeo( const Geo &geo );
//addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix
addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );
- addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()) );
+ addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()).replace( QRegExp("\\r"), "") );
QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer());
+ notesStr.replace( QRegExp("\\r"), "");
addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) );
//addressee.setRevision( const QDateTime &revision );
@@ -291,7 +293,7 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
tempS = QString::fromUcs2(aItem->GetDepartment().GetBuffer());
if ( !tempS.isEmpty() )
addressee.insertCustom( "KADDRESSBOOK", "X-Department", tempS );
- tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer());
+ tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer()).replace( QRegExp("\\r"), "");
if ( !tempS.isEmpty() )
addressee.insertCustom( "KADDRESSBOOK", "X-Office",tempS );
tempS = QString::fromUcs2(aItem->GetProfession().GetBuffer());
@@ -310,7 +312,7 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
//addressee.setPhoto( const Picture &photo );
//addressee.setSound( const Sound &sound );
//addressee.setAgent( const Agent &agent );
- QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer());
+ QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()).replace( QRegExp("\\r"), "");
addressee.setCategories( QStringList::split( ";", cat ));
QString phoneS;
@@ -396,36 +398,43 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
KABC::Address* addressAdd = &addressHome;
bool insert = false;
phoneS = QString::fromUcs2( aItem->GetHomeAddressCountry().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setCountry(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetHomeAddressState().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setRegion(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetHomeAddressCity().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setLocality(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetHomeAddressPostalCode().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostalCode(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetHomeAddressPostOfficeBox().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostOfficeBox(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetHomeAddressStreet().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setStreet(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetHomeAddress().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
// redundant !addressAdd->setExtended(phoneS );
// insert = true;
@@ -439,36 +448,43 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
addressAdd = &addressWork;
insert = false;
phoneS = QString::fromUcs2( aItem->GetBusinessAddressCountry().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setCountry(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetBusinessAddressState().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setRegion(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetBusinessAddressCity().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setLocality(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetBusinessAddressPostalCode().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostalCode(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetBusinessAddressPostOfficeBox().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostOfficeBox(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetBusinessAddressStreet().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setStreet(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetBusinessAddress().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
// redundant !addressAdd->setExtended(phoneS );
// insert = true;
@@ -482,31 +498,37 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
addressAdd = &addressOther;
insert = false;
phoneS = QString::fromUcs2( aItem->GetOtherAddressCountry().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setCountry(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetOtherAddressState().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setRegion(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetOtherAddressCity().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setLocality(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetOtherAddressPostalCode().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostalCode(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetOtherAddressPostOfficeBox().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostOfficeBox(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetOtherAddressStreet().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setStreet(phoneS );
insert = true;
@@ -524,36 +546,43 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
addressAdd = &addressMail;
insert = false;
phoneS = QString::fromUcs2( aItem->GetMailingAddressCountry().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setCountry(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetMailingAddressState().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setRegion(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetMailingAddressCity().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setLocality(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetMailingAddressPostalCode().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostalCode(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetMailingAddressPostOfficeBox().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setPostOfficeBox(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetMailingAddressStreet().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
addressAdd->setStreet(phoneS );
insert = true;
}
phoneS = QString::fromUcs2( aItem->GetMailingAddress().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! phoneS.isEmpty()) {
// redundant ! addressAdd->setExtended(phoneS );
// insert = true;
@@ -591,6 +620,7 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
// ++++++++++++++++++++++ end of ALL addresses
//GetUserProperties();
tempS = QString::fromUcs2(aItem->GetInternetFreeBusyAddress().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( !tempS.isEmpty() )
addressee.insertCustom( "KADDRESSBOOK", "X-FreeBusyUrl", tempS );
tempS = QString::fromUcs2(aItem->GetChildren().GetBuffer());
@@ -611,41 +641,49 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
additionalInfo += tempAdd;
}
tempAdd = QString::fromUcs2(aItem->GetHobby().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nHobby: ");
additionalInfo += tempAdd;;
}
tempAdd =QString::fromUcs2(aItem->GetPersonalHomePage().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nHomepage: ");
additionalInfo += tempAdd;;
}
tempAdd = QString::fromUcs2(aItem->GetBillingInformation().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nBilling information: ");
additionalInfo += tempAdd;;
}
tempAdd = QString::fromUcs2(aItem->GetCustomerID().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nCustomer ID: ");
additionalInfo += tempAdd;;
}
tempAdd = QString::fromUcs2(aItem->GetUser1().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nUser1: ");
additionalInfo += tempAdd;;
}
tempAdd = QString::fromUcs2(aItem->GetUser2().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nUser2: ");
additionalInfo += tempAdd;;
}
tempAdd = QString::fromUcs2(aItem->GetUser3().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nUser3: ");
additionalInfo += tempAdd;;
}
- tempAdd = QString::fromUcs2(aItem->GetUser4().GetBuffer());
+ tempAdd = QString::fromUcs2(aItem->GetUser4().GetBuffer());
+ phoneS.replace( QRegExp("\\r"), "");
if ( ! tempAdd.isEmpty() ) {
additionalInfo += i18n("\nUser4: ");
additionalInfo += tempAdd;;