pull/16/head
Timothy Pearson 11 years ago
parent d1bd46309a
commit c56660aff3

@ -47,7 +47,7 @@ using namespace KABC;
void tqt_enter_modal( TQWidget *widget );
void tqt_leave_modal( TQWidget *widget );
class ResourceLDAPTDEIO::ResourceLDAPKIOPrivate
class ResourceLDAPTDEIO::ResourceLDAPTDEIOPrivate
{
public:
LDIF mLdif;
@ -69,10 +69,10 @@ class ResourceLDAPTDEIO::ResourceLDAPKIOPrivate
KTempFile *mTmp;
};
ResourceLDAPTDEIO::ResourceLDAPKIO( const TDEConfig *config )
ResourceLDAPTDEIO::ResourceLDAPTDEIO( const TDEConfig *config )
: Resource( config )
{
d = new ResourceLDAPKIOPrivate;
d = new ResourceLDAPTDEIOPrivate;
if ( config ) {
TQMap<TQString, TQString> attrList;
TQStringList attributes = config->readListEntry( "LdapAttributes" );
@ -115,7 +115,7 @@ ResourceLDAPTDEIO::ResourceLDAPKIO( const TDEConfig *config )
init();
}
ResourceLDAPTDEIO::~ResourceLDAPKIO()
ResourceLDAPTDEIO::~ResourceLDAPTDEIO()
{
delete d;
}
@ -549,10 +549,10 @@ bool ResourceLDAPTDEIO::load()
enter_loop();
}
if ( mErrorMsg.isEmpty() ) {
kdDebug(7125) << "ResourceLDAPKIO load ok!" << endl;
kdDebug(7125) << "ResourceLDAPTDEIO load ok!" << endl;
return true;
} else {
kdDebug(7125) << "ResourceLDAPKIO load finished with error: " << mErrorMsg << endl;
kdDebug(7125) << "ResourceLDAPTDEIO load finished with error: " << mErrorMsg << endl;
addressBook()->error( mErrorMsg );
return false;
}
@ -726,7 +726,7 @@ void ResourceLDAPTDEIO::result( TDEIO::Job *job )
bool ResourceLDAPTDEIO::save( Ticket* )
{
kdDebug(7125) << "ResourceLDAPKIO save" << endl;
kdDebug(7125) << "ResourceLDAPTDEIO save" << endl;
d->mSaveIt = begin();
TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false );
@ -736,10 +736,10 @@ bool ResourceLDAPTDEIO::save( Ticket* )
this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) );
enter_loop();
if ( mErrorMsg.isEmpty() ) {
kdDebug(7125) << "ResourceLDAPKIO save ok!" << endl;
kdDebug(7125) << "ResourceLDAPTDEIO save ok!" << endl;
return true;
} else {
kdDebug(7125) << "ResourceLDAPKIO finished with error: " << mErrorMsg << endl;
kdDebug(7125) << "ResourceLDAPTDEIO finished with error: " << mErrorMsg << endl;
addressBook()->error( mErrorMsg );
return false;
}
@ -747,7 +747,7 @@ bool ResourceLDAPTDEIO::save( Ticket* )
bool ResourceLDAPTDEIO::asyncSave( Ticket* )
{
kdDebug(7125) << "ResourceLDAPKIO asyncSave" << endl;
kdDebug(7125) << "ResourceLDAPTDEIO asyncSave" << endl;
d->mSaveIt = begin();
TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false );
connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ),
@ -784,15 +784,15 @@ void ResourceLDAPTDEIO::saveData( TDEIO::Job*, TQByteArray& data )
!(*d->mSaveIt).changed() ) d->mSaveIt++;
if ( d->mSaveIt == end() ) {
kdDebug(7125) << "ResourceLDAPKIO endData" << endl;
kdDebug(7125) << "ResourceLDAPTDEIO endData" << endl;
data.resize(0);
return;
}
kdDebug(7125) << "ResourceLDAPKIO saveData: " << (*d->mSaveIt).assembledName() << endl;
kdDebug(7125) << "ResourceLDAPTDEIO saveData: " << (*d->mSaveIt).assembledName() << endl;
AddresseeToLDIF( data, *d->mSaveIt, findUid( (*d->mSaveIt).uid() ) );
// kdDebug(7125) << "ResourceLDAPKIO save LDIF: " << TQString::fromUtf8(data) << endl;
// kdDebug(7125) << "ResourceLDAPTDEIO save LDIF: " << TQString::fromUtf8(data) << endl;
// mark as unchanged
(*d->mSaveIt).setChanged( false );
@ -803,14 +803,14 @@ void ResourceLDAPTDEIO::removeAddressee( const Addressee& addr )
{
TQString dn = findUid( addr.uid() );
kdDebug(7125) << "ResourceLDAPKIO: removeAddressee: " << dn << endl;
kdDebug(7125) << "ResourceLDAPTDEIO: removeAddressee: " << dn << endl;
if ( !mErrorMsg.isEmpty() ) {
addressBook()->error( mErrorMsg );
return;
}
if ( !dn.isEmpty() ) {
kdDebug(7125) << "ResourceLDAPKIO: found uid: " << dn << endl;
kdDebug(7125) << "ResourceLDAPTDEIO: found uid: " << dn << endl;
LDAPUrl url( d->mLDAPUrl );
url.setPath( "/" + dn );
url.setExtension( "x-dir", "base" );

@ -30,15 +30,15 @@ class TDEConfig;
namespace KABC {
class KABC_EXPORT ResourceLDAPKIO : public Resource
class KABC_EXPORT ResourceLDAPTDEIO : public Resource
{
Q_OBJECT
public:
enum CachePolicy{ Cache_No, Cache_NoConnection, Cache_Always };
ResourceLDAPKIO( const TDEConfig* );
virtual ~ResourceLDAPKIO();
ResourceLDAPTDEIO( const TDEConfig* );
virtual ~ResourceLDAPTDEIO();
/**
* Call this after you used one of the set... methods
*/
@ -162,8 +162,8 @@ protected slots:
bool AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr,
const TQString &olddn );
class ResourceLDAPKIOPrivate;
ResourceLDAPKIOPrivate *d;
class ResourceLDAPTDEIOPrivate;
ResourceLDAPTDEIOPrivate *d;
};
}

@ -64,7 +64,7 @@ ResourceLDAPTDEIOConfig::ResourceLDAPTDEIOConfig( TQWidget* parent, const char*
void ResourceLDAPTDEIOConfig::loadSettings( KRES::Resource *res )
{
ResourceLDAPKIO *resource = dynamic_cast<ResourceLDAPKIO*>( res );
ResourceLDAPTDEIO *resource = dynamic_cast<ResourceLDAPTDEIO*>( res );
if ( !resource ) {
kdDebug(5700) << "ResourceLDAPTDEIOConfig::loadSettings(): cast failed" << endl;
@ -100,7 +100,7 @@ void ResourceLDAPTDEIOConfig::loadSettings( KRES::Resource *res )
void ResourceLDAPTDEIOConfig::saveSettings( KRES::Resource *res )
{
ResourceLDAPKIO *resource = dynamic_cast<ResourceLDAPKIO*>( res );
ResourceLDAPTDEIO *resource = dynamic_cast<ResourceLDAPTDEIO*>( res );
if ( !resource ) {
kdDebug(5700) << "ResourceLDAPTDEIOConfig::saveSettings(): cast failed" << endl;

@ -31,6 +31,6 @@ extern "C"
KDE_EXPORT void *init_kabc_ldapkio()
{
TDEGlobal::locale()->insertCatalogue("kabc_ldapkio");
return new KRES::PluginFactory<ResourceLDAPKIO, ResourceLDAPTDEIOConfig>();
return new KRES::PluginFactory<ResourceLDAPTDEIO, ResourceLDAPTDEIOConfig>();
}
}

Loading…
Cancel
Save