diff options
Diffstat (limited to 'kresources/slox/sloxaccounts.cpp')
-rw-r--r-- | kresources/slox/sloxaccounts.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kresources/slox/sloxaccounts.cpp b/kresources/slox/sloxaccounts.cpp index 35203b06f..a32df5fa2 100644 --- a/kresources/slox/sloxaccounts.cpp +++ b/kresources/slox/sloxaccounts.cpp @@ -33,9 +33,9 @@ #include <kstringhandler.h> #include <kconfig.h> -#include <qfile.h> -#include <qdom.h> -#include <qstring.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqstring.h> SloxAccounts::SloxAccounts( SloxBase *res, const KURL &baseUrl ) : mBaseUrl( baseUrl ), mRes( res ) @@ -44,9 +44,9 @@ SloxAccounts::SloxAccounts( SloxBase *res, const KURL &baseUrl ) mDownloadJob = 0; - QString server = mBaseUrl.host(); + TQString server = mBaseUrl.host(); - QStringList l = QStringList::split( '.', server ); + TQStringList l = TQStringList::split( '.', server ); if ( l.count() < 2 ) mDomain = server; else mDomain = l[ l.count() - 2 ] + "." + l[ l.count() - 1 ]; @@ -61,23 +61,23 @@ SloxAccounts::~SloxAccounts() if ( mDownloadJob ) mDownloadJob->kill(); } -void SloxAccounts::insertUser( const QString &id, const KABC::Addressee &a ) +void SloxAccounts::insertUser( const TQString &id, const KABC::Addressee &a ) { kdDebug() << "SloxAccount::insertUser() " << id << endl; mUsers.replace( id, a ); - QString email = a.preferredEmail(); + TQString email = a.preferredEmail(); - QString url = "http://" + mBaseUrl.host() + "/servlet/webdav.freebusy?username="; + TQString url = "http://" + mBaseUrl.host() + "/servlet/webdav.freebusy?username="; url += id + "&server=" + mDomain; KCal::FreeBusyUrlStore::self()->writeUrl( email, url ); } -KABC::Addressee SloxAccounts::lookupUser( const QString &id ) +KABC::Addressee SloxAccounts::lookupUser( const TQString &id ) { - QMap<QString, KABC::Addressee>::ConstIterator it; + TQMap<TQString, KABC::Addressee>::ConstIterator it; it = mUsers.find( id ); if ( it == mUsers.end() ) { requestAccounts(); @@ -87,11 +87,11 @@ KABC::Addressee SloxAccounts::lookupUser( const QString &id ) } } -QString SloxAccounts::lookupId( const QString &email ) +TQString SloxAccounts::lookupId( const TQString &email ) { kdDebug() << "SloxAccounts::lookupId() " << email << endl; - QMap<QString, KABC::Addressee>::ConstIterator it; + TQMap<TQString, KABC::Addressee>::ConstIterator it; for( it = mUsers.begin(); it != mUsers.end(); ++it ) { kdDebug() << "PREF: " << (*it).preferredEmail() << endl; kdDebug() << "KEY: " << it.key() << endl; @@ -126,9 +126,9 @@ void SloxAccounts::requestAccounts() KURL url = mBaseUrl; url.setPath( "/servlet/webdav.groupuser/" ); - QDomDocument doc; - QDomElement root = WebdavHandler::addDavElement( doc, doc, "propfind" ); - QDomElement prop = WebdavHandler::addDavElement( doc, root, "prop" ); + TQDomDocument doc; + TQDomElement root = WebdavHandler::addDavElement( doc, doc, "propfind" ); + TQDomElement prop = WebdavHandler::addDavElement( doc, root, "prop" ); WebdavHandler::addSloxElement( mRes, doc, prop, "user", "*" ); WebdavHandler::addSloxElement( mRes, doc, prop, "group", "*" ); WebdavHandler::addSloxElement( mRes, doc, prop, "resource", "*" ); @@ -139,8 +139,8 @@ void SloxAccounts::requestAccounts() mDownloadJob = KIO::davPropFind( url, doc, "0", false ); } - connect( mDownloadJob, SIGNAL( result( KIO::Job * ) ), - SLOT( slotResult( KIO::Job * ) ) ); + connect( mDownloadJob, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotResult( KIO::Job * ) ) ); } void SloxAccounts::slotResult( KIO::Job *job ) @@ -151,12 +151,12 @@ void SloxAccounts::slotResult( KIO::Job *job ) job->showErrorDialog( 0 ); } else { if ( mRes->resType() == "ox" ) { - QFile f( cacheFile() ); + TQFile f( cacheFile() ); if ( !f.open( IO_WriteOnly ) ) { kdWarning() << "Unable to open '" << cacheFile() << "'" << endl; return; } - QTextStream stream ( &f ); + TQTextStream stream ( &f ); stream << static_cast<KIO::DavJob*>( mDownloadJob )->response(); f.close(); } @@ -166,11 +166,11 @@ void SloxAccounts::slotResult( KIO::Job *job ) mDownloadJob = 0; } -QString SloxAccounts::cacheFile() const +TQString SloxAccounts::cacheFile() const { - QString host = mBaseUrl.host(); + TQString host = mBaseUrl.host(); - QString file = locateLocal( "cache", "slox/accounts_" + host ); + TQString file = locateLocal( "cache", "slox/accounts_" + host ); kdDebug() << "SloxAccounts::cacheFile(): " << file << endl; @@ -181,34 +181,34 @@ void SloxAccounts::readAccounts() { kdDebug() << "SloxAccounts::readAccounts()" << endl; - QFile f( cacheFile() ); + TQFile f( cacheFile() ); if ( !f.open( IO_ReadOnly ) ) { kdDebug() << "Unable to open '" << cacheFile() << "'" << endl; requestAccounts(); return; } - QDomDocument doc; + TQDomDocument doc; doc.setContent( &f ); // kdDebug() << "SLOX ACCOUNTS: " << doc.toString( 2 ) << endl; - QDomElement docElement = doc.documentElement(); + TQDomElement docElement = doc.documentElement(); mUsers.clear(); - QDomNodeList nodes = doc.elementsByTagName( mRes->resType() == "ox" ? "ox:user" : "user" ); + TQDomNodeList nodes = doc.elementsByTagName( mRes->resType() == "ox" ? "ox:user" : "user" ); for( uint i = 0; i < nodes.count(); ++i ) { - QDomElement element = nodes.item(i).toElement(); - QString id; + TQDomElement element = nodes.item(i).toElement(); + TQString id; KABC::Addressee a; - QDomNode n; + TQDomNode n; for( n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); - QString tag = e.tagName(); + TQDomElement e = n.toElement(); + TQString tag = e.tagName(); // remove XML namespace tag = tag.right( tag.length() - ( tag.find( ':' ) + 1 ) ); - QString value = e.text(); + TQString value = e.text(); if ( tag == "uid" ) id = value; else if ( tag == "mail" ) a.insertEmail( value, true ); else if ( tag == "forename" ) a.setGivenName( value ); |