summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile.Embedded8
-rw-r--r--kabc/converter/opie/opieconverter.h4
-rw-r--r--kabc/converter/qtopia/qtopiaconverter.cpp19
-rw-r--r--kabc/converter/qtopia/qtopiaconverter.h4
-rw-r--r--kaddressbook/xxportmanager.cpp10
5 files changed, 26 insertions, 19 deletions
diff --git a/Makefile.Embedded b/Makefile.Embedded
index 3160017..143e965 100644
--- a/Makefile.Embedded
+++ b/Makefile.Embedded
@@ -1,76 +1,77 @@
DISTPATH = $(shell pwd)
DISTDIR = $(shell basename $(DISTPATH))
SUBDIRS = libical/src/libical libical/src/libicalss qtcompat microkde \
libkcal libkdepim kabc kabc/converter/opie kabc/converter/qtopia kabc/formats/binary \
kabc/plugins/file kabc/plugins/dir \
kabc/plugins/ldap kabc/plugins/opie kabc/plugins/qtopia \
- korganizer kalarmd kaddressbook/xxport/opie kaddressbook
+ korganizer kalarmd kaddressbook/xxport/opie kaddressbook/xxport/qtopia kaddressbook
all: tmake
for i in $(SUBDIRS); do pushd $$i; \
make -f Makefile$(PLATFORM) || exit 1; popd; \
done
objects:
for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done
for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done
mkdir -p libical/lib/$(PLATFORM)
clean:
rm -f libical/lib/$(PLATFORM)/*;
for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\
rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \
done
install:
cd bin/kdepim; make install
cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop
cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop
dist:
@echo Dont forget to do "make install" before "make dist"
rm -f *arm.ipk
rm -f *~
cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc kdepim
mkipks kdepim.control
mkipks korganizer-alarm.control
tmake: objects qtcompat/Makefile$(PLATFORM) microkde/Makefile$(PLATFORM) \
libkcal/Makefile$(PLATFORM) \
libkdepim/Makefile$(PLATFORM) korganizer/Makefile$(PLATFORM) \
kalarmd/Makefile$(PLATFORM) \
libical/src/libical/Makefile$(PLATFORM) \
libical/src/libicalss/Makefile$(PLATFORM) \
kabc/Makefile$(PLATFORM) \
kabc/converter/opie/Makefile$(PLATFORM) \
kabc/converter/qtopia/Makefile$(PLATFORM) \
kabc/formats/binary/Makefile$(PLATFORM) \
kabc/plugins/file/Makefile$(PLATFORM) \
kabc/plugins/dir/Makefile$(PLATFORM) \
kabc/plugins/ldap/Makefile$(PLATFORM) \
kabc/plugins/opie/Makefile$(PLATFORM) \
kabc/plugins/qtopia/Makefile$(PLATFORM) \
kaddressbook/xxport/opie/Makefile$(PLATFORM) \
+ kaddressbook/xxport/qtopia/Makefile$(PLATFORM) \
kaddressbook/Makefile$(PLATFORM)
qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" qtcompat.pro -o Makefile$(PLATFORM)
microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" microkdeE.pro -o Makefile$(PLATFORM)
libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" libkcalE.pro -o Makefile$(PLATFORM)
libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" libkdepimE.pro -o Makefile$(PLATFORM)
kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" kalarmdE.pro -o Makefile$(PLATFORM)
korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" korganizerE.pro -o Makefile$(PLATFORM)
libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
@@ -87,28 +88,31 @@ kabc/converter/opie/Makefile$(PLATFORM): kabc/converter/opie/opieE.pro
kabc/converter/qtopia/Makefile$(PLATFORM): kabc/converter/qtopia/qtopiaE.pro
cd kabc/converter/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM)
kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" fileE.pro -o Makefile$(PLATFORM)
kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" dirE.pro -o Makefile$(PLATFORM)
kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro
cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" ldapE.pro -o Makefile$(PLATFORM)
kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro
cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM)
kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro
cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM)
kaddressbook/xxport/opie/Makefile$(PLATFORM): kaddressbook/xxport/opie/opieE.pro
cd kaddressbook/xxport/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM)
-
+
+kaddressbook/xxport/qtopia/Makefile$(PLATFORM): kaddressbook/xxport/qtopia/qtopiaE.pro
+ cd kaddressbook/xxport/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM)
+
kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" kaddressbookE.pro -o Makefile$(PLATFORM)
diff --git a/kabc/converter/opie/opieconverter.h b/kabc/converter/opie/opieconverter.h
index c7e691f..d251a24 100644
--- a/kabc/converter/opie/opieconverter.h
+++ b/kabc/converter/opie/opieconverter.h
@@ -30,50 +30,50 @@ $Id$
#include <qstring.h>
#include "addressee.h"
#include <opie/ocontact.h>
class Categories;
namespace KABC {
class OpieConverter
{
public:
/**
* Constructor.
*/
OpieConverter();
/**
* Destructor.
*/
virtual ~OpieConverter();
- virtual bool init();
- virtual void deinit();
+ bool init();
+ void deinit();
/**
* Converts a vcard string to an addressee.
*
* @param contact The opie contact.
* @param addr The addressee.
*/
bool opieToAddressee( const OContact &contact, Addressee &addr );
/**
* Converts an addressee to a vcard string.
*
* @param addr The addressee.
* @param contact The opie contact.
*/
bool addresseeToOpie( const Addressee &addr, OContact &contact );
private:
Categories* catDB;
};
}
diff --git a/kabc/converter/qtopia/qtopiaconverter.cpp b/kabc/converter/qtopia/qtopiaconverter.cpp
index e3dd3e6..f451b8b 100644
--- a/kabc/converter/qtopia/qtopiaconverter.cpp
+++ b/kabc/converter/qtopia/qtopiaconverter.cpp
@@ -28,57 +28,54 @@ $Id$
//US
#include "kglobal.h"
#include "qtopiaconverter.h"
#include <qpe/categories.h>
//US #include <qpe/categoryselect.h>
using namespace KABC;
QtopiaConverter::QtopiaConverter() : catDB(0)
{
}
QtopiaConverter::~QtopiaConverter()
{
deinit();
}
bool QtopiaConverter::init()
{
catDB = new Categories();
- if (catDB)
- {
- catDB->load( categoryFileName() );
- return true;
- }
- else
- {
+
+ if (!catDB)
return false;
- }
+
+ catDB->load( categoryFileName() );
+ return true;
}
void QtopiaConverter::deinit()
{
if (catDB)
{
delete catDB;
catDB = 0;
}
}
bool QtopiaConverter::qtopiaToAddressee( const PimContact &contact, Addressee &addr )
{
// name
addr.setFormattedName(contact.fileAs());
addr.setFamilyName( contact.lastName() );
addr.setGivenName( contact.firstName() );
addr.setAdditionalName( contact.middleName() );
addr.setPrefix( contact.nameTitle() );
addr.setSuffix( contact.suffix() );
// email
QStringList emails = contact.emailList();
@@ -188,79 +185,79 @@ bool QtopiaConverter::qtopiaToAddressee( const PimContact &contact, Addressee &a
businesspager.setNumber( contact.businessPager() );
addr.insertPhoneNumber( businesspager );
}
addr.setRole( contact.jobTitle() ); //?
addr.setOrganization( contact.company() );
addr.insertCustom( "KADDRESSBOOK", "X-Profession", contact.profession() );
addr.insertCustom( "KADDRESSBOOK", "X-AssistantsName", contact.assistant() );
addr.insertCustom( "KADDRESSBOOK", "X-Department", contact.department() );
addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", contact.manager() );
addr.insertCustom( "KADDRESSBOOK", "X-Office", contact.office() );
//personal
addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() );
// qtopia uses this categorization:
// enum GenderType { UnspecifiedGender=0, Male, Female };
if (contact.gender() == PimContact::Male)
addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
else if (contact.gender() == PimContact::Female)
addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
if (contact.anniversary().isValid()) {
QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true, KLocale::ISODate);
//US
- qDebug("OpieConverter::opieToAddressee found:%s", dt.latin1());
+ qDebug("OpieConverter::qtopiaToAddressee found:%s", dt.latin1());
addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
}
addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() );
if (contact.birthday().isValid())
addr.setBirthday( contact.birthday() );
addr.setNickName( contact.nickname() );
// others
//US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available.
QString notes = contact.notes();
notes += "\nBusinessWebPage: " + contact.businessWebpage() + "\n";
addr.setNote( contact.notes() );
//US QString groups() const { return find( Qtopia::Groups ); }
//US QStringList groupList() const;
-
+
QArray<int> catArray = contact.categories();
QString cat;
for ( unsigned int i=0; i < catArray.size(); i++ ) {
cat = catDB->label("contact", catArray[i]);
if ( !cat.isEmpty() )
addr.insertCategory( cat );
}
-
+
return true;
}
bool QtopiaConverter::addresseeToQtopia( const Addressee &addr, PimContact &contact )
{
// name
contact.setLastName(addr.familyName());
contact.setFirstName(addr.givenName());
contact.setMiddleName(addr.additionalName());
contact.setNameTitle(addr.prefix());
contact.setSuffix(addr.suffix());
contact.setFileAs();
// email
QStringList emails = addr.emails();
for ( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
contact.insertEmail(*it);
}
contact.setDefaultEmail( addr.preferredEmail() );
// home
const Address homeaddress = addr.address(Address::Home);
diff --git a/kabc/converter/qtopia/qtopiaconverter.h b/kabc/converter/qtopia/qtopiaconverter.h
index 7397113..8f4c698 100644
--- a/kabc/converter/qtopia/qtopiaconverter.h
+++ b/kabc/converter/qtopia/qtopiaconverter.h
@@ -29,50 +29,50 @@ $Id$
#include <qstring.h>
#include "addressee.h"
#include <qpe/pim/contact.h>
class Categories;
namespace KABC {
class QtopiaConverter
{
public:
/**
* Constructor.
*/
QtopiaConverter();
/**
* Destructor.
*/
virtual ~QtopiaConverter();
- virtual bool init();
- virtual void deinit();
+ bool init();
+ void deinit();
/**
* Converts a vcard string to an addressee.
*
* @param contact The qtopia contact.
* @param addr The addressee.
*/
bool qtopiaToAddressee( const PimContact &contact, Addressee &addr );
/**
* Converts an addressee to a vcard string.
*
* @param addr The addressee.
* @param contact The qtopia contact.
*/
bool addresseeToQtopia( const Addressee &addr, PimContact &contact );
private:
Categories* catDB;
};
}
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp
index 248fcab..4798ffe 100644
--- a/kaddressbook/xxportmanager.cpp
+++ b/kaddressbook/xxportmanager.cpp
@@ -175,71 +175,77 @@ void XXPortManager::loadPlugins()
KTrader::OfferList::ConstIterator it;
for ( it = plugins.begin(); it != plugins.end(); ++it ) {
if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) )
continue;
KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() );
if ( !factory ) {
kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl;
continue;
}
XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
if ( !xxportFactory ) {
kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl;
continue;
}
#else //KAB_EMBEDDED
QList<XXPortFactory> factorylist;
factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_csv_xxport()));
factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_kde2_xxport()));
factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_vcard_xxport()));
- //now add the opie import library dynamically
+ //add the opie import library dynamically
KLibFactory *factory = KLibLoader::self()->factory( "microkaddrbk_opie_xxport" );
if ( factory ) {
XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
factorylist.append(xxportFactory);
}
+ //add the qtopia import library dynamically
+ factory = KLibLoader::self()->factory( "microkaddrbk_qtopia_xxport" );
+ if ( factory ) {
+ XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
+ factorylist.append(xxportFactory);
+ }
+
QListIterator<XXPortFactory> it(factorylist);
for ( ; it.current(); ++it )
{
XXPortFactory *xxportFactory = it.current();
#endif //KAB_EMBEDDED
XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore );
if ( obj ) {
mCore->addGUIClient( obj );
mXXPortObjects.insert( obj->identifier(), obj );
connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ),
this, SLOT( slotExport( const QString&, const QString& ) ) );
connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ),
this, SLOT( slotImport( const QString&, const QString& ) ) );
}
}
-
}
PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent,
const char *name )
: KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent,
name, true, true )
{
QWidget *page = plainPage();
QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() );
KPIM::AddresseeView *view = new KPIM::AddresseeView( page );
view->setAddressee( addr );
layout->addWidget( view );
resize( 400, 300 );
}
#ifndef KAB_EMBEDDED
#include "xxportmanager.moc"
#endif //KAB_EMBEDDED