summaryrefslogtreecommitdiffabout
path: root/kabc/plugins
authorzautrix <zautrix>2005-10-27 10:34:56 (UTC)
committer zautrix <zautrix>2005-10-27 10:34:56 (UTC)
commit29c7448b3c54e8d579732d10f144e12f7167c3c3 (patch) (side-by-side diff)
treeae613037eaa897d2f7bc084d0b9e6954c630d985 /kabc/plugins
parenteb83d8b5542de9ca0c421ad6aca2913b502bbe78 (diff)
downloadkdepimpi-29c7448b3c54e8d579732d10f144e12f7167c3c3.zip
kdepimpi-29c7448b3c54e8d579732d10f144e12f7167c3c3.tar.gz
kdepimpi-29c7448b3c54e8d579732d10f144e12f7167c3c3.tar.bz2
commit
Diffstat (limited to 'kabc/plugins') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/olaccess/olaccess.pro2
-rw-r--r--kabc/plugins/olaccess/olaccessconverter.cpp54
-rw-r--r--kabc/plugins/olaccess/olaccessconverter.h20
-rw-r--r--kabc/plugins/olaccess/resourceolaccess.cpp69
-rw-r--r--kabc/plugins/olaccess/resourceolaccess.h21
-rw-r--r--kabc/plugins/olaccess/resourceolaccessconfig.cpp24
-rw-r--r--kabc/plugins/olaccess/resourceolaccessconfig.h4
7 files changed, 94 insertions, 100 deletions
diff --git a/kabc/plugins/olaccess/olaccess.pro b/kabc/plugins/olaccess/olaccess.pro
index ca0a6a8..4416d0c 100644
--- a/kabc/plugins/olaccess/olaccess.pro
+++ b/kabc/plugins/olaccess/olaccess.pro
@@ -5,5 +5,5 @@ TARGET = microkabc_olaccess
include( ../../../variables.pri )
-INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat
+INCLUDEPATH += ../../.. ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat
INTERFACES = \
diff --git a/kabc/plugins/olaccess/olaccessconverter.cpp b/kabc/plugins/olaccess/olaccessconverter.cpp
index 4adcae4..e95f3cb 100644
--- a/kabc/plugins/olaccess/olaccessconverter.cpp
+++ b/kabc/plugins/olaccess/olaccessconverter.cpp
@@ -30,7 +30,6 @@ $Id$
-#include "sharpdtmconverter.h"
+#include "olaccessconverter.h"
-#include <sl/slcategories.h>
#include <libkdepim/ksyncprofile.h>
//US #include <qpe/categoryselect.h>
@@ -38,17 +37,17 @@ $Id$
using namespace KABC;
-using namespace SlCategory;
-SharpDTMConverter::SharpDTMConverter() : catDB(0)
+OlaccessConverter::OlaccessConverter()
{
}
-SharpDTMConverter::~SharpDTMConverter()
+OlaccessConverter::~OlaccessConverter()
{
deinit();
}
-bool SharpDTMConverter::init()
+bool OlaccessConverter::init()
{
+#if 0
catDB = new SlCategory::SlCategories();
@@ -57,9 +56,11 @@ bool SharpDTMConverter::init()
// catDB->load( categoryFileName() );
+#endif
return true;
}
-void SharpDTMConverter::deinit()
+void OlaccessConverter::deinit()
{
+#if 0
if (catDB)
{
@@ -67,7 +68,8 @@ void SharpDTMConverter::deinit()
catDB = 0;
}
+#endif
}
-
-bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr )
+#if 0
+bool OlaccessConverter::sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr )
{
SlZDataBase* db = (SlZDataBase*)database;
@@ -80,5 +82,5 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa
// name
- //qDebug("SharpDTMConverter::sharpToAddressee check if the fileAs transformation works!!");
+ //qDebug("OlaccessConverter::sharpToAddressee check if the fileAs transformation works!!");
addr.setFormattedName(db->readField(ZdbAdrs::FileAs));
//addr.setName(db->readField(ZdbAdrs::FullName));
@@ -95,5 +97,5 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa
emailstr.replace( QRegExp(";"), " " );
emailstr.replace( QRegExp(":"), " " );
- //qDebug("SharpDTMConverter::sharpToAddressee whats the character to seperate the emailadresses? %s ", emailstr.latin1());
+ //qDebug("OlaccessConverter::sharpToAddressee whats the character to seperate the emailadresses? %s ", emailstr.latin1());
QStringList emails = QStringList::split(" ", emailstr.simplifyWhiteSpace());
bool defE = false;
@@ -222,6 +224,6 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa
QString gen = db->readField(ZdbAdrs::Gender);
- //qDebug("SharpDTMConverter::sharpToAddressee pleas check that gender works!! : Gender: %s", gen.latin1());
- //qDebug("SharpDTMConverter::sharpToAddressee: may be int db->readUshortField(\"ZdbAdrs::Gender\") is here better suited");
+ //qDebug("OlaccessConverter::sharpToAddressee pleas check that gender works!! : Gender: %s", gen.latin1());
+ //qDebug("OlaccessConverter::sharpToAddressee: may be int db->readUshortField(\"ZdbAdrs::Gender\") is here better suited");
if (gen == "1")
addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
@@ -265,5 +267,5 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa
//US QStringList groupList() const;
- //qDebug("SharpDTMConverter::sharpToAddressee please check that the categories will be converted" );
+ //qDebug("OlaccessConverter::sharpToAddressee please check that the categories will be converted" );
QArray<int> catArray = db->readCategories();
QString cat;
@@ -280,5 +282,5 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa
}
-bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact )
+bool OlaccessConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact )
{
bool cellHome = false, cellWork = false;
@@ -290,5 +292,5 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
database->writeField(ZdbAdrs::Suffix, addr.suffix());
- //qDebug("SharpDTMConverter::addresseeToSharp check if the fileAs transformation works!!\n%s",addr.formattedName().latin1() );
+ //qDebug("OlaccessConverter::addresseeToSharp check if the fileAs transformation works!!\n%s",addr.formattedName().latin1() );
QString formattedName = addr.formattedName();
if ( formattedName.isEmpty() ) {
@@ -306,6 +308,6 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
// email
- //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!");
- //qDebug("SharpDTMConverter::addresseeToSharp its probably the same from sharpToAddressee");
+ //qDebug("OlaccessConverter::addresseeToSharp check which seperator we need here for the emails!!");
+ //qDebug("OlaccessConverter::addresseeToSharp its probably the same from sharpToAddressee");
QString emails = addr.emails().join(" ");
database->writeField(ZdbAdrs::Emails, emails );
@@ -374,7 +376,7 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
QString gt = addr.custom( "KADDRESSBOOK", "X-Gender" );
- //qDebug("SharpDTMConverter::addresseeToSharp please check that gender works!! : Gender: %s", gt.latin1());
- //qDebug("SharpDTMConverter::addresseeToSharp: may be writeField(\"ZdbAdrs::Gender\", ushort) is here better suited?");
- //qDebug("SharpDTMConverter::addresseeToSharp: check also the reverse functionality in sharpToAddressee");
+ //qDebug("OlaccessConverter::addresseeToSharp please check that gender works!! : Gender: %s", gt.latin1());
+ //qDebug("OlaccessConverter::addresseeToSharp: may be writeField(\"ZdbAdrs::Gender\", ushort) is here better suited?");
+ //qDebug("OlaccessConverter::addresseeToSharp: check also the reverse functionality in sharpToAddressee");
if (gt == "male")
database->writeField(ZdbAdrs::Gender, "1");
@@ -406,5 +408,5 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
- //qDebug("SharpDTMConverter::addresseeToSharp please check if category transformation works");
+ //qDebug("OlaccessConverter::addresseeToSharp please check if category transformation works");
return true;
@@ -412,5 +414,5 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da
-bool SharpDTMConverter::setCategories( const Addressee &addr, SlZDataBase* database , const CardId &contact )
+bool OlaccessConverter::setCategories( const Addressee &addr, SlZDataBase* database , const CardId &contact )
{
QStringList list = addr.categories();
@@ -432,10 +434,10 @@ bool SharpDTMConverter::setCategories( const Addressee &addr, SlZDataBase* datab
if ( !(res = database->updateCategories(contact, ids) ))
- qDebug("SharpDTMConverter::Error updating categories");
+ qDebug("OlaccessConverter::Error updating categories");
return res;
}
-
-QDate SharpDTMConverter::convertDate( QString s)
+#endif
+QDate OlaccessConverter::convertDate( QString s)
{
QDate dt = KGlobal::locale()->readDate( s );
diff --git a/kabc/plugins/olaccess/olaccessconverter.h b/kabc/plugins/olaccess/olaccessconverter.h
index db1bf2d..48a255d 100644
--- a/kabc/plugins/olaccess/olaccessconverter.h
+++ b/kabc/plugins/olaccess/olaccessconverter.h
@@ -30,17 +30,11 @@ $Id$
#include <qstring.h>
-#include <sl/slzdb.h>
#include "addressee.h"
-namespace SlCategory {
- class SlCategories;
-}
-
-class SlZDataBase;
namespace KABC {
-class SharpDTMConverter
+class OlaccessConverter
{
public:
@@ -49,10 +43,10 @@ public:
* Constructor.
*/
- SharpDTMConverter();
+ OlaccessConverter();
/**
* Destructor.
*/
- virtual ~SharpDTMConverter();
+ virtual ~OlaccessConverter();
bool init();
@@ -66,5 +60,5 @@ public:
* @param addr The addressee.
*/
- bool sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr );
+ //bool sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr );
/**
@@ -75,9 +69,9 @@ public:
* @param contact The sharp card id, eventhough it might be 0, if the contact is a new one.
*/
- bool addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact );
- bool setCategories( const Addressee &addr, SlZDataBase* database , const CardId &contact );
+ //bool addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact );
+ //bool setCategories( const Addressee &addr, SlZDataBase* database , const CardId &contact );
private:
- SlCategory::SlCategories* catDB;
+ //SlCategory::SlCategories* catDB;
QDate convertDate( QString );
diff --git a/kabc/plugins/olaccess/resourceolaccess.cpp b/kabc/plugins/olaccess/resourceolaccess.cpp
index e8f8bdd..7113e0e 100644
--- a/kabc/plugins/olaccess/resourceolaccess.cpp
+++ b/kabc/plugins/olaccess/resourceolaccess.cpp
@@ -28,5 +28,4 @@ $Id$
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <qdir.h>
@@ -44,44 +43,43 @@ $Id$
#include <kmessagebox.h>
-#include <sl/slzdb.h>
#include <libkdepim/ksyncprofile.h>
-#include "resourcesharpdtmconfig.h"
-#include "resourcesharpdtm.h"
+#include "resourceolaccessconfig.h"
+#include "resourceolaccess.h"
#include "stdaddressbook.h"
-#include "sharpdtmconverter.h"
+#include "olaccessconverter.h"
//#define ALLOW_LOCKING
using namespace KABC;
extern "C"
{
- void *init_microkabc_sharpdtm()
+ void *init_microkabc_olaccess()
{
- return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig>();
+ return new KRES::PluginFactory<Resourceolaccess,ResourceolaccessConfig>();
}
}
-ResourceSharpDTM::ResourceSharpDTM( const KConfig *config )
+Resourceolaccess::Resourceolaccess( const KConfig *config )
: Resource( config ), mConverter (0)
{
// we can not choose the filename. Therefore use the default to display
- mAccess = 0;
- QString fileName = SlZDataBase::addressbookFileName();
+ //mAccess = 0;
+ QString fileName;// = SlZDataBase::addressbookFileName();
init( fileName );
}
-ResourceSharpDTM::ResourceSharpDTM( const QString &fileName )
+Resourceolaccess::Resourceolaccess( const QString &fileName )
: Resource( 0 )
{
- mAccess = 0;
+ //mAccess = 0;
init( fileName );
}
-void ResourceSharpDTM::init( const QString &fileName )
+void Resourceolaccess::init( const QString &fileName )
{
if (mConverter == 0) {
- mConverter = new SharpDTMConverter();
+ mConverter = new OlaccessConverter();
bool res = mConverter->init();
if ( !res )
@@ -95,22 +93,22 @@ void ResourceSharpDTM::init( const QString &fileName )
}
-ResourceSharpDTM::~ResourceSharpDTM()
+Resourceolaccess::~Resourceolaccess()
{
if (mConverter != 0)
delete mConverter;
- if(mAccess != 0)
- delete mAccess;
+ //if(mAccess != 0)
+ //delete mAccess;
}
-void ResourceSharpDTM::writeConfig( KConfig *config )
+void Resourceolaccess::writeConfig( KConfig *config )
{
Resource::writeConfig( config );
}
-Ticket *ResourceSharpDTM::requestSaveTicket()
+Ticket *Resourceolaccess::requestSaveTicket()
{
- qDebug("ResourceSharpDTM::requestSaveTicket: %s", fileName().latin1());
+ qDebug("Resourceolaccess::requestSaveTicket: %s", fileName().latin1());
if ( !addressBook() ) return 0;
@@ -119,5 +117,5 @@ Ticket *ResourceSharpDTM::requestSaveTicket()
-bool ResourceSharpDTM::doOpen()
+bool Resourceolaccess::doOpen()
{
if (!mConverter)
@@ -126,14 +124,15 @@ bool ResourceSharpDTM::doOpen()
}
-void ResourceSharpDTM::doClose()
+void Resourceolaccess::doClose()
{
return;
}
-bool ResourceSharpDTM::load()
+bool Resourceolaccess::load()
{
if (!mConverter)
return false;
- QString fileN = SlZDataBase::addressbookFileName();
+ QString fileN ;//= SlZDataBase::addressbookFileName();
+#if 0
if ( ! mAccess ) {
mAccess = new SlZDataBase(fileN,
@@ -144,5 +143,5 @@ bool ResourceSharpDTM::load()
return false;
- qDebug("ResourceSharpDTM:: %x load: %s",this, fileName().latin1());
+ qDebug("Resourceolaccess:: %x load: %s",this, fileName().latin1());
bool res = false;
CardId id;
@@ -161,10 +160,11 @@ bool ResourceSharpDTM::load()
delete mAccess;
mAccess = 0;
-
+#endif
return true;
}
-bool ResourceSharpDTM::save( Ticket *ticket )
+bool Resourceolaccess::save( Ticket *ticket )
{
+#if 0
if (!mConverter)
return false;
@@ -177,5 +177,5 @@ bool ResourceSharpDTM::save( Ticket *ticket )
if(mAccess == 0)
return false;
- qDebug("ResourceSharpDTM::save: %s", fileName().latin1());
+ qDebug("Resourceolaccess::save: %s", fileName().latin1());
KABC::AddressBook::Iterator it;
bool res;
@@ -268,32 +268,33 @@ bool ResourceSharpDTM::save( Ticket *ticket )
delete mAccess;
mAccess = 0;
+#endif
return true;
}
-bool ResourceSharpDTM::lock( const QString &lockfileName )
+bool Resourceolaccess::lock( const QString &lockfileName )
{
return true;
}
-void ResourceSharpDTM::unlock( const QString &fileName )
+void Resourceolaccess::unlock( const QString &fileName )
{
}
-void ResourceSharpDTM::setFileName( const QString &newFileName )
+void Resourceolaccess::setFileName( const QString &newFileName )
{
Resource::setFileName( newFileName );
}
-void ResourceSharpDTM::fileChanged()
+void Resourceolaccess::fileChanged()
{
}
-void ResourceSharpDTM::removeAddressee( const Addressee &addr )
+void Resourceolaccess::removeAddressee( const Addressee &addr )
{
}
-void ResourceSharpDTM::cleanUp()
+void Resourceolaccess::cleanUp()
{
diff --git a/kabc/plugins/olaccess/resourceolaccess.h b/kabc/plugins/olaccess/resourceolaccess.h
index 64d06f9..0066331 100644
--- a/kabc/plugins/olaccess/resourceolaccess.h
+++ b/kabc/plugins/olaccess/resourceolaccess.h
@@ -27,6 +27,8 @@ $Id$
-#ifndef KABC_RESOURCESHARPDTM_H
-#define KABC_RESOURCESHARPDTM_H
+
+
+#ifndef KABC_RESOURCEolaccess_H
+#define KABC_RESOURCEolaccess_H
#include <kconfig.h>
@@ -38,15 +40,13 @@ $Id$
-class SlZDataBase;
-
namespace KABC {
class ResourceConfigWidget;
-class SharpDTMConverter;
+class OlaccessConverter;
/**
@internal
*/
-class ResourceSharpDTM : public Resource
+class Resourceolaccess : public Resource
{
Q_OBJECT
@@ -59,15 +59,15 @@ public:
@param cfg The config object where custom resource settings are stored.
*/
- ResourceSharpDTM( const KConfig *cfg );
+ Resourceolaccess( const KConfig *cfg );
/**
Construct file resource on file @arg fileName using format @arg formatName.
*/
- ResourceSharpDTM( const QString &fileName );
+ Resourceolaccess( const QString &fileName );
/**
* Destructor.
*/
- ~ResourceSharpDTM();
+ ~Resourceolaccess();
/**
@@ -134,6 +134,5 @@ protected:
private:
- SlZDataBase* mAccess;
- SharpDTMConverter* mConverter;
+ OlaccessConverter* mConverter;
QString mLockUniqueName;
diff --git a/kabc/plugins/olaccess/resourceolaccessconfig.cpp b/kabc/plugins/olaccess/resourceolaccessconfig.cpp
index 240f1d7..1fcf1b8 100644
--- a/kabc/plugins/olaccess/resourceolaccessconfig.cpp
+++ b/kabc/plugins/olaccess/resourceolaccessconfig.cpp
@@ -34,17 +34,15 @@ $Id$
#include <kdialog.h>
-#include <unistd.h>
#include <qdir.h>
#include <qfile.h>
-#include "resourcesharpdtm.h"
+#include "resourceolaccess.h"
-#include "resourcesharpdtmconfig.h"
+#include "resourceolaccessconfig.h"
-#include <sl/slzdb.h>
using namespace KABC;
-ResourceSharpDTMConfig::ResourceSharpDTMConfig( QWidget* parent, const char* name )
+ResourceolaccessConfig::ResourceolaccessConfig( QWidget* parent, const char* name )
: ConfigWidget( parent, name )
{
@@ -63,11 +61,11 @@ ResourceSharpDTMConfig::ResourceSharpDTMConfig( QWidget* parent, const char* na
}
-void ResourceSharpDTMConfig::loadSettings( KRES::Resource *res )
+void ResourceolaccessConfig::loadSettings( KRES::Resource *res )
{
//US ResourceFile *resource = dynamic_cast<ResourceFile*>( res );
- ResourceSharpDTM *resource = (ResourceSharpDTM*)( res );
+ Resourceolaccess *resource = (Resourceolaccess*)( res );
if ( !resource ) {
- kdDebug(5700) << "ResourceSharpDTMConfig::loadSettings(): cast failed" << endl;
+ kdDebug(5700) << "ResourceolaccessConfig::loadSettings(): cast failed" << endl;
return;
}
@@ -75,5 +73,5 @@ void ResourceSharpDTMConfig::loadSettings( KRES::Resource *res )
mFileNameEdit->setURL( resource->fileName() );
if ( mFileNameEdit->url().isEmpty() )
- mFileNameEdit->setURL( SlZDataBase::addressbookFileName() );
+ ;//mFileNameEdit->setURL( SlZDataBase::addressbookFileName() );
//US Sharp DTM resources are ReadOnly by definition
@@ -85,11 +83,11 @@ void ResourceSharpDTMConfig::loadSettings( KRES::Resource *res )
}
-void ResourceSharpDTMConfig::saveSettings( KRES::Resource *res )
+void ResourceolaccessConfig::saveSettings( KRES::Resource *res )
{
//US ResourceFile *resource = dynamic_cast<ResourceFile*>( res );
- ResourceSharpDTM *resource = (ResourceSharpDTM*)( res );
+ Resourceolaccess *resource = (Resourceolaccess*)( res );
if ( !resource ) {
- kdDebug(5700) << "ResourceSharpDTMConfig::saveSettings(): cast failed" << endl;
+ kdDebug(5700) << "ResourceolaccessConfig::saveSettings(): cast failed" << endl;
return;
}
@@ -98,5 +96,5 @@ void ResourceSharpDTMConfig::saveSettings( KRES::Resource *res )
}
-void ResourceSharpDTMConfig::checkFilePermissions( const QString& fileName )
+void ResourceolaccessConfig::checkFilePermissions( const QString& fileName )
{
// If file exist but is not writeable...
diff --git a/kabc/plugins/olaccess/resourceolaccessconfig.h b/kabc/plugins/olaccess/resourceolaccessconfig.h
index 29765c8..38d47ba 100644
--- a/kabc/plugins/olaccess/resourceolaccessconfig.h
+++ b/kabc/plugins/olaccess/resourceolaccessconfig.h
@@ -36,10 +36,10 @@ $Id$
namespace KABC {
-class ResourceSharpDTMConfig : public KRES::ConfigWidget
+class ResourceolaccessConfig : public KRES::ConfigWidget
{
Q_OBJECT
public:
- ResourceSharpDTMConfig( QWidget* parent = 0, const char* name = 0 );
+ ResourceolaccessConfig( QWidget* parent = 0, const char* name = 0 );
public slots: