diff options
Diffstat (limited to 'kabc/plugins/ldapkio')
-rw-r--r-- | kabc/plugins/ldapkio/resourceldapkio.cpp | 218 | ||||
-rw-r--r-- | kabc/plugins/ldapkio/resourceldapkio.h | 66 | ||||
-rw-r--r-- | kabc/plugins/ldapkio/resourceldapkioconfig.cpp | 140 | ||||
-rw-r--r-- | kabc/plugins/ldapkio/resourceldapkioconfig.h | 40 |
4 files changed, 232 insertions, 232 deletions
diff --git a/kabc/plugins/ldapkio/resourceldapkio.cpp b/kabc/plugins/ldapkio/resourceldapkio.cpp index 30b8ba7e0..df0baf455 100644 --- a/kabc/plugins/ldapkio/resourceldapkio.cpp +++ b/kabc/plugins/ldapkio/resourceldapkio.cpp @@ -20,9 +20,9 @@ */ -#include <qapplication.h> -#include <qbuffer.h> -#include <qfile.h> +#include <tqapplication.h> +#include <tqbuffer.h> +#include <tqfile.h> #include <kdebug.h> #include <kglobal.h> @@ -44,28 +44,28 @@ using namespace KABC; // Hack from Netaccess -void qt_enter_modal( QWidget *widget ); -void qt_leave_modal( QWidget *widget ); +void qt_enter_modal( TQWidget *widget ); +void qt_leave_modal( TQWidget *widget ); class ResourceLDAPKIO::ResourceLDAPKIOPrivate { public: LDIF mLdif; bool mTLS,mSSL,mSubTree; - QString mResultDn; + TQString mResultDn; Addressee mAddr; Address mAd; Resource::Iterator mSaveIt; bool mSASL; - QString mMech; - QString mRealm, mBindDN; + TQString mMech; + TQString mRealm, mBindDN; LDAPUrl mLDAPUrl; int mVer, mSizeLimit, mTimeLimit, mRDNPrefix; int mError; int mCachePolicy; bool mReadOnly; bool mAutoCache; - QString mCacheDst; + TQString mCacheDst; KTempFile *mTmp; }; @@ -74,8 +74,8 @@ ResourceLDAPKIO::ResourceLDAPKIO( const KConfig *config ) { d = new ResourceLDAPKIOPrivate; if ( config ) { - QMap<QString, QString> attrList; - QStringList attributes = config->readListEntry( "LdapAttributes" ); + TQMap<TQString, TQString> attrList; + TQStringList attributes = config->readListEntry( "LdapAttributes" ); for ( uint pos = 0; pos < attributes.count(); pos += 2 ) mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); @@ -122,8 +122,8 @@ ResourceLDAPKIO::~ResourceLDAPKIO() void ResourceLDAPKIO::enter_loop() { - QWidget dummy(0,0,WType_Dialog | WShowModal); - dummy.setFocusPolicy( QWidget::NoFocus ); + TQWidget dummy(0,0,WType_Dialog | WShowModal); + dummy.setFocusPolicy( TQWidget::NoFocus ); qt_enter_modal(&dummy); qApp->enter_loop(); qt_leave_modal(&dummy); @@ -157,7 +157,7 @@ void ResourceLDAPKIO::listResult( KIO::Job *job) qApp->exit_loop(); } -QString ResourceLDAPKIO::findUid( const QString &uid ) +TQString ResourceLDAPKIO::findUid( const TQString &uid ) { LDAPUrl url( d->mLDAPUrl ); KIO::UDSEntry entry; @@ -173,18 +173,18 @@ QString ResourceLDAPKIO::findUid( const QString &uid ) KIO::ListJob * listJob = KIO::listDir( url, false /* no GUI */ ); connect( listJob, - SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), - SLOT( entries( KIO::Job*, const KIO::UDSEntryList& ) ) ); - connect( listJob, SIGNAL( result( KIO::Job* ) ), - this, SLOT( listResult( KIO::Job* ) ) ); + TQT_SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), + TQT_SLOT( entries( KIO::Job*, const KIO::UDSEntryList& ) ) ); + connect( listJob, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( listResult( KIO::Job* ) ) ); enter_loop(); return d->mResultDn; } -QCString ResourceLDAPKIO::addEntry( const QString &attr, const QString &value, bool mod ) +TQCString ResourceLDAPKIO::addEntry( const TQString &attr, const TQString &value, bool mod ) { - QCString tmp; + TQCString tmp; if ( !attr.isEmpty() ) { if ( mod ) tmp += LDIF::assembleLine( "replace", attr ) + "\n"; tmp += LDIF::assembleLine( attr, value ) + "\n"; @@ -193,12 +193,12 @@ QCString ResourceLDAPKIO::addEntry( const QString &attr, const QString &value, b return ( tmp ); } -bool ResourceLDAPKIO::AddresseeToLDIF( QByteArray &ldif, const Addressee &addr, - const QString &olddn ) +bool ResourceLDAPKIO::AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, + const TQString &olddn ) { - QCString tmp; - QString dn; - QByteArray data; + TQCString tmp; + TQString dn; + TQByteArray data; bool mod = false; if ( olddn.isEmpty() ) { @@ -237,8 +237,8 @@ bool ResourceLDAPKIO::AddresseeToLDIF( QByteArray &ldif, const Addressee &addr, if ( mod ) tmp += "changetype: modify\n"; if ( !mod ) { tmp += "objectClass: top\n"; - QStringList obclass = QStringList::split( ',', mAttributes[ "objectClass" ] ); - for ( QStringList::iterator it = obclass.begin(); it != obclass.end(); it++ ) { + TQStringList obclass = TQStringList::split( ',', mAttributes[ "objectClass" ] ); + for ( TQStringList::iterator it = obclass.begin(); it != obclass.end(); it++ ) { tmp += LDIF::assembleLine( "objectClass", *it ) + "\n"; } } @@ -273,8 +273,8 @@ bool ResourceLDAPKIO::AddresseeToLDIF( QByteArray &ldif, const Addressee &addr, tmp += addEntry( mAttributes[ "postalcode" ], ad.postalCode(), mod ); } - QStringList emails = addr.emails(); - QStringList::ConstIterator mailIt = emails.begin(); + TQStringList emails = addr.emails(); + TQStringList::ConstIterator mailIt = emails.begin(); if ( !mAttributes[ "mail" ].isEmpty() ) { if ( mod ) tmp += @@ -296,8 +296,8 @@ bool ResourceLDAPKIO::AddresseeToLDIF( QByteArray &ldif, const Addressee &addr, } if ( !mAttributes[ "jpegPhoto" ].isEmpty() ) { - QByteArray pic; - QBuffer buffer( pic ); + TQByteArray pic; + TQBuffer buffer( pic ); buffer.open( IO_WriteOnly ); addr.photo().data().save( &buffer, "JPEG" ); @@ -308,7 +308,7 @@ bool ResourceLDAPKIO::AddresseeToLDIF( QByteArray &ldif, const Addressee &addr, } tmp += "\n"; - kdDebug(7125) << "ldif: " << QString::fromUtf8(tmp) << endl; + kdDebug(7125) << "ldif: " << TQString::fromUtf8(tmp) << endl; ldif = tmp; return true; } @@ -386,8 +386,8 @@ void ResourceLDAPKIO::init() d->mLDAPUrl.setDn( mDn ); if (!mAttributes.empty()) { - QMap<QString,QString>::Iterator it; - QStringList attr; + TQMap<TQString,TQString>::Iterator it; + TQStringList attr; for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { if ( !it.data().isEmpty() && it.key() != "objectClass" ) attr.append( it.data() ); @@ -400,11 +400,11 @@ void ResourceLDAPKIO::init() d->mLDAPUrl.setFilter( mFilter ); d->mLDAPUrl.setExtension( "x-dir", "base" ); if ( d->mTLS ) d->mLDAPUrl.setExtension( "x-tls", "" ); - d->mLDAPUrl.setExtension( "x-ver", QString::number( d->mVer ) ); + d->mLDAPUrl.setExtension( "x-ver", TQString::number( d->mVer ) ); if ( d->mSizeLimit ) - d->mLDAPUrl.setExtension( "x-sizelimit", QString::number( d->mSizeLimit ) ); + d->mLDAPUrl.setExtension( "x-sizelimit", TQString::number( d->mSizeLimit ) ); if ( d->mTimeLimit ) - d->mLDAPUrl.setExtension( "x-timelimit", QString::number( d->mTimeLimit ) ); + d->mLDAPUrl.setExtension( "x-timelimit", TQString::number( d->mTimeLimit ) ); if ( d->mSASL ) { d->mLDAPUrl.setExtension( "x-sasl", "" ); if ( !d->mBindDN.isEmpty() ) d->mLDAPUrl.setExtension( "bindname", d->mBindDN ); @@ -442,8 +442,8 @@ void ResourceLDAPKIO::writeConfig( KConfig *config ) config->writeEntry( "LdapCachePolicy", d->mCachePolicy ); config->writeEntry( "LdapAutoCache", d->mAutoCache ); - QStringList attributes; - QMap<QString, QString>::Iterator it; + TQStringList attributes; + TQMap<TQString, TQString>::Iterator it; for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) attributes << it.key() << it.data(); @@ -487,7 +487,7 @@ void ResourceLDAPKIO::activateCache() { if ( d->mTmp && d->mError == 0 ) { d->mTmp->close(); - rename( QFile::encodeName( d->mTmp->name() ), QFile::encodeName( d->mCacheDst ) ); + rename( TQFile::encodeName( d->mTmp->name() ), TQFile::encodeName( d->mCacheDst ) ); } if ( d->mTmp ) { delete d->mTmp; @@ -511,8 +511,8 @@ KIO::Job *ResourceLDAPKIO::loadFromCache() KURL url( d->mCacheDst ); job = KIO::get( url, true, false ); - connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - this, SLOT( data( KIO::Job*, const QByteArray& ) ) ); + connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( KIO::Job*, const TQByteArray& ) ) ); } return job; } @@ -535,17 +535,17 @@ bool ResourceLDAPKIO::load() createCache(); if ( d->mCachePolicy != Cache_Always ) { job = KIO::get( d->mLDAPUrl, true, false ); - connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - this, SLOT( data( KIO::Job*, const QByteArray& ) ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( syncLoadSaveResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( KIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( KIO::Job* ) ) ); enter_loop(); } job = loadFromCache(); if ( job ) { - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( syncLoadSaveResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( KIO::Job* ) ) ); enter_loop(); } if ( mErrorMsg.isEmpty() ) { @@ -572,17 +572,17 @@ bool ResourceLDAPKIO::asyncLoad() createCache(); if ( d->mCachePolicy != Cache_Always ) { KIO::Job *job = KIO::get( d->mLDAPUrl, true, false ); - connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - this, SLOT( data( KIO::Job*, const QByteArray& ) ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( result( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( KIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( result( KIO::Job* ) ) ); } else { result( NULL ); } return true; } -void ResourceLDAPKIO::data( KIO::Job *, const QByteArray &data ) +void ResourceLDAPKIO::data( KIO::Job *, const TQByteArray &data ) { if ( data.size() ) { d->mLdif.setLDIF( data ); @@ -594,8 +594,8 @@ void ResourceLDAPKIO::data( KIO::Job *, const QByteArray &data ) } LDIF::ParseVal ret; - QString name; - QByteArray value; + TQString name; + TQByteArray value; do { ret = d->mLdif.nextItem(); switch ( ret ) { @@ -607,60 +607,60 @@ void ResourceLDAPKIO::data( KIO::Job *, const QByteArray &data ) value = d->mLdif.val(); if ( name == mAttributes[ "commonName" ].lower() ) { if ( !d->mAddr.formattedName().isEmpty() ) { - QString fn = d->mAddr.formattedName(); - d->mAddr.setNameFromString( QString::fromUtf8( value, value.size() ) ); + TQString fn = d->mAddr.formattedName(); + d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); d->mAddr.setFormattedName( fn ); } else - d->mAddr.setNameFromString( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "formattedName" ].lower() ) { - d->mAddr.setFormattedName( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setFormattedName( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "givenName" ].lower() ) { - d->mAddr.setGivenName( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setGivenName( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "mail" ].lower() ) { - d->mAddr.insertEmail( QString::fromUtf8( value, value.size() ), true ); + d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), true ); } else if ( name == mAttributes[ "mailAlias" ].lower() ) { - d->mAddr.insertEmail( QString::fromUtf8( value, value.size() ), false ); + d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), false ); } else if ( name == mAttributes[ "phoneNumber" ].lower() ) { PhoneNumber phone; - phone.setNumber( QString::fromUtf8( value, value.size() ) ); + phone.setNumber( TQString::fromUtf8( value, value.size() ) ); d->mAddr.insertPhoneNumber( phone ); } else if ( name == mAttributes[ "telephoneNumber" ].lower() ) { - PhoneNumber phone( QString::fromUtf8( value, value.size() ), + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), PhoneNumber::Work ); d->mAddr.insertPhoneNumber( phone ); } else if ( name == mAttributes[ "facsimileTelephoneNumber" ].lower() ) { - PhoneNumber phone( QString::fromUtf8( value, value.size() ), + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), PhoneNumber::Fax ); d->mAddr.insertPhoneNumber( phone ); } else if ( name == mAttributes[ "mobile" ].lower() ) { - PhoneNumber phone( QString::fromUtf8( value, value.size() ), + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), PhoneNumber::Cell ); d->mAddr.insertPhoneNumber( phone ); } else if ( name == mAttributes[ "pager" ].lower() ) { - PhoneNumber phone( QString::fromUtf8( value, value.size() ), + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), PhoneNumber::Pager ); d->mAddr.insertPhoneNumber( phone ); } else if ( name == mAttributes[ "description" ].lower() ) { - d->mAddr.setNote( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setNote( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "title" ].lower() ) { - d->mAddr.setTitle( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setTitle( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "street" ].lower() ) { - d->mAd.setStreet( QString::fromUtf8( value, value.size() ) ); + d->mAd.setStreet( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "state" ].lower() ) { - d->mAd.setRegion( QString::fromUtf8( value, value.size() ) ); + d->mAd.setRegion( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "city" ].lower() ) { - d->mAd.setLocality( QString::fromUtf8( value, value.size() ) ); + d->mAd.setLocality( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "postalcode" ].lower() ) { - d->mAd.setPostalCode( QString::fromUtf8( value, value.size() ) ); + d->mAd.setPostalCode( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "organization" ].lower() ) { - d->mAddr.setOrganization( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setOrganization( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "familyName" ].lower() ) { - d->mAddr.setFamilyName( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setFamilyName( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "uid" ].lower() ) { - d->mAddr.setUid( QString::fromUtf8( value, value.size() ) ); + d->mAddr.setUid( TQString::fromUtf8( value, value.size() ) ); } else if ( name == mAttributes[ "jpegPhoto" ].lower() ) { KABC::Picture photo; - QImage img( value ); + TQImage img( value ); if ( !img.isNull() ) { photo.setData( img ); photo.setType( "image/jpeg" ); @@ -714,8 +714,8 @@ void ResourceLDAPKIO::result( KIO::Job *job ) KIO::Job *cjob; cjob = loadFromCache(); if ( cjob ) { - connect( cjob, SIGNAL( result( KIO::Job* ) ), - this, SLOT( loadCacheResult( KIO::Job* ) ) ); + connect( cjob, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( loadCacheResult( KIO::Job* ) ) ); } else { if ( !mErrorMsg.isEmpty() ) emit loadingError( this, mErrorMsg ); @@ -730,10 +730,10 @@ bool ResourceLDAPKIO::save( Ticket* ) d->mSaveIt = begin(); KIO::Job *job = KIO::put( d->mLDAPUrl, -1, true, false, false ); - connect( job, SIGNAL( dataReq( KIO::Job*, QByteArray& ) ), - this, SLOT( saveData( KIO::Job*, QByteArray& ) ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( syncLoadSaveResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( dataReq( KIO::Job*, TQByteArray& ) ), + this, TQT_SLOT( saveData( KIO::Job*, TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( KIO::Job* ) ) ); enter_loop(); if ( mErrorMsg.isEmpty() ) { kdDebug(7125) << "ResourceLDAPKIO save ok!" << endl; @@ -750,10 +750,10 @@ bool ResourceLDAPKIO::asyncSave( Ticket* ) kdDebug(7125) << "ResourceLDAPKIO asyncSave" << endl; d->mSaveIt = begin(); KIO::Job *job = KIO::put( d->mLDAPUrl, -1, true, false, false ); - connect( job, SIGNAL( dataReq( KIO::Job*, QByteArray& ) ), - this, SLOT( saveData( KIO::Job*, QByteArray& ) ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( saveResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( dataReq( KIO::Job*, TQByteArray& ) ), + this, TQT_SLOT( saveData( KIO::Job*, TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( saveResult( KIO::Job* ) ) ); return true; } @@ -778,7 +778,7 @@ void ResourceLDAPKIO::saveResult( KIO::Job *job ) emit savingFinished( this ); } -void ResourceLDAPKIO::saveData( KIO::Job*, QByteArray& data ) +void ResourceLDAPKIO::saveData( KIO::Job*, TQByteArray& data ) { while ( d->mSaveIt != end() && !(*d->mSaveIt).changed() ) d->mSaveIt++; @@ -792,7 +792,7 @@ void ResourceLDAPKIO::saveData( KIO::Job*, QByteArray& data ) kdDebug(7125) << "ResourceLDAPKIO saveData: " << (*d->mSaveIt).assembledName() << endl; AddresseeToLDIF( data, *d->mSaveIt, findUid( (*d->mSaveIt).uid() ) ); -// kdDebug(7125) << "ResourceLDAPKIO save LDIF: " << QString::fromUtf8(data) << endl; +// kdDebug(7125) << "ResourceLDAPKIO save LDIF: " << TQString::fromUtf8(data) << endl; // mark as unchanged (*d->mSaveIt).setChanged( false ); @@ -801,7 +801,7 @@ void ResourceLDAPKIO::saveData( KIO::Job*, QByteArray& data ) void ResourceLDAPKIO::removeAddressee( const Addressee& addr ) { - QString dn = findUid( addr.uid() ); + TQString dn = findUid( addr.uid() ); kdDebug(7125) << "ResourceLDAPKIO: removeAddressee: " << dn << endl; @@ -823,42 +823,42 @@ void ResourceLDAPKIO::removeAddressee( const Addressee& addr ) } -void ResourceLDAPKIO::setUser( const QString &user ) +void ResourceLDAPKIO::setUser( const TQString &user ) { mUser = user; } -QString ResourceLDAPKIO::user() const +TQString ResourceLDAPKIO::user() const { return mUser; } -void ResourceLDAPKIO::setPassword( const QString &password ) +void ResourceLDAPKIO::setPassword( const TQString &password ) { mPassword = password; } -QString ResourceLDAPKIO::password() const +TQString ResourceLDAPKIO::password() const { return mPassword; } -void ResourceLDAPKIO::setDn( const QString &dn ) +void ResourceLDAPKIO::setDn( const TQString &dn ) { mDn = dn; } -QString ResourceLDAPKIO::dn() const +TQString ResourceLDAPKIO::dn() const { return mDn; } -void ResourceLDAPKIO::setHost( const QString &host ) +void ResourceLDAPKIO::setHost( const TQString &host ) { mHost = host; } -QString ResourceLDAPKIO::host() const +TQString ResourceLDAPKIO::host() const { return mHost; } @@ -903,12 +903,12 @@ int ResourceLDAPKIO::timeLimit() return d->mTimeLimit; } -void ResourceLDAPKIO::setFilter( const QString &filter ) +void ResourceLDAPKIO::setFilter( const TQString &filter ) { mFilter = filter; } -QString ResourceLDAPKIO::filter() const +TQString ResourceLDAPKIO::filter() const { return mFilter; } @@ -952,12 +952,12 @@ bool ResourceLDAPKIO::isSubTree() const return d->mSubTree; } -void ResourceLDAPKIO::setAttributes( const QMap<QString, QString> &attributes ) +void ResourceLDAPKIO::setAttributes( const TQMap<TQString, TQString> &attributes ) { mAttributes = attributes; } -QMap<QString, QString> ResourceLDAPKIO::attributes() const +TQMap<TQString, TQString> ResourceLDAPKIO::attributes() const { return mAttributes; } @@ -982,32 +982,32 @@ bool ResourceLDAPKIO::isSASL() const return d->mSASL; } -void ResourceLDAPKIO::setMech( const QString &mech ) +void ResourceLDAPKIO::setMech( const TQString &mech ) { d->mMech = mech; } -QString ResourceLDAPKIO::mech() const +TQString ResourceLDAPKIO::mech() const { return d->mMech; } -void ResourceLDAPKIO::setRealm( const QString &realm ) +void ResourceLDAPKIO::setRealm( const TQString &realm ) { d->mRealm = realm; } -QString ResourceLDAPKIO::realm() const +TQString ResourceLDAPKIO::realm() const { return d->mRealm; } -void ResourceLDAPKIO::setBindDN( const QString &binddn ) +void ResourceLDAPKIO::setBindDN( const TQString &binddn ) { d->mBindDN = binddn; } -QString ResourceLDAPKIO::bindDN() const +TQString ResourceLDAPKIO::bindDN() const { return d->mBindDN; } @@ -1032,7 +1032,7 @@ bool ResourceLDAPKIO::autoCache() return d->mAutoCache; } -QString ResourceLDAPKIO::cacheDst() const +TQString ResourceLDAPKIO::cacheDst() const { return d->mCacheDst; } diff --git a/kabc/plugins/ldapkio/resourceldapkio.h b/kabc/plugins/ldapkio/resourceldapkio.h index bd72a9b11..2b5685fdc 100644 --- a/kabc/plugins/ldapkio/resourceldapkio.h +++ b/kabc/plugins/ldapkio/resourceldapkio.h @@ -62,23 +62,23 @@ class KABC_EXPORT ResourceLDAPKIO : public Resource virtual void removeAddressee( const Addressee& addr ); - void setUser( const QString &user ); - QString user() const; + void setUser( const TQString &user ); + TQString user() const; - void setPassword( const QString &password ); - QString password() const; + void setPassword( const TQString &password ); + TQString password() const; - void setRealm( const QString &realm ); - QString realm() const; + void setRealm( const TQString &realm ); + TQString realm() const; - void setBindDN( const QString &binddn ); - QString bindDN() const; + void setBindDN( const TQString &binddn ); + TQString bindDN() const; - void setDn( const QString &dn ); - QString dn() const; + void setDn( const TQString &dn ); + TQString dn() const; - void setHost( const QString &host ); - QString host() const; + void setHost( const TQString &host ); + TQString host() const; void setPort( int port ); int port() const; @@ -92,14 +92,14 @@ class KABC_EXPORT ResourceLDAPKIO : public Resource void setTimeLimit( int timelimit ); int timeLimit(); - void setFilter( const QString &filter ); - QString filter() const; + void setFilter( const TQString &filter ); + TQString filter() const; void setIsAnonymous( bool value ); bool isAnonymous() const; - void setAttributes( const QMap<QString, QString> &attributes ); - QMap<QString, QString> attributes() const; + void setAttributes( const TQMap<TQString, TQString> &attributes ); + TQMap<TQString, TQString> attributes() const; void setRDNPrefix( int value ); int RDNPrefix() const; @@ -116,8 +116,8 @@ class KABC_EXPORT ResourceLDAPKIO : public Resource void setIsSASL( bool value ); bool isSASL() const ; - void setMech( const QString &mech ); - QString mech() const; + void setMech( const TQString &mech ); + TQString mech() const; void setCachePolicy( int pol ); int cachePolicy() const; @@ -125,42 +125,42 @@ class KABC_EXPORT ResourceLDAPKIO : public Resource void setAutoCache( bool value ); bool autoCache(); - QString cacheDst() const; + TQString cacheDst() const; protected slots: void entries( KIO::Job*, const KIO::UDSEntryList& ); - void data( KIO::Job*, const QByteArray& ); + void data( KIO::Job*, const TQByteArray& ); void result( KIO::Job* ); void listResult( KIO::Job* ); void syncLoadSaveResult( KIO::Job* ); void saveResult( KIO::Job* ); - void saveData( KIO::Job*, QByteArray& ); + void saveData( KIO::Job*, TQByteArray& ); void loadCacheResult( KIO::Job* ); private: - QString mUser; - QString mPassword; - QString mDn; - QString mHost; - QString mFilter; + TQString mUser; + TQString mPassword; + TQString mDn; + TQString mHost; + TQString mFilter; int mPort; bool mAnonymous; - QMap<QString, QString> mAttributes; + TQMap<TQString, TQString> mAttributes; KURL mLDAPUrl; int mGetCounter; //KDE 4: remove bool mErrorOccured; //KDE 4: remove - QString mErrorMsg; - QMap<KIO::Job*, QByteArray> mJobMap; //KDE 4: remove + TQString mErrorMsg; + TQMap<KIO::Job*, TQByteArray> mJobMap; //KDE 4: remove KIO::Job *loadFromCache(); void createCache(); void activateCache(); void enter_loop(); - QCString addEntry( const QString &attr, const QString &value, bool mod ); - QString findUid( const QString &uid ); - bool AddresseeToLDIF( QByteArray &ldif, const Addressee &addr, - const QString &olddn ); + TQCString addEntry( const TQString &attr, const TQString &value, bool mod ); + TQString findUid( const TQString &uid ); + bool AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, + const TQString &olddn ); class ResourceLDAPKIOPrivate; ResourceLDAPKIOPrivate *d; diff --git a/kabc/plugins/ldapkio/resourceldapkioconfig.cpp b/kabc/plugins/ldapkio/resourceldapkioconfig.cpp index ae54ab8c3..271328525 100644 --- a/kabc/plugins/ldapkio/resourceldapkioconfig.cpp +++ b/kabc/plugins/ldapkio/resourceldapkioconfig.cpp @@ -17,17 +17,17 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qapplication.h> - -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qspinbox.h> -#include <qvbox.h> -#include <qvgroupbox.h> -#include <qhbuttongroup.h> -#include <qradiobutton.h> +#include <tqapplication.h> + +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqvbox.h> +#include <tqvgroupbox.h> +#include <tqhbuttongroup.h> +#include <tqradiobutton.h> #include <kaccelmanager.h> #include <kcombobox.h> @@ -45,21 +45,21 @@ using namespace KABC; -ResourceLDAPKIOConfig::ResourceLDAPKIOConfig( QWidget* parent, const char* name ) +ResourceLDAPKIOConfig::ResourceLDAPKIOConfig( TQWidget* parent, const char* name ) : KRES::ConfigWidget( parent, name ) { - QBoxLayout *mainLayout = new QVBoxLayout( this ); + TQBoxLayout *mainLayout = new TQVBoxLayout( this ); mainLayout->setAutoAdd( true ); cfg = new LdapConfigWidget( LdapConfigWidget::W_ALL, this ); - mSubTree = new QCheckBox( i18n( "Sub-tree query" ), this ); - QHBox *box = new QHBox( this ); + mSubTree = new TQCheckBox( i18n( "Sub-tree query" ), this ); + TQHBox *box = new TQHBox( this ); box->setSpacing( KDialog::spacingHint() ); - mEditButton = new QPushButton( i18n( "Edit Attributes..." ), box ); - mCacheButton = new QPushButton( i18n( "Offline Use..." ), box ); + mEditButton = new TQPushButton( i18n( "Edit Attributes..." ), box ); + mCacheButton = new TQPushButton( i18n( "Offline Use..." ), box ); - connect( mEditButton, SIGNAL( clicked() ), SLOT( editAttributes() ) ); - connect( mCacheButton, SIGNAL( clicked() ), SLOT( editCache() ) ); + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editAttributes() ) ); + connect( mCacheButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editCache() ) ); } void ResourceLDAPKIOConfig::loadSettings( KRES::Resource *res ) @@ -143,13 +143,13 @@ void ResourceLDAPKIOConfig::editAttributes() void ResourceLDAPKIOConfig::editCache() { LDAPUrl src; - QStringList attr; + TQStringList attr; src = cfg->url(); src.setScope( mSubTree->isChecked() ? LDAPUrl::Sub : LDAPUrl::One ); if (!mAttributes.empty()) { - QMap<QString,QString>::Iterator it; - QStringList attr; + TQMap<TQString,TQString>::Iterator it; + TQStringList attr; for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { if ( !it.data().isEmpty() && it.key() != "objectClass" ) attr.append( it.data() ); @@ -165,34 +165,34 @@ void ResourceLDAPKIOConfig::editCache() } -AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, +AttributesDialog::AttributesDialog( const TQMap<TQString, TQString> &attributes, int rdnprefix, - QWidget *parent, const char *name ) + TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Attributes Configuration" ), Ok | Cancel, Ok, parent, name, true, true ) { mNameDict.setAutoDelete( true ); - mNameDict.insert( "objectClass", new QString( i18n( "Object classes" ) ) ); - mNameDict.insert( "commonName", new QString( i18n( "Common name" ) ) ); - mNameDict.insert( "formattedName", new QString( i18n( "Formatted name" ) ) ); - mNameDict.insert( "familyName", new QString( i18n( "Family name" ) ) ); - mNameDict.insert( "givenName", new QString( i18n( "Given name" ) ) ); - mNameDict.insert( "organization", new QString( i18n( "Organization" ) ) ); - mNameDict.insert( "title", new QString( i18n( "Title" ) ) ); - mNameDict.insert( "street", new QString( i18n( "Street" ) ) ); - mNameDict.insert( "state", new QString( i18n( "State" ) ) ); - mNameDict.insert( "city", new QString( i18n( "City" ) ) ); - mNameDict.insert( "postalcode", new QString( i18n( "Postal code" ) ) ); - mNameDict.insert( "mail", new QString( i18n( "Email" ) ) ); - mNameDict.insert( "mailAlias", new QString( i18n( "Email alias" ) ) ); - mNameDict.insert( "phoneNumber", new QString( i18n( "Telephone number" ) ) ); - mNameDict.insert( "telephoneNumber", new QString( i18n( "Work telephone number" ) ) ); - mNameDict.insert( "facsimileTelephoneNumber", new QString( i18n( "Fax number" ) ) ); - mNameDict.insert( "mobile", new QString( i18n( "Cell phone number" ) ) ); - mNameDict.insert( "pager", new QString( i18n( "Pager" ) ) ); - mNameDict.insert( "description", new QString( i18n( "Note" ) ) ); - mNameDict.insert( "uid", new QString( i18n( "UID" ) ) ); - mNameDict.insert( "jpegPhoto", new QString( i18n( "Photo" ) ) ); + mNameDict.insert( "objectClass", new TQString( i18n( "Object classes" ) ) ); + mNameDict.insert( "commonName", new TQString( i18n( "Common name" ) ) ); + mNameDict.insert( "formattedName", new TQString( i18n( "Formatted name" ) ) ); + mNameDict.insert( "familyName", new TQString( i18n( "Family name" ) ) ); + mNameDict.insert( "givenName", new TQString( i18n( "Given name" ) ) ); + mNameDict.insert( "organization", new TQString( i18n( "Organization" ) ) ); + mNameDict.insert( "title", new TQString( i18n( "Title" ) ) ); + mNameDict.insert( "street", new TQString( i18n( "Street" ) ) ); + mNameDict.insert( "state", new TQString( i18n( "State" ) ) ); + mNameDict.insert( "city", new TQString( i18n( "City" ) ) ); + mNameDict.insert( "postalcode", new TQString( i18n( "Postal code" ) ) ); + mNameDict.insert( "mail", new TQString( i18n( "Email" ) ) ); + mNameDict.insert( "mailAlias", new TQString( i18n( "Email alias" ) ) ); + mNameDict.insert( "phoneNumber", new TQString( i18n( "Telephone number" ) ) ); + mNameDict.insert( "telephoneNumber", new TQString( i18n( "Work telephone number" ) ) ); + mNameDict.insert( "facsimileTelephoneNumber", new TQString( i18n( "Fax number" ) ) ); + mNameDict.insert( "mobile", new TQString( i18n( "Cell phone number" ) ) ); + mNameDict.insert( "pager", new TQString( i18n( "Pager" ) ) ); + mNameDict.insert( "description", new TQString( i18n( "Note" ) ) ); + mNameDict.insert( "uid", new TQString( i18n( "UID" ) ) ); + mNameDict.insert( "jpegPhoto", new TQString( i18n( "Photo" ) ) ); // default map mDefaultMap.insert( "objectClass", "inetOrgPerson" ); @@ -218,7 +218,7 @@ AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, mDefaultMap.insert( "jpegPhoto", "jpegPhoto" ); // overwrite the default values here - QMap<QString, QString> kolabMap, netscapeMap, evolutionMap, outlookMap; + TQMap<TQString, TQString> kolabMap, netscapeMap, evolutionMap, outlookMap; // kolab kolabMap.insert( "formattedName", "display-name" ); @@ -233,11 +233,11 @@ AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, mMapList.append( evolutionMap ); mMapList.append( outlookMap ); - QFrame *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 4, ( attributes.count() + 4 ) >> 1, + TQFrame *page = plainPage(); + TQGridLayout *layout = new TQGridLayout( page, 4, ( attributes.count() + 4 ) >> 1, 0, spacingHint() ); - QLabel *label = new QLabel( i18n( "Template:" ), page ); + TQLabel *label = new TQLabel( i18n( "Template:" ), page ); layout->addWidget( label, 0, 0 ); mMapCombo = new KComboBox( page ); layout->addWidget( mMapCombo, 0, 1 ); @@ -247,9 +247,9 @@ AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, mMapCombo->insertItem( i18n( "Netscape" ) ); mMapCombo->insertItem( i18n( "Evolution" ) ); mMapCombo->insertItem( i18n( "Outlook" ) ); - connect( mMapCombo, SIGNAL( activated( int ) ), SLOT( mapChanged( int ) ) ); + connect( mMapCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( mapChanged( int ) ) ); - label = new QLabel( i18n( "RDN prefix attribute:" ), page ); + label = new TQLabel( i18n( "RDN prefix attribute:" ), page ); layout->addWidget( label, 1, 0 ); mRDNCombo = new KComboBox( page ); layout->addWidget( mRDNCombo, 1, 1 ); @@ -257,7 +257,7 @@ AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, mRDNCombo->insertItem( i18n( "UID" ) ); mRDNCombo->setCurrentItem( rdnprefix ); - QMap<QString, QString>::ConstIterator it; + TQMap<TQString, TQString>::ConstIterator it; int i, j = 0; for ( i = 2, it = attributes.begin(); it != attributes.end(); ++it, ++i ) { if ( mNameDict[ it.key() ] == 0 ) { @@ -269,7 +269,7 @@ AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, j = 2; } kdDebug(7125) << "itkey: " << it.key() << " i: " << i << endl; - label = new QLabel( *mNameDict[ it.key() ] + ":", page ); + label = new TQLabel( *mNameDict[ it.key() ] + ":", page ); KLineEdit *lineedit = new KLineEdit( page ); mLineEditDict.insert( it.key(), lineedit ); lineedit->setText( it.data() ); @@ -279,7 +279,7 @@ AttributesDialog::AttributesDialog( const QMap<QString, QString> &attributes, } for ( i = 1; i < mMapCombo->count(); i++ ) { - QDictIterator<KLineEdit> it2( mLineEditDict ); + TQDictIterator<KLineEdit> it2( mLineEditDict ); for ( ; it2.current(); ++it2 ) { if ( mMapList[ i ].contains( it2.currentKey() ) ) { if ( mMapList[ i ][ it2.currentKey() ] != it2.current()->text() ) break; @@ -300,11 +300,11 @@ AttributesDialog::~AttributesDialog() { } -QMap<QString, QString> AttributesDialog::attributes() const +TQMap<TQString, TQString> AttributesDialog::attributes() const { - QMap<QString, QString> map; + TQMap<TQString, TQString> map; - QDictIterator<KLineEdit> it( mLineEditDict ); + TQDictIterator<KLineEdit> it( mLineEditDict ); for ( ; it.current(); ++it ) map.insert( it.currentKey(), it.current()->text() ); @@ -320,7 +320,7 @@ void AttributesDialog::mapChanged( int pos ) { // apply first the default and than the spezific changes - QMap<QString, QString>::Iterator it; + TQMap<TQString, TQString>::Iterator it; for ( it = mDefaultMap.begin(); it != mDefaultMap.end(); ++it ) mLineEditDict[ it.key() ]->setText( it.data() ); @@ -333,33 +333,33 @@ void AttributesDialog::mapChanged( int pos ) } OfflineDialog::OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, - const QString &dst, QWidget *parent, const char *name ) + const TQString &dst, TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Offline Configuration" ), Ok | Cancel, Ok, parent, name, true, true ) { - QFrame *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page ); + TQFrame *page = plainPage(); + TQVBoxLayout *layout = new TQVBoxLayout( page ); layout->setAutoAdd( true ); mSrc = src; mDst = dst; - mCacheGroup = new QButtonGroup( 1, Qt::Horizontal, + mCacheGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Offline Cache Policy"), page ); - QRadioButton *bt; - new QRadioButton( i18n("Do not use offline cache"), mCacheGroup ); - bt = new QRadioButton( i18n("Use local copy if no connection"), mCacheGroup ); - new QRadioButton( i18n("Always use local copy"), mCacheGroup ); + TQRadioButton *bt; + new TQRadioButton( i18n("Do not use offline cache"), mCacheGroup ); + bt = new TQRadioButton( i18n("Use local copy if no connection"), mCacheGroup ); + new TQRadioButton( i18n("Always use local copy"), mCacheGroup ); mCacheGroup->setButton( cachePolicy ); - mAutoCache = new QCheckBox( i18n("Refresh offline cache automatically"), + mAutoCache = new TQCheckBox( i18n("Refresh offline cache automatically"), page ); mAutoCache->setChecked( autoCache ); mAutoCache->setEnabled( bt->isChecked() ); - connect( bt, SIGNAL(toggled(bool)), mAutoCache, SLOT(setEnabled(bool)) ); + connect( bt, TQT_SIGNAL(toggled(bool)), mAutoCache, TQT_SLOT(setEnabled(bool)) ); - QPushButton *lcache = new QPushButton( i18n("Load into Cache"), page ); - connect( lcache, SIGNAL( clicked() ), SLOT( loadCache() ) ); + TQPushButton *lcache = new TQPushButton( i18n("Load into Cache"), page ); + connect( lcache, TQT_SIGNAL( clicked() ), TQT_SLOT( loadCache() ) ); } OfflineDialog::~OfflineDialog() diff --git a/kabc/plugins/ldapkio/resourceldapkioconfig.h b/kabc/plugins/ldapkio/resourceldapkioconfig.h index c261cbd06..8bc6d081a 100644 --- a/kabc/plugins/ldapkio/resourceldapkioconfig.h +++ b/kabc/plugins/ldapkio/resourceldapkioconfig.h @@ -21,10 +21,10 @@ #ifndef RESOURCELDAPCONFIG_H #define RESOURCELDAPCONFIG_H -#include <qmap.h> -#include <qradiobutton.h> -#include <qcombobox.h> -#include <qdict.h> +#include <tqmap.h> +#include <tqradiobutton.h> +#include <tqcombobox.h> +#include <tqdict.h> #include <kdialogbase.h> #include <kresources/configwidget.h> @@ -47,7 +47,7 @@ class KABC_EXPORT ResourceLDAPKIOConfig : public KRES::ConfigWidget Q_OBJECT public: - ResourceLDAPKIOConfig( QWidget* parent = 0, const char* name = 0 ); + ResourceLDAPKIOConfig( TQWidget* parent = 0, const char* name = 0 ); public slots: void loadSettings( KRES::Resource* ); @@ -57,13 +57,13 @@ class KABC_EXPORT ResourceLDAPKIOConfig : public KRES::ConfigWidget void editAttributes(); void editCache(); private: - QPushButton *mEditButton, *mCacheButton; + TQPushButton *mEditButton, *mCacheButton; LdapConfigWidget *cfg; - QCheckBox *mSubTree; - QMap<QString, QString> mAttributes; + TQCheckBox *mSubTree; + TQMap<TQString, TQString> mAttributes; int mRDNPrefix, mCachePolicy; bool mAutoCache; - QString mCacheDst; + TQString mCacheDst; }; class AttributesDialog : public KDialogBase @@ -71,11 +71,11 @@ class AttributesDialog : public KDialogBase Q_OBJECT public: - AttributesDialog( const QMap<QString, QString> &attributes, int rdnprefix, - QWidget *parent, const char *name = 0 ); + AttributesDialog( const TQMap<TQString, TQString> &attributes, int rdnprefix, + TQWidget *parent, const char *name = 0 ); ~AttributesDialog(); - QMap<QString, QString> attributes() const; + TQMap<TQString, TQString> attributes() const; int rdnprefix() const; private slots: @@ -85,10 +85,10 @@ class AttributesDialog : public KDialogBase enum { UserMap, KolabMap, NetscapeMap, EvolutionMap, OutlookMap }; KComboBox *mMapCombo, *mRDNCombo; - QValueList< QMap<QString, QString> > mMapList; - QMap<QString, QString> mDefaultMap; - QDict<KLineEdit> mLineEditDict; - QDict<QString> mNameDict; + TQValueList< TQMap<TQString, TQString> > mMapList; + TQMap<TQString, TQString> mDefaultMap; + TQDict<KLineEdit> mLineEditDict; + TQDict<TQString> mNameDict; }; class OfflineDialog : public KDialogBase @@ -97,7 +97,7 @@ class OfflineDialog : public KDialogBase public: OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, - const QString &dst, QWidget *parent, const char *name = 0 ); + const TQString &dst, TQWidget *parent, const char *name = 0 ); ~OfflineDialog(); int cachePolicy() const; @@ -108,9 +108,9 @@ class OfflineDialog : public KDialogBase private: KURL mSrc; - QString mDst; - QButtonGroup *mCacheGroup; - QCheckBox *mAutoCache; + TQString mDst; + TQButtonGroup *mCacheGroup; + TQCheckBox *mAutoCache; }; } |