summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-10-20 12:05:18 (UTC)
committer zautrix <zautrix>2004-10-20 12:05:18 (UTC)
commit5cf3c1bce58a6487af166e637e54571e98156fd0 (patch) (side-by-side diff)
tree2e1ba14350aa322bb21729cf462b96e658fa6929 /kaddressbook
parente2a0df411042d986adb31b28f9e0a2f17395358c (diff)
downloadkdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.zip
kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.tar.gz
kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.tar.bz2
OL import fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp8
-rw-r--r--kaddressbook/kaimportoldialog.cpp46
2 files changed, 48 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 980e436..1074a62 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -330,8 +330,10 @@ KABCore::~KABCore()
KABC::StdAddressBook::close();
delete syncManager;
+#ifndef DESKTOP_VERSION
if ( infrared )
delete infrared;
+#endif
}
void KABCore::receive( const QCString& cmsg, const QByteArray& data )
{
@@ -367,17 +369,19 @@ void KABCore::toggleBeamReceive( )
void KABCore::disableBR(bool b)
{
+#ifndef DESKTOP_VERSION
if ( b ) {
if ( infrared ) {
toggleBeamReceive( );
- mBRdisabled = true;
}
+ mBRdisabled = true;
} else {
if ( mBRdisabled ) {
mBRdisabled = false;
- toggleBeamReceive( );
+ //toggleBeamReceive( );
}
}
+#endif
}
void KABCore::recieve( QString fn )
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;;