summaryrefslogtreecommitdiffabout
path: root/kabc
Side-by-side diff
Diffstat (limited to 'kabc') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp7
-rw-r--r--kabc/plugins/file/resourcefile.cpp7
-rw-r--r--kabc/plugins/ldap/resourceldap.cpp7
3 files changed, 21 insertions, 0 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index e2b7b08..c61664b 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -65,48 +65,55 @@ using namespace KABC;
extern "C"
#ifdef _WIN32_
__declspec(dllexport)
#else
{
#endif
//US void *init_kabc_dir()
void *init_microkabc_dir()
{
return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>();
}
#ifndef _WIN32_
}
#endif
ResourceDir::ResourceDir( const KConfig *config )
: Resource( config )
{
QString path;
KConfig *cfg = (KConfig *)config;
if ( cfg ) {
+#ifdef _WIN32_
+ // we use plugins on win32. the group is stored in a static variable
+ // such that group info not available on win32 plugins
+ // to fix that, it would be a looooot of work
+ if ( !cfg->tempGroup().isEmpty() )
+ cfg->setGroup( cfg->tempGroup() );
+#endif
//US path = config->readEntry( "FilePath" );
path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() );
//US mFormatName = config->readEntry( "FileFormat" );
mFormatName = cfg->readEntry( "FileFormat", "vcard" );
} else {
path = StdAddressBook::directoryName();
mFormatName = "vcard";
}
FormatFactory *factory = FormatFactory::self();
mFormat = factory->format( mFormatName );
if ( !mFormat ) {
mFormatName = "vcard";
mFormat = factory->format( mFormatName );
}
/*US
//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1());
if (mFormatName == "vcard")
mFormat = new VCardFormatPlugin2();
else if (mFormatName == "binary")
mFormat = new BinaryFormat();
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index c89939d..dad4571 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -62,48 +62,55 @@ extern "C"
#ifdef _WIN32_
__declspec(dllexport)
#else
{
#endif
//US void *init_kabc_file()
void *init_microkabc_file()
{
return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>();
}
#ifndef _WIN32_
}
#endif
ResourceFile::ResourceFile( const KConfig *config )
: Resource( config ) , mFormat( 0 )
{
QString fileName, formatName, default_fileName;
default_fileName = StdAddressBook::fileName();
mLastBackupDate = -1;
KConfig *cfg = (KConfig *)config;
if ( cfg ) {
+#ifdef _WIN32_
+ // we use plugins on win32. the group is stored in a static variable
+ // such that group info not available on win32 plugins
+ // to fix that, it would be a looooot of work
+ if ( !cfg->tempGroup().isEmpty() )
+ cfg->setGroup( cfg->tempGroup() );
+#endif
fileName = cfg->readEntry( "FileName", default_fileName );
formatName = cfg->readEntry( "FileFormat", "vcard" );
mFamily = cfg->readEntry( "ResourceName", "std" );
mLastBackupDate = cfg->readNumEntry( "LastBackupDate", 0 );
} else {
fileName = default_fileName;
formatName = "vcard";
}
init( fileName, formatName );
}
ResourceFile::ResourceFile( const QString &fileName ,
const QString &formatName )
: Resource( 0 )
{
// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1());
mLastBackupDate = -1;
init( fileName, formatName );
}
void ResourceFile::init( const QString &fileName, const QString &formatName )
diff --git a/kabc/plugins/ldap/resourceldap.cpp b/kabc/plugins/ldap/resourceldap.cpp
index 55c43af..c3097de 100644
--- a/kabc/plugins/ldap/resourceldap.cpp
+++ b/kabc/plugins/ldap/resourceldap.cpp
@@ -35,48 +35,55 @@ $Id$
#include <stdlib.h>
#include "resourceldap.h"
#include "resourceldapconfig.h"
using namespace KABC;
extern "C"
{
//US void *init_kabc_ldap()
void *init_microkabc_ldap()
{
return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig>();
}
}
void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value );
ResourceLDAP::ResourceLDAP( const KConfig *config )
: Resource( config ), mPort( 389 ), mLdap( 0 )
{
KConfig *cfg = (KConfig *)config;
if ( cfg ) {
+#ifdef _WIN32_
+ // we use plugins on win32. the group is stored in a static variable
+ // such that group info not available on win32 plugins
+ // to fix that, it would be a looooot of work
+ if ( !cfg->tempGroup().isEmpty() )
+ cfg->setGroup( cfg->tempGroup() );
+#endif
mUser = cfg->readEntry( "LdapUser" );
mPassword = KStringHandler::obscure( cfg->readEntry( "LdapPassword" ) );
mDn = cfg->readEntry( "LdapDn" );
mHost = cfg->readEntry( "LdapHost" );
mPort = cfg->readNumEntry( "LdapPort", 389 );
mFilter = cfg->readEntry( "LdapFilter" );
mAnonymous = cfg->readBoolEntry( "LdapAnonymous" );
QStringList attributes = cfg->readListEntry( "LdapAttributes" );
for ( uint pos = 0; pos < attributes.count(); pos += 2 )
mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] );
}
/**
If you want to add new attributes, append them here, add a
translation string in the ctor of AttributesDialog and
handle them in the load() method below.
These are the default values from
*/
if ( mAttributes.count() == 0 ) {
mAttributes.insert( "commonName", "cn" );
mAttributes.insert( "formattedName", "displayName" );
mAttributes.insert( "familyName", "sn" );
mAttributes.insert( "givenName", "givenName" );