diff options
Diffstat (limited to 'libkpimexchange/core')
-rw-r--r-- | libkpimexchange/core/exchangeaccount.cpp | 98 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeaccount.h | 60 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeclient.cpp | 96 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeclient.h | 56 | ||||
-rw-r--r-- | libkpimexchange/core/exchangedelete.cpp | 28 | ||||
-rw-r--r-- | libkpimexchange/core/exchangedelete.h | 14 | ||||
-rw-r--r-- | libkpimexchange/core/exchangedownload.cpp | 186 | ||||
-rw-r--r-- | libkpimexchange/core/exchangedownload.h | 38 | ||||
-rw-r--r-- | libkpimexchange/core/exchangemonitor.cpp | 118 | ||||
-rw-r--r-- | libkpimexchange/core/exchangemonitor.h | 32 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeprogress.cpp | 10 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeprogress.h | 2 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeupload.cpp | 86 | ||||
-rw-r--r-- | libkpimexchange/core/exchangeupload.h | 16 | ||||
-rw-r--r-- | libkpimexchange/core/utils.cpp | 20 | ||||
-rw-r--r-- | libkpimexchange/core/utils.h | 12 |
16 files changed, 436 insertions, 436 deletions
diff --git a/libkpimexchange/core/exchangeaccount.cpp b/libkpimexchange/core/exchangeaccount.cpp index 9142c9db3..858169ad8 100644 --- a/libkpimexchange/core/exchangeaccount.cpp +++ b/libkpimexchange/core/exchangeaccount.cpp @@ -20,13 +20,13 @@ Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextstream.h> -#include <qapplication.h> -#include <qdom.h> -#include <qwidgetlist.h> -#include <qwidget.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqapplication.h> +#include <tqdom.h> +#include <tqwidgetlist.h> +#include <tqwidget.h> +#include <tqfile.h> #include <kurl.h> #include <kapplication.h> @@ -47,10 +47,10 @@ using namespace KPIM; -ExchangeAccount::ExchangeAccount( const QString &host, const QString &port, - const QString &account, - const QString &password, - const QString &mailbox ) +ExchangeAccount::ExchangeAccount( const TQString &host, const TQString &port, + const TQString &account, + const TQString &password, + const TQString &mailbox ) : mError( false ) { KURL url( "webdav://" + host + "/exchange/" + account ); @@ -76,7 +76,7 @@ ExchangeAccount::ExchangeAccount( const QString &host, const QString &port, mCalendarURL = 0; } -ExchangeAccount::ExchangeAccount( const QString& group ) +ExchangeAccount::ExchangeAccount( const TQString& group ) { load( group ); } @@ -85,16 +85,16 @@ ExchangeAccount::~ExchangeAccount() { } -QString endecryptStr( const QString &aStr ) +TQString endecryptStr( const TQString &aStr ) { - QString result; + TQString result; for (uint i = 0; i < aStr.length(); i++) result += (aStr[i].unicode() < 0x20) ? aStr[i] : - QChar(0x1001F - aStr[i].unicode()); + TQChar(0x1001F - aStr[i].unicode()); return result; } -void ExchangeAccount::save( QString const &group ) +void ExchangeAccount::save( TQString const &group ) { kapp->config()->setGroup( group ); kapp->config()->writeEntry( "host", mHost ); @@ -104,32 +104,32 @@ void ExchangeAccount::save( QString const &group ) kapp->config()->sync(); } -void ExchangeAccount::load( QString const &group ) +void ExchangeAccount::load( TQString const &group ) { kapp->config()->setGroup( group ); - QString host = kapp->config()->readEntry( "host" ); + TQString host = kapp->config()->readEntry( "host" ); if ( ! host.isNull() ) { mHost = host; } else { mHost = "mail.company.com"; } - QString user = kapp->config()->readEntry( "user" ); + TQString user = kapp->config()->readEntry( "user" ); if ( ! user.isNull() ) { mAccount = user; } else { mAccount = "username"; } - QString mailbox = kapp->config()->readEntry( "mailbox" ); + TQString mailbox = kapp->config()->readEntry( "mailbox" ); if ( ! mailbox.isNull() ) { mMailbox = mailbox; } else { mMailbox = "webdav://" + host + "/exchange/" + mAccount; } - QString password = endecryptStr( kapp->config()->readEntry( "MS-ID" ) ); + TQString password = endecryptStr( kapp->config()->readEntry( "MS-ID" ) ); if ( ! password.isNull() ) { mPassword = password; } @@ -152,7 +152,7 @@ KURL ExchangeAccount::calendarURL() } } -bool ExchangeAccount::authenticate( QWidget *window ) +bool ExchangeAccount::authenticate( TQWidget *window ) { if ( window ) return authenticate( window->winId() ); @@ -163,7 +163,7 @@ bool ExchangeAccount::authenticate( QWidget *window ) bool ExchangeAccount::authenticate() { long windowId; - QWidgetList *widgets = QApplication::topLevelWidgets(); + TQWidgetList *widgets = TQApplication::topLevelWidgets(); if ( widgets->isEmpty() ) windowId = 0; else @@ -189,8 +189,8 @@ bool ExchangeAccount::authenticate( int windowId ) DCOPClient *dcopClient = new DCOPClient(); dcopClient->attach(); - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << info << windowId; dcopClient->send( "kded", "kpasswdserver", @@ -204,11 +204,11 @@ bool ExchangeAccount::authenticate( int windowId ) calcFolderURLs(); // TODO: Remove this busy loop - QApplication::setOverrideCursor( KCursor::waitCursor() ); + TQApplication::setOverrideCursor( KCursor::waitCursor() ); do { qApp->processEvents(); } while ( !mCalendarURL && !mError ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return !mError; } @@ -216,9 +216,9 @@ bool ExchangeAccount::authenticate( int windowId ) void ExchangeAccount::calcFolderURLs() { kdDebug() << "ExchangeAccount::calcFolderURLs" << endl; - QDomDocument doc; - QDomElement root = addElement( doc, doc, "DAV:", "propfind" ); - QDomElement prop = addElement( doc, root, "DAV:", "prop" ); + TQDomDocument doc; + TQDomElement root = addElement( doc, doc, "DAV:", "propfind" ); + TQDomElement prop = addElement( doc, root, "DAV:", "prop" ); addElement( doc, prop, "urn:schemas:httpmail:", "calendar" ); // For later use: // urn:schemas:httpmail:contacts Contacts @@ -239,8 +239,8 @@ void ExchangeAccount::calcFolderURLs() KIO::DavJob* job = KIO::davPropFind( baseURL(), doc, "1", false ); job->addMetaData( "errorPage", "false" ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotFolderResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotFolderResult( KIO::Job * ) ) ); } void ExchangeAccount::slotFolderResult( KIO::Job *job ) @@ -248,24 +248,24 @@ void ExchangeAccount::slotFolderResult( KIO::Job *job ) kdDebug() << "ExchangeAccount::slotFolderResult()" << endl; if ( job->error() ) { kdError() << "Error: Cannot get well-know folder names; " << job->error() << endl; - QString text = i18n("ExchangeAccount\nError accessing '%1': %2") + TQString text = i18n("ExchangeAccount\nError accessing '%1': %2") .arg( baseURL().prettyURL() ).arg( job->errorString() ); KMessageBox::error( 0, text ); mError = true; return; } - QDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); - QDomElement prop = response.documentElement().namedItem( "response" ) + TQDomElement prop = response.documentElement().namedItem( "response" ) .namedItem( "propstat" ).namedItem( "prop" ).toElement(); - QDomElement calElement = prop.namedItem( "calendar" ).toElement(); + TQDomElement calElement = prop.namedItem( "calendar" ).toElement(); if ( calElement.isNull() ) { kdError() << "Error: no calendar URL in Exchange server reply" << endl; mError = true; return; } - QString calendar = calElement.text(); + TQString calendar = calElement.text(); kdDebug() << "ExchangeAccount: response calendarURL: " << calendar << endl; @@ -273,14 +273,14 @@ void ExchangeAccount::slotFolderResult( KIO::Job *job ) kdDebug() << "Calendar URL: " << mCalendarURL->url() << endl; } -QString ExchangeAccount::tryFindMailbox( const QString& host, const QString& port, const QString& user, const QString& password ) +TQString ExchangeAccount::tryFindMailbox( const TQString& host, const TQString& port, const TQString& user, const TQString& password ) { kdDebug() << "Entering ExchangeAccount::tryFindMailbox()" << endl; KURL url("http://" + host + "/exchange"); if (!port.isEmpty()) url.setPort(port.toInt()); - QString result = tryMailbox( url.url(), user, password ); + TQString result = tryMailbox( url.url(), user, password ); if ( result.isNull() ) { url.setProtocol("https"); @@ -289,28 +289,28 @@ QString ExchangeAccount::tryFindMailbox( const QString& host, const QString& por return result; } -QString ExchangeAccount::tryMailbox( const QString &_url, const QString &user, - const QString &password ) +TQString ExchangeAccount::tryMailbox( const TQString &_url, const TQString &user, + const TQString &password ) { KURL url = KURL( _url ); url.setUser( user ); url.setPass( password ); - QString tmpFile; + TQString tmpFile; if ( !KIO::NetAccess::download( url, tmpFile, 0 ) ) { kdWarning() << "Trying to find mailbox failed: not able to download " << url.prettyURL() << endl; - return QString::null; + return TQString::null; } - QFile file( tmpFile ); + TQFile file( tmpFile ); if ( !file.open( IO_ReadOnly ) ) { kdWarning() << "Trying to find mailbox failed: not able to open temp file " << tmpFile << endl; KIO::NetAccess::removeTempFile( tmpFile ); - return QString::null; + return TQString::null; } - QTextStream stream( &file ); - QString line; - QString result; + TQTextStream stream( &file ); + TQString line; + TQString result; while ( !stream.eof() ) { line = stream.readLine(); // line of text excluding '\n' int pos = line.find( "<BASE href=\"", 0, FALSE ); @@ -321,7 +321,7 @@ QString ExchangeAccount::tryMailbox( const QString &_url, const QString &user, kdWarning() << "Strange, found no closing quote in " << line << endl; continue; } - QString mailboxString = line.mid( pos+12, end-pos-12 ); + TQString mailboxString = line.mid( pos+12, end-pos-12 ); KURL mailbox( mailboxString ); if ( mailbox.isEmpty() ) { kdWarning() << "Strange, could not get URL from " << mailboxString << " in line " << line << endl; diff --git a/libkpimexchange/core/exchangeaccount.h b/libkpimexchange/core/exchangeaccount.h index 505232c88..244fc944b 100644 --- a/libkpimexchange/core/exchangeaccount.h +++ b/libkpimexchange/core/exchangeaccount.h @@ -23,8 +23,8 @@ #ifndef EXCHANGE_ACCOUNT_H #define EXCHANGE_ACCOUNT_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <kdepimmacros.h> #include <kurl.h> @@ -36,58 +36,58 @@ class KDE_EXPORT ExchangeAccount : public QObject { Q_OBJECT public: - ExchangeAccount( const QString &host, const QString &port, - const QString &account, const QString &password, - const QString &mailbox = QString::null ); + ExchangeAccount( const TQString &host, const TQString &port, + const TQString &account, const TQString &password, + const TQString &mailbox = TQString::null ); /** Create a new account object, read data from group app data */ - ExchangeAccount( const QString &group ); + ExchangeAccount( const TQString &group ); ~ExchangeAccount(); - void save( QString const &group ); - void load( QString const &group ); + void save( TQString const &group ); + void load( TQString const &group ); - QString host() { return mHost; } - QString port() { return mPort; } - QString account() { return mAccount; } - QString mailbox() { return mMailbox; } - QString password() { return mPassword; } + TQString host() { return mHost; } + TQString port() { return mPort; } + TQString account() { return mAccount; } + TQString mailbox() { return mMailbox; } + TQString password() { return mPassword; } - void setHost( QString host ) { mHost = host; } - void setPort( QString port ) { mPort = port; } - void setAccount( QString account ) { mAccount = account; } - void setMailbox( QString mailbox ) { mMailbox = mailbox; } - void setPassword( QString password ) { mPassword = password; } + void setHost( TQString host ) { mHost = host; } + void setPort( TQString port ) { mPort = port; } + void setAccount( TQString account ) { mAccount = account; } + void setMailbox( TQString mailbox ) { mMailbox = mailbox; } + void setPassword( TQString password ) { mPassword = password; } KURL baseURL(); KURL calendarURL(); - // Returns the mailbox URL of this user. QString::null if unsuccessful - static QString tryFindMailbox( const QString &host, const QString &port, - const QString &user, - const QString &password ); + // Returns the mailbox URL of this user. TQString::null if unsuccessful + static TQString tryFindMailbox( const TQString &host, const TQString &port, + const TQString &user, + const TQString &password ); // Put authentication info in KDE password store for auto-authentication // with later webdav access. Also calculates the calendar URL. bool authenticate(); - bool authenticate( QWidget *window ); + bool authenticate( TQWidget *window ); private: bool authenticate( int windowId ); void calcFolderURLs(); - static QString tryMailbox( const QString &_url, const QString &user, - const QString &password ); + static TQString tryMailbox( const TQString &_url, const TQString &user, + const TQString &password ); private slots: void slotFolderResult( KIO::Job * ); private: - QString mHost; - QString mPort; - QString mAccount; - QString mMailbox; - QString mPassword; + TQString mHost; + TQString mPort; + TQString mAccount; + TQString mMailbox; + TQString mPassword; KURL *mCalendarURL; bool mError; diff --git a/libkpimexchange/core/exchangeclient.cpp b/libkpimexchange/core/exchangeclient.cpp index 337e540fd..3a1c46cc5 100644 --- a/libkpimexchange/core/exchangeclient.cpp +++ b/libkpimexchange/core/exchangeclient.cpp @@ -43,7 +43,7 @@ using namespace KPIM; ExchangeClient::ExchangeClient( ExchangeAccount *account, - const QString &timeZoneId ) + const TQString &timeZoneId ) : mWindow( 0 ), mTimeZoneId( timeZoneId ) { kdDebug() << "Creating ExchangeClient...\n"; @@ -58,22 +58,22 @@ ExchangeClient::~ExchangeClient() kdDebug() << "ExchangeClient destructor" << endl; } -void ExchangeClient::setWindow(QWidget *window) +void ExchangeClient::setWindow(TQWidget *window) { mWindow = window; } -QWidget *ExchangeClient::window() const +TQWidget *ExchangeClient::window() const { return mWindow; } -void ExchangeClient::setTimeZoneId( const QString& timeZoneId ) +void ExchangeClient::setTimeZoneId( const TQString& timeZoneId ) { mTimeZoneId = timeZoneId; } -QString ExchangeClient::timeZoneId() +TQString ExchangeClient::timeZoneId() { return mTimeZoneId; } @@ -93,11 +93,11 @@ void ExchangeClient::test() bool result = resource->open(); kdDebug() << "Result: " << result << endl; - resource->subscribeEvents( QDate( 2002, 12, 18 ), QDate( 2002, 12, 19 ) ); + resource->subscribeEvents( TQDate( 2002, 12, 18 ), TQDate( 2002, 12, 19 ) ); */ // mAccount->tryFindMailbox(); /* - QString query = + TQString query = "<propfind xmlns=\"DAV:\" xmlns:h=\"urn:schemas:httpmail:\">\r\n" " <allprop/>\r\n" "</propfind>\r\n"; @@ -113,13 +113,13 @@ void ExchangeClient::test2() kdDebug() << "Entering test2()" << endl; } /* -ExchangeMonitor* ExchangeClient::monitor( int pollMode, const QHostAddress& ownInterface ) +ExchangeMonitor* ExchangeClient::monitor( int pollMode, const TQHostAddress& ownInterface ) { return new ExchangeMonitor( mAccount, pollMode, ownInterface ); } */ -void ExchangeClient::download( KCal::Calendar *calendar, const QDate &start, - const QDate &end, bool showProgress ) +void ExchangeClient::download( KCal::Calendar *calendar, const TQDate &start, + const TQDate &end, bool showProgress ) { kdDebug() << "ExchangeClient::download1()" << endl; @@ -131,12 +131,12 @@ void ExchangeClient::download( KCal::Calendar *calendar, const QDate &start, ExchangeDownload *worker = new ExchangeDownload( mAccount, mWindow ); worker->download( calendar, start, end, showProgress ); connect( worker, - SIGNAL( finished( ExchangeDownload *, int, const QString & ) ), - SLOT( slotDownloadFinished( ExchangeDownload *, int, - const QString & ) ) ); + TQT_SIGNAL( finished( ExchangeDownload *, int, const TQString & ) ), + TQT_SLOT( slotDownloadFinished( ExchangeDownload *, int, + const TQString & ) ) ); } -void ExchangeClient::download( const QDate &start, const QDate &end, +void ExchangeClient::download( const TQDate &start, const TQDate &end, bool showProgress ) { kdDebug() << "ExchangeClient::download2()" << endl; @@ -149,11 +149,11 @@ void ExchangeClient::download( const QDate &start, const QDate &end, ExchangeDownload *worker = new ExchangeDownload( mAccount, mWindow ); worker->download( start, end, showProgress ); connect( worker, - SIGNAL( finished( ExchangeDownload *, int, const QString & ) ), - SLOT( slotDownloadFinished( ExchangeDownload *, int, - const QString & ) ) ); - connect( worker, SIGNAL( gotEvent( KCal::Event *, const KURL & ) ), - SIGNAL( event( KCal::Event *, const KURL & ) ) ); + TQT_SIGNAL( finished( ExchangeDownload *, int, const TQString & ) ), + TQT_SLOT( slotDownloadFinished( ExchangeDownload *, int, + const TQString & ) ) ); + connect( worker, TQT_SIGNAL( gotEvent( KCal::Event *, const KURL & ) ), + TQT_SIGNAL( event( KCal::Event *, const KURL & ) ) ); } void ExchangeClient::upload( KCal::Event *event ) @@ -167,8 +167,8 @@ void ExchangeClient::upload( KCal::Event *event ) ExchangeUpload *worker = new ExchangeUpload( event, mAccount, mTimeZoneId, mWindow ); - connect( worker, SIGNAL( finished( ExchangeUpload *, int, const QString & ) ), - SLOT( slotUploadFinished( ExchangeUpload *, int, const QString & ) ) ); + connect( worker, TQT_SIGNAL( finished( ExchangeUpload *, int, const TQString & ) ), + TQT_SLOT( slotUploadFinished( ExchangeUpload *, int, const TQString & ) ) ); } void ExchangeClient::remove( KCal::Event *event ) @@ -179,31 +179,31 @@ void ExchangeClient::remove( KCal::Event *event ) } ExchangeDelete *worker = new ExchangeDelete( event, mAccount, mWindow ); - connect( worker, SIGNAL( finished( ExchangeDelete *, int, const QString & ) ), - SLOT( slotRemoveFinished( ExchangeDelete *, int, const QString & ) ) ); + connect( worker, TQT_SIGNAL( finished( ExchangeDelete *, int, const TQString & ) ), + TQT_SLOT( slotRemoveFinished( ExchangeDelete *, int, const TQString & ) ) ); } void ExchangeClient::slotDownloadFinished( ExchangeDownload *worker, - int result, const QString &moreInfo ) + int result, const TQString &moreInfo ) { emit downloadFinished( result, moreInfo ); worker->deleteLater(); } -void ExchangeClient::slotDownloadFinished( ExchangeDownload* worker, int result, const QString& moreInfo, QPtrList<KCal::Event>& events ) +void ExchangeClient::slotDownloadFinished( ExchangeDownload* worker, int result, const TQString& moreInfo, TQPtrList<KCal::Event>& events ) { emit downloadFinished( result, moreInfo, events ); worker->deleteLater(); } -void ExchangeClient::slotUploadFinished( ExchangeUpload* worker, int result, const QString& moreInfo ) +void ExchangeClient::slotUploadFinished( ExchangeUpload* worker, int result, const TQString& moreInfo ) { kdDebug() << "ExchangeClient::slotUploadFinished()" << endl; emit uploadFinished( result, moreInfo ); worker->deleteLater(); } -void ExchangeClient::slotRemoveFinished( ExchangeDelete* worker, int result, const QString& moreInfo ) +void ExchangeClient::slotRemoveFinished( ExchangeDelete* worker, int result, const TQString& moreInfo ) { kdDebug() << "ExchangeClient::slotRemoveFinished()" << endl; emit removeFinished( result, moreInfo ); @@ -211,27 +211,27 @@ void ExchangeClient::slotRemoveFinished( ExchangeDelete* worker, int result, con } int ExchangeClient::downloadSynchronous( KCal::Calendar *calendar, - const QDate &start, const QDate &end, + const TQDate &start, const TQDate &end, bool showProgress ) { kdDebug() << "ExchangeClient::downloadSynchronous()" << endl; mClientState = WaitingForResult; - connect( this, SIGNAL( downloadFinished( int, const QString & ) ), - SLOT( slotSyncFinished( int, const QString & ) ) ); + connect( this, TQT_SIGNAL( downloadFinished( int, const TQString & ) ), + TQT_SLOT( slotSyncFinished( int, const TQString & ) ) ); download( calendar, start, end, showProgress ); // TODO: Remove this busy loop - QApplication::setOverrideCursor + TQApplication::setOverrideCursor ( KCursor::waitCursor() ); do { qApp->processEvents(); } while ( mClientState == WaitingForResult ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - disconnect( this, SIGNAL( downloadFinished( int, const QString & ) ), - this, SLOT( slotSyncFinished( int, const QString & ) ) ); + disconnect( this, TQT_SIGNAL( downloadFinished( int, const TQString & ) ), + this, TQT_SLOT( slotSyncFinished( int, const TQString & ) ) ); return mSyncResult; } @@ -239,42 +239,42 @@ int ExchangeClient::downloadSynchronous( KCal::Calendar *calendar, int ExchangeClient::uploadSynchronous( KCal::Event* event ) { mClientState = WaitingForResult; - connect( this, SIGNAL( uploadFinished( int, const QString & ) ), - SLOT( slotSyncFinished( int, const QString & ) ) ); + connect( this, TQT_SIGNAL( uploadFinished( int, const TQString & ) ), + TQT_SLOT( slotSyncFinished( int, const TQString & ) ) ); upload( event ); // TODO: Remove this busy loop - QApplication::setOverrideCursor( KCursor::waitCursor() ); + TQApplication::setOverrideCursor( KCursor::waitCursor() ); do { qApp->processEvents(); } while ( mClientState == WaitingForResult ); - QApplication::restoreOverrideCursor(); - disconnect( this, SIGNAL( uploadFinished( int, const QString & ) ), - this, SLOT( slotSyncFinished( int, const QString & ) ) ); + TQApplication::restoreOverrideCursor(); + disconnect( this, TQT_SIGNAL( uploadFinished( int, const TQString & ) ), + this, TQT_SLOT( slotSyncFinished( int, const TQString & ) ) ); return mSyncResult; } int ExchangeClient::removeSynchronous( KCal::Event* event ) { mClientState = WaitingForResult; - connect( this, SIGNAL( removeFinished( int, const QString & ) ), - SLOT( slotSyncFinished( int, const QString & ) ) ); + connect( this, TQT_SIGNAL( removeFinished( int, const TQString & ) ), + TQT_SLOT( slotSyncFinished( int, const TQString & ) ) ); remove( event ); // TODO: Remove this busy loop - QApplication::setOverrideCursor( KCursor::waitCursor() ); + TQApplication::setOverrideCursor( KCursor::waitCursor() ); do { qApp->processEvents(); } while ( mClientState == WaitingForResult ); - QApplication::restoreOverrideCursor(); - disconnect( this, SIGNAL( removeFinished( int, const QString & ) ), - this, SLOT( slotSyncFinished( int, const QString & ) ) ); + TQApplication::restoreOverrideCursor(); + disconnect( this, TQT_SIGNAL( removeFinished( int, const TQString & ) ), + this, TQT_SLOT( slotSyncFinished( int, const TQString & ) ) ); return mSyncResult; } -void ExchangeClient::slotSyncFinished( int result, const QString &moreInfo ) +void ExchangeClient::slotSyncFinished( int result, const TQString &moreInfo ) { kdDebug() << "Exchangeclient::slotSyncFinished("<<result<<","<<moreInfo<<")" << endl; if ( mClientState == WaitingForResult ) { @@ -284,7 +284,7 @@ void ExchangeClient::slotSyncFinished( int result, const QString &moreInfo ) } } -QString ExchangeClient::detailedErrorString() +TQString ExchangeClient::detailedErrorString() { return mDetailedErrorString; } diff --git a/libkpimexchange/core/exchangeclient.h b/libkpimexchange/core/exchangeclient.h index b887dac50..2a1e6b508 100644 --- a/libkpimexchange/core/exchangeclient.h +++ b/libkpimexchange/core/exchangeclient.h @@ -20,11 +20,11 @@ #ifndef KDEPIM_EXCHANGE_CLIENT_H #define KDEPIM_EXCHANGE_CLIENT_H -#include <qstring.h> -#include <qdatetime.h> -#include <qobject.h> -#include <qhostaddress.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqobject.h> +#include <tqhostaddress.h> +#include <tqptrlist.h> #include <kdepimmacros.h> @@ -45,27 +45,27 @@ class ExchangeUpload; class ExchangeDelete; //class ExchangeMonitor; -class KDE_EXPORT ExchangeClient : public QObject { +class KDE_EXPORT ExchangeClient : public TQObject { Q_OBJECT public: - ExchangeClient( ExchangeAccount* account, const QString& mTimeZoneId=QString::null ); + ExchangeClient( ExchangeAccount* account, const TQString& mTimeZoneId=TQString::null ); ~ExchangeClient(); /** * Associate this client with a window given by @p window. */ - void setWindow(QWidget *window); + void setWindow(TQWidget *window); /** * Returns the window this client is associated with. */ - QWidget *window() const; + TQWidget *window() const; /** * Set the time zone to use */ - void setTimeZoneId( const QString& timeZoneId ); - QString timeZoneId(); + void setTimeZoneId( const TQString& timeZoneId ); + TQString timeZoneId(); // synchronous functions enum { @@ -80,29 +80,29 @@ class KDE_EXPORT ExchangeClient : public QObject { DeleteUnknownEventError /** The event to be deleted does not exist on the server */ }; - int downloadSynchronous( KCal::Calendar* calendar, const QDate& start, const QDate& end, bool showProgress=false); + int downloadSynchronous( KCal::Calendar* calendar, const TQDate& start, const TQDate& end, bool showProgress=false); int uploadSynchronous( KCal::Event* event ); int removeSynchronous( KCal::Event* event ); - // ExchangeMonitor* monitor( int pollMode, const QHostAddress& ownInterface ); + // ExchangeMonitor* monitor( int pollMode, const TQHostAddress& ownInterface ); - QString detailedErrorString(); + TQString detailedErrorString(); public slots: // Asynchronous functions, wait for "finished" signals for result // Deprecated: use download() without the Calendar* argument instead - void download( KCal::Calendar* calendar, const QDate& start, const QDate& end, bool showProgress=false); - void download( const QDate& start, const QDate& end, bool showProgress=false); + void download( KCal::Calendar* calendar, const TQDate& start, const TQDate& end, bool showProgress=false); + void download( const TQDate& start, const TQDate& end, bool showProgress=false); void upload( KCal::Event* event ); void remove( KCal::Event* event ); void test(); private slots: - void slotDownloadFinished( ExchangeDownload* worker, int result, const QString& moreInfo ); - void slotDownloadFinished( ExchangeDownload* worker, int result, const QString& moreInfo, QPtrList<KCal::Event>& ); - void slotUploadFinished( ExchangeUpload* worker, int result, const QString& moreInfo ); - void slotRemoveFinished( ExchangeDelete* worker, int result, const QString& moreInfo ); - void slotSyncFinished( int result, const QString& moreInfo ); + void slotDownloadFinished( ExchangeDownload* worker, int result, const TQString& moreInfo ); + void slotDownloadFinished( ExchangeDownload* worker, int result, const TQString& moreInfo, TQPtrList<KCal::Event>& ); + void slotUploadFinished( ExchangeUpload* worker, int result, const TQString& moreInfo ); + void slotRemoveFinished( ExchangeDelete* worker, int result, const TQString& moreInfo ); + void slotSyncFinished( int result, const TQString& moreInfo ); signals: // Useful for progress dialogs, shows how much still needs to be done. @@ -110,11 +110,11 @@ class KDE_EXPORT ExchangeClient : public QObject { void startDownload(); void finishDownload(); - void downloadFinished( int result, const QString& moreInfo ); + void downloadFinished( int result, const TQString& moreInfo ); void event( KCal::Event* event, const KURL& url); - void downloadFinished( int result, const QString& moreInfo, QPtrList<KCal::Event>& events ); - void uploadFinished( int result, const QString& moreInfo ); - void removeFinished( int result, const QString& moreInfo ); + void downloadFinished( int result, const TQString& moreInfo, TQPtrList<KCal::Event>& events ); + void uploadFinished( int result, const TQString& moreInfo ); + void removeFinished( int result, const TQString& moreInfo ); private: void test2(); @@ -123,10 +123,10 @@ class KDE_EXPORT ExchangeClient : public QObject { int mClientState; int mSyncResult; - QString mDetailedErrorString; - QWidget* mWindow; + TQString mDetailedErrorString; + TQWidget* mWindow; ExchangeAccount* mAccount; - QString mTimeZoneId; + TQString mTimeZoneId; }; } diff --git a/libkpimexchange/core/exchangedelete.cpp b/libkpimexchange/core/exchangedelete.cpp index 8495afa36..f88b22efd 100644 --- a/libkpimexchange/core/exchangedelete.cpp +++ b/libkpimexchange/core/exchangedelete.cpp @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqregexp.h> #include <kurl.h> #include <kdebug.h> @@ -48,7 +48,7 @@ using namespace KPIM; // recurrent appointments? Maybe, so we just look for Master or Single // instancetypes -ExchangeDelete::ExchangeDelete( KCal::Event* event, ExchangeAccount* account, QWidget* window ) : +ExchangeDelete::ExchangeDelete( KCal::Event* event, ExchangeAccount* account, TQWidget* window ) : mWindow( window ) { kdDebug() << "Created ExchangeDelete" << endl; @@ -63,9 +63,9 @@ ExchangeDelete::~ExchangeDelete() kdDebug() << "ExchangeDelete destructor" << endl; } -void ExchangeDelete::findUidSingleMaster( QString const& uid ) +void ExchangeDelete::findUidSingleMaster( TQString const& uid ) { - QString query = + TQString query = "SELECT \"DAV:href\", \"urn:schemas:calendar:uid\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" "WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n" @@ -74,27 +74,27 @@ void ExchangeDelete::findUidSingleMaster( QString const& uid ) KIO::DavJob* job = KIO::davSearch( mAccount->calendarURL(), "DAV:", "sql", query, false ); job->setWindow( mWindow ); - connect(job, SIGNAL(result( KIO::Job * )), this, SLOT(slotFindUidResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(slotFindUidResult(KIO::Job *))); } void ExchangeDelete::slotFindUidResult( KIO::Job * job ) { if ( job->error() ) { job->showErrorDialog( 0L ); - emit finished( this, ExchangeClient::CommunicationError, "IO Error: " + QString::number(job->error()) + ":" + job->errorString() ); + emit finished( this, ExchangeClient::CommunicationError, "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } - QDomDocument& response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument& response = static_cast<KIO::DavJob *>( job )->response(); - QDomElement item = response.documentElement().firstChild().toElement(); - QDomElement hrefElement = item.namedItem( "href" ).toElement(); + TQDomElement item = response.documentElement().firstChild().toElement(); + TQDomElement hrefElement = item.namedItem( "href" ).toElement(); if ( item.isNull() || hrefElement.isNull() ) { // Not found emit finished( this, ExchangeClient::DeleteUnknownEventError, "UID of event to be deleted not found on server\n"+response.toString() ); return; } // Found the appointment's URL - QString href = hrefElement.text(); + TQString href = hrefElement.text(); KURL url(href); startDelete( toDAV( url ) ); @@ -104,7 +104,7 @@ void ExchangeDelete::startDelete( const KURL& url ) { KIO::SimpleJob* job = KIO::file_delete( url, false ); // no GUI job->setWindow( mWindow ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotDeleteResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotDeleteResult( KIO::Job * ) ) ); } void ExchangeDelete::slotDeleteResult( KIO::Job* job ) @@ -112,10 +112,10 @@ void ExchangeDelete::slotDeleteResult( KIO::Job* job ) kdDebug() << "Finished Delete" << endl; if ( job->error() ) { job->showErrorDialog( 0L ); - emit finished( this, ExchangeClient::CommunicationError, "IO Error: " + QString::number(job->error()) + ":" + job->errorString() ); + emit finished( this, ExchangeClient::CommunicationError, "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } - emit finished( this, ExchangeClient::ResultOK, QString::null ); + emit finished( this, ExchangeClient::ResultOK, TQString::null ); } #include "exchangedelete.moc" diff --git a/libkpimexchange/core/exchangedelete.h b/libkpimexchange/core/exchangedelete.h index a9d933254..fb91b9122 100644 --- a/libkpimexchange/core/exchangedelete.h +++ b/libkpimexchange/core/exchangedelete.h @@ -20,8 +20,8 @@ #ifndef KDEPIM_EXCHANGE_DELETE_H #define KDEPIM_EXCHANGE_DELETE_H -#include <qstring.h> -#include <qwidget.h> +#include <tqstring.h> +#include <tqwidget.h> #include <kio/job.h> #include <kdepimmacros.h> @@ -33,10 +33,10 @@ namespace KPIM { class ExchangeAccount; -class KDE_EXPORT ExchangeDelete : public QObject { +class KDE_EXPORT ExchangeDelete : public TQObject { Q_OBJECT public: - ExchangeDelete( KCal::Event* event, ExchangeAccount* account, QWidget* window=0 ); + ExchangeDelete( KCal::Event* event, ExchangeAccount* account, TQWidget* window=0 ); ~ExchangeDelete(); private slots: @@ -44,14 +44,14 @@ class KDE_EXPORT ExchangeDelete : public QObject { void slotFindUidResult( KIO::Job * ); signals: - void finished( ExchangeDelete* worker, int result, const QString& moreInfo ); + void finished( ExchangeDelete* worker, int result, const TQString& moreInfo ); private: - void findUidSingleMaster( QString const& uid ); + void findUidSingleMaster( TQString const& uid ); void startDelete( const KURL& url ); ExchangeAccount* mAccount; - QWidget* mWindow; + TQWidget* mWindow; }; } diff --git a/libkpimexchange/core/exchangedownload.cpp b/libkpimexchange/core/exchangedownload.cpp index dcf469549..c8a0a2150 100644 --- a/libkpimexchange/core/exchangedownload.cpp +++ b/libkpimexchange/core/exchangedownload.cpp @@ -18,11 +18,11 @@ Boston, MA 02110-1301, USA. */ -#include <qfile.h> -#include <qtextstream.h> -#include <qdatastream.h> -#include <qcstring.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqdatastream.h> +#include <tqcstring.h> +#include <tqregexp.h> #include <kapplication.h> #include <kconfig.h> @@ -61,7 +61,7 @@ extern "C" { using namespace KPIM; -ExchangeDownload::ExchangeDownload( ExchangeAccount *account, QWidget *window ) +ExchangeDownload::ExchangeDownload( ExchangeAccount *account, TQWidget *window ) : mWindow( window ) { kdDebug() << "ExchangeDownload()" << endl; @@ -80,8 +80,8 @@ ExchangeDownload::~ExchangeDownload() if ( mEvents ) delete mEvents; } -void ExchangeDownload::download( KCal::Calendar *calendar, const QDate &start, - const QDate &end, bool showProgress ) +void ExchangeDownload::download( KCal::Calendar *calendar, const TQDate &start, + const TQDate &end, bool showProgress ) { mCalendar = calendar; mEvents = 0; @@ -92,14 +92,14 @@ void ExchangeDownload::download( KCal::Calendar *calendar, const QDate &start, mProgress = new ExchangeProgress(); mProgress->show(); - connect( this, SIGNAL( startDownload() ), mProgress, - SLOT( slotTransferStarted() ) ); - connect( this, SIGNAL(finishDownload() ), mProgress, - SLOT( slotTransferFinished() ) ); + connect( this, TQT_SIGNAL( startDownload() ), mProgress, + TQT_SLOT( slotTransferStarted() ) ); + connect( this, TQT_SIGNAL(finishDownload() ), mProgress, + TQT_SLOT( slotTransferFinished() ) ); #endif } - QString sql = dateSelectQuery( start, end.addDays( 1 ) ); + TQString sql = dateSelectQuery( start, end.addDays( 1 ) ); kdDebug() << "Exchange download query: " << endl << sql << endl; @@ -112,43 +112,43 @@ void ExchangeDownload::download( KCal::Calendar *calendar, const QDate &start, sql, false ); KIO::Scheduler::scheduleJob( job ); job->setWindow( mWindow ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotSearchResult( KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotSearchResult( KIO::Job *) ) ); } -void ExchangeDownload::download( const QDate& start, const QDate& end, bool showProgress ) +void ExchangeDownload::download( const TQDate& start, const TQDate& end, bool showProgress ) { mCalendar = 0; - mEvents = new QPtrList<KCal::Event>; + mEvents = new TQPtrList<KCal::Event>; if( showProgress ) { //kdDebug() << "Creating progress dialog" << endl; mProgress = new ExchangeProgress(); mProgress->show(); - connect( this, SIGNAL(startDownload()), mProgress, SLOT(slotTransferStarted()) ); - connect( this, SIGNAL(finishDownload()), mProgress, SLOT(slotTransferFinished()) ); + connect( this, TQT_SIGNAL(startDownload()), mProgress, TQT_SLOT(slotTransferStarted()) ); + connect( this, TQT_SIGNAL(finishDownload()), mProgress, TQT_SLOT(slotTransferFinished()) ); } - QString sql = dateSelectQuery( start, end.addDays( 1 ) ); + TQString sql = dateSelectQuery( start, end.addDays( 1 ) ); increaseDownloads(); KIO::DavJob *job = KIO::davSearch( mAccount->calendarURL(), "DAV:", "sql", sql, false ); KIO::Scheduler::scheduleJob(job); job->setWindow( mWindow ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotSearchResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotSearchResult( KIO::Job * ) ) ); } // Original query TODO: make query configurable -QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end ) +TQString ExchangeDownload::dateSelectQuery( const TQDate& start, const TQDate& end ) { - QString startString; + TQString startString; startString.sprintf("%04i/%02i/%02i",start.year(),start.month(),start.day()); - QString endString; + TQString endString; endString.sprintf("%04i/%02i/%02i",end.year(),end.month(),end.day()); - QString sql = + TQString sql = "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", \"urn:schemas:calendar:uid\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" "WHERE \"urn:schemas:calendar:dtend\" > '" + startString + "'\r\n" @@ -158,15 +158,15 @@ QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end #if 0 // That's the "new" code that breaks with Exchange. It was meant for Opengroupware, but that got its own resource anyway -QString ExchangeDownload::dateSelectQuery( const QDate& start, const QDate& end ) +TQString ExchangeDownload::dateSelectQuery( const TQDate& start, const TQDate& end ) { - QString startString; + TQString startString; startString.sprintf( "%04i-%02i-%02iT00:00:00Z", start.year(), start.month(), start.day() ); - QString endString; + TQString endString; endString.sprintf( "%04i-%02i-%02iT23:59:59Z", end.year(), end.month(), end.day() ); - QString sql = + TQString sql = "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", " "\"urn:schemas:calendar:uid\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" @@ -181,14 +181,14 @@ void ExchangeDownload::slotSearchResult( KIO::Job *job ) if ( job->error() ) { kdError() << "ExchangeDownload::slotSearchResult() error: " << job->error() << endl; - QString text = i18n("ExchangeDownload\nError accessing '%1': %2") + TQString text = i18n("ExchangeDownload\nError accessing '%1': %2") .arg( mAccount->calendarURL().prettyURL() ) .arg( job->errorString() ); KMessageBox::error( 0, text ); finishUp( ExchangeClient::CommunicationError, job ); return; } - QDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "Search result: " << endl << response.toString() << endl; @@ -205,7 +205,7 @@ void ExchangeDownload::slotMasterResult( KIO::Job *job ) finishUp( ExchangeClient::CommunicationError, job ); return; } - QDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "Search (master) result: " << endl << response.toString() << endl; @@ -214,7 +214,7 @@ void ExchangeDownload::slotMasterResult( KIO::Job *job ) decreaseDownloads(); } -void ExchangeDownload::handleAppointments( const QDomDocument &response, +void ExchangeDownload::handleAppointments( const TQDomDocument &response, bool recurrence ) { kdDebug() << "Entering handleAppointments" << endl; @@ -226,21 +226,21 @@ void ExchangeDownload::handleAppointments( const QDomDocument &response, return; } - for( QDomElement item = response.documentElement().firstChild().toElement(); + for( TQDomElement item = response.documentElement().firstChild().toElement(); !item.isNull(); item = item.nextSibling().toElement() ) { //kdDebug() << "Current item:" << item.tagName() << endl; - QDomNodeList propstats = item.elementsByTagNameNS( "DAV:", "propstat" ); + TQDomNodeList propstats = item.elementsByTagNameNS( "DAV:", "propstat" ); // kdDebug() << "Item has " << propstats.count() << " propstat children" << endl; for( uint i=0; i < propstats.count(); i++ ) { - QDomElement propstat = propstats.item(i).toElement(); - QDomElement prop = propstat.namedItem( "prop" ).toElement(); + TQDomElement propstat = propstats.item(i).toElement(); + TQDomElement prop = propstat.namedItem( "prop" ).toElement(); if ( prop.isNull() ) { kdError() << "Error: no <prop> in response" << endl; continue; } - QDomElement instancetypeElement = prop.namedItem( "instancetype" ).toElement(); + TQDomElement instancetypeElement = prop.namedItem( "instancetype" ).toElement(); if ( instancetypeElement.isNull() ) { kdError() << "Error: no instance type in Exchange server reply" << endl; continue; @@ -249,12 +249,12 @@ void ExchangeDownload::handleAppointments( const QDomDocument &response, //kdDebug() << "Instance type: " << instanceType << endl; if ( recurrence && instanceType > 0 ) { - QDomElement uidElement = prop.namedItem( "uid" ).toElement(); + TQDomElement uidElement = prop.namedItem( "uid" ).toElement(); if ( uidElement.isNull() ) { kdError() << "Error: no uid in Exchange server reply" << endl; continue; } - QString uid = uidElement.text(); + TQString uid = uidElement.text(); if ( ! m_uids.contains( uid ) ) { m_uids[uid] = 1; handleRecurrence(uid); @@ -263,12 +263,12 @@ void ExchangeDownload::handleAppointments( const QDomDocument &response, continue; } - QDomElement hrefElement = prop.namedItem( "href" ).toElement(); + TQDomElement hrefElement = prop.namedItem( "href" ).toElement(); if ( hrefElement.isNull() ) { kdError() << "Error: no href in Exchange server reply" << endl; continue; } - QString href = hrefElement.text(); + TQString href = hrefElement.text(); KURL url(href); kdDebug() << "Getting appointment from url: " << url.prettyURL() << endl; @@ -283,10 +283,10 @@ void ExchangeDownload::handleAppointments( const QDomDocument &response, } } -void ExchangeDownload::handleRecurrence( QString uid ) +void ExchangeDownload::handleRecurrence( TQString uid ) { // kdDebug() << "Handling recurrence info for uid=" << uid << endl; - QString query = + TQString query = "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" "WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n" @@ -301,15 +301,15 @@ void ExchangeDownload::handleRecurrence( QString uid ) query, false ); KIO::Scheduler::scheduleJob( job ); job->setWindow( mWindow ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotMasterResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotMasterResult( KIO::Job * ) ) ); } void ExchangeDownload::readAppointment( const KURL& url ) { - QDomDocument doc; - QDomElement root = addElement( doc, doc, "DAV:", "propfind" ); - QDomElement prop = addElement( doc, root, "DAV:", "prop" ); + TQDomDocument doc; + TQDomElement root = addElement( doc, doc, "DAV:", "propfind" ); + TQDomElement prop = addElement( doc, root, "DAV:", "prop" ); addElement( doc, prop, "urn:schemas:calendar:", "uid" ); addElement( doc, prop, "urn:schemas:calendar:", "timezoneid" ); addElement( doc, prop, "urn:schemas:calendar:", "timezone" ); @@ -349,8 +349,8 @@ void ExchangeDownload::readAppointment( const KURL& url ) KIO::Scheduler::scheduleJob( job ); job->setWindow( mWindow ); job->addMetaData( "errorPage", "false" ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotPropFindResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotPropFindResult( KIO::Job * ) ) ); } void ExchangeDownload::slotPropFindResult( KIO::Job *job ) @@ -364,16 +364,16 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) return; } - QDomDocument response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "Response: " << endl; kdDebug() << response.toString() << endl; - QDomElement prop = response.documentElement().namedItem( "response" ) + TQDomElement prop = response.documentElement().namedItem( "response" ) .namedItem( "propstat" ).namedItem( "prop" ).toElement(); KCal::Event* event = new KCal::Event(); - QDomElement uidElement = prop.namedItem( "uid" ).toElement(); + TQDomElement uidElement = prop.namedItem( "uid" ).toElement(); if ( uidElement.isNull() ) { kdError() << "Error: no uid in Exchange server reply" << endl; finishUp( ExchangeClient::IllegalAppointmentError, @@ -383,14 +383,14 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) event->setUid( uidElement.text() ); // kdDebug() << "Got UID: " << uidElement.text() << endl; - QString timezoneid = prop.namedItem( "timezoneid" ).toElement().text(); + TQString timezoneid = prop.namedItem( "timezoneid" ).toElement().text(); // kdDebug() << "DEBUG: timezoneid = " << timezoneid << endl; - QString timezone = prop.namedItem( "timezone" ).toElement().text(); + TQString timezone = prop.namedItem( "timezone" ).toElement().text(); // kdDebug() << "DEBUG: timezone = " << timezone << endl; // mFormat is used for parsing recurrence rules. - QString localTimeZoneId; + TQString localTimeZoneId; if ( mCalendar ) { mFormat->setTimeZone( mCalendar->timeZoneId(), !mCalendar->isLocalTime() ); localTimeZoneId = mCalendar->timeZoneId(); @@ -399,65 +399,65 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) // If no mCalendar, stay in UTC } - QString lastModified = prop.namedItem( "lastmodified" ).toElement().text(); + TQString lastModified = prop.namedItem( "lastmodified" ).toElement().text(); if ( !lastModified.isEmpty() ) { - QDateTime dt = utcAsZone( QDateTime::fromString( lastModified, Qt::ISODate ), localTimeZoneId ); + TQDateTime dt = utcAsZone( TQDateTime::fromString( lastModified, Qt::ISODate ), localTimeZoneId ); event->setLastModified( dt ); kdDebug() << "Got lastModified:" << lastModified << ", " << dt.toString() << endl; } - QString organizer = prop.namedItem( "organizer" ).toElement().text(); + TQString organizer = prop.namedItem( "organizer" ).toElement().text(); // TODO: Does outlook have a common name? Or does the organizer already contain both? event->setOrganizer( organizer ); // kdDebug() << "Got organizer: " << organizer << endl; // Trying to find attendees, not working yet - QString contact = prop.namedItem( "contact" ).toElement().text(); + TQString contact = prop.namedItem( "contact" ).toElement().text(); // event->setOrganizer( organizer ); // kdDebug() << "DEBUG: Got contact: " << contact << endl; // This looks promising for finding attendees // FIXME: get this to work - QString to = prop.namedItem( "to" ).toElement().text(); + TQString to = prop.namedItem( "to" ).toElement().text(); // kdDebug() << "DEBUG: Got to: " << to << endl; - QStringList attn = QStringList::split( ",", to ); // This doesn't work: there can be commas between "" - QStringList::iterator it; + TQStringList attn = TQStringList::split( ",", to ); // This doesn't work: there can be commas between "" + TQStringList::iterator it; for ( it = attn.begin(); it != attn.end(); ++it ) { // kdDebug() << " attendee: " << (*it) << endl; - QString name = ""; + TQString name = ""; // KCal::Attendee* a = new KCal::Attendee( name, email ); // event->addAttendee( a ); } - QString readonly = prop.namedItem( "isreadonly" ).toElement().text(); + TQString readonly = prop.namedItem( "isreadonly" ).toElement().text(); event->setReadOnly( readonly == "1" ); kdDebug() << "Got readonly: " << readonly << ":" << (readonly != "0") << endl; - QString created = prop.namedItem( "created" ).toElement().text(); + TQString created = prop.namedItem( "created" ).toElement().text(); if ( !created.isEmpty() ) { - QDateTime dt = utcAsZone( QDateTime::fromString( created, Qt::ISODate ), + TQDateTime dt = utcAsZone( TQDateTime::fromString( created, Qt::ISODate ), localTimeZoneId ); event->setCreated( dt ); kdDebug() << "got created: " << dt.toString() << endl; } - QString dtstart = prop.namedItem( "dtstart" ).toElement().text(); + TQString dtstart = prop.namedItem( "dtstart" ).toElement().text(); if ( !dtstart.isEmpty() ) { - QDateTime dt = utcAsZone( QDateTime::fromString( dtstart, Qt::ISODate ), + TQDateTime dt = utcAsZone( TQDateTime::fromString( dtstart, Qt::ISODate ), localTimeZoneId ); event->setDtStart( dt ); kdDebug() << "got dtstart: " << dtstart << " becomes in timezone " << dt.toString() << endl; } - QString alldayevent = prop.namedItem( "alldayevent" ).toElement().text(); + TQString alldayevent = prop.namedItem( "alldayevent" ).toElement().text(); bool floats = alldayevent.toInt() != 0; event->setFloats( floats ); kdDebug() << "Got alldayevent: \"" << alldayevent << "\":" << floats << endl; - QString dtend = prop.namedItem( "dtend" ).toElement().text(); + TQString dtend = prop.namedItem( "dtend" ).toElement().text(); if ( !dtend.isEmpty() ) { - QDateTime dt = utcAsZone( QDateTime::fromString( dtend, Qt::ISODate ), + TQDateTime dt = utcAsZone( TQDateTime::fromString( dtend, Qt::ISODate ), localTimeZoneId ); // Outlook thinks differently about floating event timing than libkcal if ( floats ) dt = dt.addDays( -1 ); @@ -465,24 +465,24 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) kdDebug() << "got dtend: " << dtend << " becomes in timezone " << dt.toString() << endl; } - QString transparent = prop.namedItem( "transparent" ).toElement().text(); + TQString transparent = prop.namedItem( "transparent" ).toElement().text(); event->setTransparency( transparent.toInt() > 0 ? KCal::Event::Transparent : KCal::Event::Opaque ); // kdDebug() << "Got transparent: " << transparent << endl; - QString description = prop.namedItem( "textdescription" ).toElement().text(); + TQString description = prop.namedItem( "textdescription" ).toElement().text(); event->setDescription( description ); kdDebug() << "Got description: " << description << endl; - QString subject = prop.namedItem( "subject" ).toElement().text(); + TQString subject = prop.namedItem( "subject" ).toElement().text(); event->setSummary( subject ); kdDebug() << "Got summary: " << subject << endl; - QString location = prop.namedItem( "location" ).toElement().text(); + TQString location = prop.namedItem( "location" ).toElement().text(); event->setLocation( location ); // kdDebug() << "Got location: " << location << endl; - QString rrule = prop.namedItem( "rrule" ).toElement().text(); + TQString rrule = prop.namedItem( "rrule" ).toElement().text(); kdDebug() << "Got rrule: " << rrule << endl; if ( !rrule.isEmpty() ) { // Timezone should be handled automatically @@ -494,23 +494,23 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) } } - QDomElement keywords = prop.namedItem( "Keywords" ).toElement(); - QStringList categories; - QDomNodeList list = keywords.elementsByTagNameNS( "xml:", "v" ); + TQDomElement keywords = prop.namedItem( "Keywords" ).toElement(); + TQStringList categories; + TQDomNodeList list = keywords.elementsByTagNameNS( "xml:", "v" ); for( uint i=0; i < list.count(); i++ ) { - QDomElement item = list.item(i).toElement(); + TQDomElement item = list.item(i).toElement(); categories.append( item.text() ); } event->setCategories( categories ); // kdDebug() << "Got categories: " << categories.join( ", " ) << endl; - QDomElement exdate = prop.namedItem( "exdate" ).toElement(); + TQDomElement exdate = prop.namedItem( "exdate" ).toElement(); KCal::DateList exdates; list = exdate.elementsByTagNameNS( "xml:", "v" ); for( uint i=0; i < list.count(); i++ ) { - QDomElement item = list.item(i).toElement(); - QDate date = utcAsZone( QDateTime::fromString( item.text(), Qt::ISODate ), localTimeZoneId ).date(); + TQDomElement item = list.item(i).toElement(); + TQDate date = utcAsZone( TQDateTime::fromString( item.text(), Qt::ISODate ), localTimeZoneId ).date(); exdates.append( date ); // kdDebug() << "Got exdate: " << date.toString() << endl; } @@ -521,7 +521,7 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) // 1 Personal // 2 Private // 3 Company Confidential - QString sensitivity = prop.namedItem( "sensitivity" ).toElement().text(); + TQString sensitivity = prop.namedItem( "sensitivity" ).toElement().text(); if ( ! sensitivity.isNull() ) switch( sensitivity.toInt() ) { case 0: event->setSecrecy( KCal::Incidence::SecrecyPublic ); break; @@ -533,7 +533,7 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) // kdDebug() << "Got sensitivity: " << sensitivity << endl; - QString reminder = prop.namedItem( "reminderoffset" ).toElement().text(); + TQString reminder = prop.namedItem( "reminderoffset" ).toElement().text(); // kdDebug() << "Reminder offset: " << reminder << endl; if ( !reminder.isEmpty() ) { // Duration before event in seconds @@ -555,10 +555,10 @@ void ExchangeDownload::slotPropFindResult( KIO::Job *job ) //void addRelation(Incidence *); /** set the list of attachments/associated files for this event */ - //void setAttachments(const QStringList &attachments); + //void setAttachments(const TQStringList &attachments); /** set resources used, such as Office, Car, etc. */ - //void setResources(const QStringList &resources); + //void setResources(const TQStringList &resources); /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ //void setPriority(int priority); @@ -613,7 +613,7 @@ void ExchangeDownload::decreaseDownloads() } } -void ExchangeDownload::finishUp( int result, const QString &moreInfo ) +void ExchangeDownload::finishUp( int result, const TQString &moreInfo ) { kdDebug() << "ExchangeDownload::finishUp() " << result << " " << moreInfo << endl; @@ -635,8 +635,8 @@ void ExchangeDownload::finishUp( int result, const QString &moreInfo ) void ExchangeDownload::finishUp( int result, KIO::Job *job ) { - finishUp( result, QString("WebDAV job error code = ") + - QString::number( job->error() ) + ";\n" + "\"" + + finishUp( result, TQString("WebDAV job error code = ") + + TQString::number( job->error() ) + ";\n" + "\"" + job->errorString() + "\"" ); } diff --git a/libkpimexchange/core/exchangedownload.h b/libkpimexchange/core/exchangedownload.h index a43d82692..6eab9f565 100644 --- a/libkpimexchange/core/exchangedownload.h +++ b/libkpimexchange/core/exchangedownload.h @@ -20,11 +20,11 @@ #ifndef KDEPIM_EXCHANGE_DOWNLOAD_H #define KDEPIM_EXCHANGE_DOWNLOAD_H -#include <qstring.h> -#include <qptrlist.h> -#include <qdatetime.h> -#include <qdom.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqdatetime.h> +#include <tqdom.h> +#include <tqmap.h> #include <kio/job.h> #include <libkcal/calendar.h> @@ -35,23 +35,23 @@ namespace KPIM { class ExchangeProgress; class ExchangeAccount; -class ExchangeDownload : public QObject { +class ExchangeDownload : public TQObject { Q_OBJECT public: - ExchangeDownload( ExchangeAccount* account, QWidget* window=0 ); + ExchangeDownload( ExchangeAccount* account, TQWidget* window=0 ); ~ExchangeDownload(); void download( KCal::Calendar* calendar, - const QDate& start, const QDate& end, bool showProgress ); - void download( const QDate& start, const QDate& end, bool showProgress ); + const TQDate& start, const TQDate& end, bool showProgress ); + void download( const TQDate& start, const TQDate& end, bool showProgress ); signals: void startDownload(); void finishDownload(); void gotEvent( KCal::Event* event, const KURL& url ); - void finished( ExchangeDownload*, int result, const QString& moreInfo ); - void finished( ExchangeDownload*, int result, const QString& moreInfo, QPtrList<KCal::Event>& events ); + void finished( ExchangeDownload*, int result, const TQString& moreInfo ); + void finished( ExchangeDownload*, int result, const TQString& moreInfo, TQPtrList<KCal::Event>& events ); private slots: void slotSearchResult( KIO::Job *job ); @@ -59,28 +59,28 @@ class ExchangeDownload : public QObject { void slotPropFindResult( KIO::Job * ); private: - void handleAppointments( const QDomDocument &, bool recurrence ); + void handleAppointments( const TQDomDocument &, bool recurrence ); void readAppointment( const KURL& url ); - void handleRecurrence( QString uid ); - void finishUp( int result, const QString& moreInfo=QString::null ); + void handleRecurrence( TQString uid ); + void finishUp( int result, const TQString& moreInfo=TQString::null ); void finishUp( int result, KIO::Job* job ); void increaseDownloads(); void decreaseDownloads(); - QString dateSelectQuery( const QDate& start, const QDate& end ); + TQString dateSelectQuery( const TQDate& start, const TQDate& end ); KCal::Calendar *mCalendar; KCal::ICalFormat *mFormat; - QPtrList<KCal::Event> *mEvents; + TQPtrList<KCal::Event> *mEvents; ExchangeAccount *mAccount; ExchangeProgress *mProgress; int mDownloadsBusy; - QDomDocument mResponse; + TQDomDocument mResponse; - QMap<QString,int> m_uids; // This keeps track of uids we already covered. Especially useful for + TQMap<TQString,int> m_uids; // This keeps track of uids we already covered. Especially useful for // recurring events. - QWidget* mWindow; + TQWidget* mWindow; }; } diff --git a/libkpimexchange/core/exchangemonitor.cpp b/libkpimexchange/core/exchangemonitor.cpp index c659efb15..8e5525038 100644 --- a/libkpimexchange/core/exchangemonitor.cpp +++ b/libkpimexchange/core/exchangemonitor.cpp @@ -18,11 +18,11 @@ Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qregexp.h> -#include <qsocketdevice.h> -#include <qsocketnotifier.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqregexp.h> +#include <tqsocketdevice.h> +#include <tqsocketnotifier.h> +#include <tqtextstream.h> #include <kurl.h> #include <kdebug.h> @@ -54,24 +54,24 @@ extern "C" { using namespace KPIM; -QString makeIDString( const ExchangeMonitor::IDList& IDs ) +TQString makeIDString( const ExchangeMonitor::IDList& IDs ) { - QString result; + TQString result; ExchangeMonitor::IDList::ConstIterator it; for ( it = IDs.begin(); it != IDs.end(); ++it ) { if ( it == IDs.begin() ) - result += QString::number( (*it) ); + result += TQString::number( (*it) ); else - result += "," + QString::number( (*it) ); + result += "," + TQString::number( (*it) ); } return result; } -ExchangeMonitor::IDList makeIDList( const QString& input ) +ExchangeMonitor::IDList makeIDList( const TQString& input ) { ExchangeMonitor::IDList IDs; - QStringList numbers = QStringList::split( ",", input ); - QStringList::iterator j; + TQStringList numbers = TQStringList::split( ",", input ); + TQStringList::iterator j; for ( j = numbers.begin(); j != numbers.end(); ++j ) { ExchangeMonitor::ID id = (*j).toLong(); IDs.append( id ); @@ -79,7 +79,7 @@ ExchangeMonitor::IDList makeIDList( const QString& input ) return IDs; } -ExchangeMonitor::ExchangeMonitor( ExchangeAccount* account, int pollMode, const QHostAddress& ownInterface ) +ExchangeMonitor::ExchangeMonitor( ExchangeAccount* account, int pollMode, const TQHostAddress& ownInterface ) { kdDebug() << "Called ExchangeMonitor" << endl; @@ -89,12 +89,12 @@ ExchangeMonitor::ExchangeMonitor( ExchangeAccount* account, int pollMode, const mPollTimer = 0; if ( pollMode == CallBack ) { - mSocket = new QSocketDevice( QSocketDevice::Datagram ); + mSocket = new TQSocketDevice( TQSocketDevice::Datagram ); if ( ! mSocket->bind( ownInterface, 0 ) ) kdDebug() << "bind() returned false" << endl; mSocket->setBlocking( false ); - mNotifier = new QSocketNotifier( mSocket->socket(), QSocketNotifier::Read ); - connect( mNotifier, SIGNAL(activated( int )), this, SLOT( slotActivated(int))); + mNotifier = new TQSocketNotifier( mSocket->socket(), TQSocketNotifier::Read ); + connect( mNotifier, TQT_SIGNAL(activated( int )), this, TQT_SLOT( slotActivated(int))); //mSocket.setSocketFlags( KExtendedSocket::inetSocket | KExtendedSocket::passiveSocket | KExtendedSocket::datagramSocket | KExtendedSocket::bufferedSocket ); //mSocket.setHost( "jupiter.tbm.tudelft.nl" ); // Does this work? @@ -105,17 +105,17 @@ ExchangeMonitor::ExchangeMonitor( ExchangeAccount* account, int pollMode, const //mSocket.enableRead( true ); kdDebug() << "Port: " << mSocket->port() << endl; kdDebug() << "Host: " << mSocket->address().toString() << endl; - // mStream = new QTextStream( mSocket ); + // mStream = new TQTextStream( mSocket ); } if ( mPollMode == Poll ) { - mPollTimer = new QTimer( this, "mPollTimer" ); - connect( mPollTimer, SIGNAL(timeout()), this, SLOT(slotPollTimer()) ); + mPollTimer = new TQTimer( this, "mPollTimer" ); + connect( mPollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotPollTimer()) ); mPollTimer->start( 60000 ); // 1 minute timer } - mRenewTimer = new QTimer( this, "mRenewTimer" ); - connect( mRenewTimer, SIGNAL(timeout()), this, SLOT(slotRenewTimer()) ); + mRenewTimer = new TQTimer( this, "mRenewTimer" ); + connect( mRenewTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotRenewTimer()) ); mRenewTimer->start( mSubscriptionLifetime * 900 ); // 10% early so as to be in time } @@ -127,13 +127,13 @@ ExchangeMonitor::~ExchangeMonitor() if ( mPollTimer ) delete mPollTimer; if ( mRenewTimer ) delete mRenewTimer; if ( ! mSubscriptionMap.isEmpty() ) { - QString headers = "Subscription-ID: " + makeIDString( mSubscriptionMap.keys() ); + TQString headers = "Subscription-ID: " + makeIDString( mSubscriptionMap.keys() ); kdDebug() << "Subsubscribing all watches, headers:" << endl << headers << endl; - KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_UNSUBSCRIBE, QString::null, false ); + KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_UNSUBSCRIBE, TQString::null, false ); job->addMetaData( "customHTTPHeader", headers ); // Can't do, this is a destructor! // job->addMetaData( "PropagateHttpHeader", "true" ); - // connect(job, SIGNAL(result( KIO::Job * )), this, SLOT(slotUnsubscribeResult(KIO::Job *))); + // connect(job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(slotUnsubscribeResult(KIO::Job *))); } kdDebug() << "Finished ExchangeMonitor destructor" << endl; @@ -141,7 +141,7 @@ ExchangeMonitor::~ExchangeMonitor() void ExchangeMonitor::addWatch( const KURL &url, int mode, int depth ) { - QString headers = "Notification-type: "; + TQString headers = "Notification-type: "; switch( mode ) { case Delete: headers += "delete\r\n"; break; case Move: headers += "move\r\n"; break; @@ -150,24 +150,24 @@ void ExchangeMonitor::addWatch( const KURL &url, int mode, int depth ) case UpdateNewMember: headers += "update/newmember\r\n"; break; } - headers += "Depth: " + QString::number( depth ); + headers += "Depth: " + TQString::number( depth ); if (mPollMode == CallBack ) - headers += "\r\nCall-Back: httpu://" + mSocket->address().toString() + ":" + QString::number(mSocket->port()); + headers += "\r\nCall-Back: httpu://" + mSocket->address().toString() + ":" + TQString::number(mSocket->port()); kdDebug() << "Headers: " << headers << endl; KURL myURL = toDAV( url ); - KIO::DavJob *job = new KIO::DavJob( myURL, (int) KIO::DAV_SUBSCRIBE, QString::null, false ); + KIO::DavJob *job = new KIO::DavJob( myURL, (int) KIO::DAV_SUBSCRIBE, TQString::null, false ); job->addMetaData( "customHTTPHeader", headers ); job->addMetaData( "PropagateHttpHeader", "true" ); - connect(job, SIGNAL(result( KIO::Job * )), this, SLOT(slotSubscribeResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(slotSubscribeResult(KIO::Job *))); } void ExchangeMonitor::removeWatch( const KURL &url ) { KURL myURL = toDAV( url ); - QMap<ID,KURL>::Iterator it; + TQMap<ID,KURL>::Iterator it; for ( it = mSubscriptionMap.begin(); it != mSubscriptionMap.end(); ++it ) { if ( it.data() == myURL ) { removeWatch( it.key() ); @@ -179,17 +179,17 @@ void ExchangeMonitor::removeWatch( const KURL &url ) void ExchangeMonitor::removeWatch( ID id ) { - KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_UNSUBSCRIBE, QString::null, false ); - job->addMetaData( "customHTTPHeader", "Subscription-id: " + QString::number( id )); + KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_UNSUBSCRIBE, TQString::null, false ); + job->addMetaData( "customHTTPHeader", "Subscription-id: " + TQString::number( id )); job->addMetaData( "PropagateHttpHeader", "true" ); - connect(job, SIGNAL(result( KIO::Job * )), this, SLOT(slotUnsubscribeResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(slotUnsubscribeResult(KIO::Job *))); } void ExchangeMonitor::slotSubscribeResult( KIO::Job * job ) { if ( job->error() ) { job->showErrorDialog( 0L ); - emit error( ExchangeClient::CommunicationError, "IO Error: " + QString::number(job->error()) + ":" + job->errorString() ); + emit error( ExchangeClient::CommunicationError, "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } @@ -198,12 +198,12 @@ void ExchangeMonitor::slotSubscribeResult( KIO::Job * job ) bool gotID = false; bool gotURL = false; - QStringList headers = QStringList::split( "\n", job->queryMetaData( "HTTP-Headers" ) ); - for ( QStringList::Iterator it = headers.begin(); it != headers.end(); ++it ) { + TQStringList headers = TQStringList::split( "\n", job->queryMetaData( "HTTP-Headers" ) ); + for ( TQStringList::Iterator it = headers.begin(); it != headers.end(); ++it ) { int colon = (*it).find( ": " ); if ( colon<0 ) continue; - QString tag = (*it).left( colon ).stripWhiteSpace().lower(); - QString value = (*it).mid( colon+1 ).stripWhiteSpace(); + TQString tag = (*it).left( colon ).stripWhiteSpace().lower(); + TQString value = (*it).mid( colon+1 ).stripWhiteSpace(); if ( tag == "subscription-lifetime" ) { int lifetime = value.toInt(); if ( lifetime < mSubscriptionLifetime ) { @@ -249,15 +249,15 @@ void ExchangeMonitor::slotUnsubscribeResult( KIO::Job * job ) { if ( job->error() ) { job->showErrorDialog( 0L ); - emit error( ExchangeClient::CommunicationError, "IO Error: " + QString::number(job->error()) + ":" + job->errorString() ); + emit error( ExchangeClient::CommunicationError, "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } - QDomDocument& response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument& response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "UNSUBSCRIBE result: " << endl << response.toString() << endl; - QDomElement status = response.documentElement().namedItem( "response" ).namedItem( "status" ).toElement(); - QDomElement subscriptionID = response.documentElement().namedItem( "response" ).namedItem( "subscriptionID" ).toElement(); + TQDomElement status = response.documentElement().namedItem( "response" ).namedItem( "status" ).toElement(); + TQDomElement subscriptionID = response.documentElement().namedItem( "response" ).namedItem( "subscriptionID" ).toElement(); kdDebug() << "Subscription ID.text(): " << subscriptionID.text() << endl; bool ok; ID id = subscriptionID.text().toLong( &ok ); @@ -284,7 +284,7 @@ void ExchangeMonitor::slotActivated( int ) if ( maxLen == 0 ) return; - QCString response( maxLen+2 ); + TQCString response( maxLen+2 ); Q_LONG len = mSocket->readBlock ( response.data(), maxLen+1 ); if ( len <= 0 ) { @@ -295,13 +295,13 @@ void ExchangeMonitor::slotActivated( int ) kdDebug() << "Got data of " << len << " bytes." << endl; kdDebug() << response << endl; - QString s(response); + TQString s(response); IDList IDs; - QStringList lines = QStringList::split( "\n", s ); - QStringList::iterator it; + TQStringList lines = TQStringList::split( "\n", s ); + TQStringList::iterator it; for ( it = lines.begin(); it != lines.end(); ++it ) { - QString line = (*it).stripWhiteSpace().lower(); + TQString line = (*it).stripWhiteSpace().lower(); if ( line.startsWith( "subscription-id: " ) ) IDs = makeIDList( line.section(":",1).stripWhiteSpace() ); } @@ -321,35 +321,35 @@ void ExchangeMonitor::poll( const IDList& IDs ) { // } // confirm it - KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_POLL, QString::null, false ); + KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_POLL, TQString::null, false ); job->addMetaData( "customHTTPHeader", "Subscription-ID: " + makeIDString( IDs ) ); - connect(job, SIGNAL(result( KIO::Job * )), this, SLOT(slotPollResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(slotPollResult(KIO::Job *))); } void ExchangeMonitor::slotPollResult( KIO::Job * job ) { if ( job->error() ) { job->showErrorDialog( 0L ); - emit error( ExchangeClient::CommunicationError, "IO Error: " + QString::number(job->error()) + ":" + job->errorString() ); + emit error( ExchangeClient::CommunicationError, "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } - QDomDocument& response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument& response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "POLL result: " << endl << response.toString() << endl; // Multiple results! - QDomNodeList responses = response.documentElement().elementsByTagName( "response" ); + TQDomNodeList responses = response.documentElement().elementsByTagName( "response" ); if ( responses.count() == 0 ) { emit error( ExchangeClient::ServerResponseError, "Poll result is wrong: \n" + response.toString() ); return; } for( uint i=0; i<responses.count(); i++ ) { - QDomElement item = responses.item( i ).toElement(); - QDomElement status = item.namedItem( "status" ).toElement(); - QDomElement subscriptionID = item.namedItem( "subscriptionID" ).toElement(); + TQDomElement item = responses.item( i ).toElement(); + TQDomElement status = item.namedItem( "status" ).toElement(); + TQDomElement subscriptionID = item.namedItem( "subscriptionID" ).toElement(); if ( status.text().contains( "200" ) ) { kdDebug() << "subscriptionID: " << subscriptionID.text() << endl; IDList IDs = makeIDList( subscriptionID.text() ); - QValueList<KURL> urls; + TQValueList<KURL> urls; IDList::ConstIterator it; for ( it = IDs.begin(); it != IDs.end(); ++it ) { urls += mSubscriptionMap[ *it ]; @@ -366,16 +366,16 @@ void ExchangeMonitor::slotRenewTimer() { kdDebug() << "ExchangeMonitor::slotRenewTimer()" << endl; - KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_SUBSCRIBE, QString::null, false ); + KIO::DavJob *job = new KIO::DavJob( mAccount->calendarURL(), (int) KIO::DAV_SUBSCRIBE, TQString::null, false ); job->addMetaData( "customHTTPHeader", "Subscription-id: " + makeIDString( mSubscriptionMap.keys() ) ); - connect(job, SIGNAL(result( KIO::Job * )), this, SLOT(slotRenewResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result( KIO::Job * )), this, TQT_SLOT(slotRenewResult(KIO::Job *))); } void ExchangeMonitor::slotRenewResult( KIO::Job* job ) { if ( job->error() ) { job->showErrorDialog( 0L ); - emit error( ExchangeClient::CommunicationError, "IO Error: " + QString::number(job->error()) + ":" + job->errorString() ); + emit error( ExchangeClient::CommunicationError, "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } kdDebug() << "ExchangeMonitor::slotRenewResult()" << endl; diff --git a/libkpimexchange/core/exchangemonitor.h b/libkpimexchange/core/exchangemonitor.h index f1429ba4e..216c53f5a 100644 --- a/libkpimexchange/core/exchangemonitor.h +++ b/libkpimexchange/core/exchangemonitor.h @@ -20,10 +20,10 @@ #ifndef KDEPIM_EXCHANGE_MONITOR_H #define KDEPIM_EXCHANGE_MONITOR_H -#include <qstring.h> -#include <qmap.h> -//#include <qwidget.h> -#include <qhostaddress.h> +#include <tqstring.h> +#include <tqmap.h> +//#include <tqwidget.h> +#include <tqhostaddress.h> #include <kurl.h> #include <kio/job.h> @@ -39,11 +39,11 @@ namespace KPIM { class ExchangeAccount; -class ExchangeMonitor : public QObject { +class ExchangeMonitor : public TQObject { Q_OBJECT public: typedef long ID; - typedef QValueList<ID> IDList; + typedef TQValueList<ID> IDList; enum { CallBack, Poll }; enum { Delete, /** Any: 0 The message or folder subscribed to was deleted. @@ -63,18 +63,18 @@ class ExchangeMonitor : public QObject { Any /** Message 1 Treat as depth = 0. */ }; - ExchangeMonitor( ExchangeAccount* account, int pollMode, const QHostAddress& ownInterface ); + ExchangeMonitor( ExchangeAccount* account, int pollMode, const TQHostAddress& ownInterface ); ~ExchangeMonitor(); void addWatch( const KURL &url, int mode, int depth ); void removeWatch( const KURL &url ); void removeWatch( ID id ); signals: - void notify( const QValueList<long>& IDs, const QValueList<KURL>& urls ); + void notify( const TQValueList<long>& IDs, const TQValueList<KURL>& urls ); // void added( ID id, const KURL& url ); // void removed( ID id, const KURL& url ); - void error( int result, const QString& moreInfo ); + void error( int result, const TQString& moreInfo ); private slots: void slotSubscribeResult( KIO::Job * ); @@ -89,15 +89,15 @@ class ExchangeMonitor : public QObject { private: // void init(); - QMap<ID,KURL> mSubscriptionMap; - QSocketDevice *mSocket; - QSocketNotifier* mNotifier; - QTextStream *mStream; + TQMap<ID,KURL> mSubscriptionMap; + TQSocketDevice *mSocket; + TQSocketNotifier* mNotifier; + TQTextStream *mStream; ExchangeAccount* mAccount; int mSubscriptionLifetime; - // QString mSubscriptionId; - QTimer* mPollTimer; - QTimer* mRenewTimer; + // TQString mSubscriptionId; + TQTimer* mPollTimer; + TQTimer* mRenewTimer; int mPollMode; }; diff --git a/libkpimexchange/core/exchangeprogress.cpp b/libkpimexchange/core/exchangeprogress.cpp index 203a1a0b7..bee71b572 100644 --- a/libkpimexchange/core/exchangeprogress.cpp +++ b/libkpimexchange/core/exchangeprogress.cpp @@ -18,9 +18,9 @@ Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <klocale.h> #include <kmessagebox.h> @@ -33,7 +33,7 @@ #include "exchangeprogress.h" using namespace KPIM; -ExchangeProgress::ExchangeProgress(QWidget *parent) +ExchangeProgress::ExchangeProgress(TQWidget *parent) : KProgressDialog(parent, "", i18n("Exchange Download Progress"), i18n("Exchange Plugin"), "text" ) { m_finished = 0; @@ -65,7 +65,7 @@ void ExchangeProgress::slotTransferFinished() void ExchangeProgress::updateLabel() { progressBar()->setValue( m_finished ); - QString str = i18n( "Downloading, %1 of %2" ).arg( m_finished ).arg( m_total ); + TQString str = i18n( "Downloading, %1 of %2" ).arg( m_finished ).arg( m_total ); setLabel( str ); } diff --git a/libkpimexchange/core/exchangeprogress.h b/libkpimexchange/core/exchangeprogress.h index c37467db1..d6b3341ff 100644 --- a/libkpimexchange/core/exchangeprogress.h +++ b/libkpimexchange/core/exchangeprogress.h @@ -31,7 +31,7 @@ class ExchangeProgress : public KProgressDialog Q_OBJECT public: - ExchangeProgress(QWidget *parent=0); + ExchangeProgress(TQWidget *parent=0); virtual ~ExchangeProgress(); public slots: diff --git a/libkpimexchange/core/exchangeupload.cpp b/libkpimexchange/core/exchangeupload.cpp index 8332979a0..bbc30906d 100644 --- a/libkpimexchange/core/exchangeupload.cpp +++ b/libkpimexchange/core/exchangeupload.cpp @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqregexp.h> #include <kurl.h> #include <kdebug.h> @@ -52,7 +52,7 @@ extern "C" { using namespace KPIM; ExchangeUpload::ExchangeUpload( KCal::Event *event, ExchangeAccount *account, - const QString &timeZoneId, QWidget *window ) + const TQString &timeZoneId, TQWidget *window ) : mTimeZoneId( timeZoneId ), mWindow( window ) { kdDebug() << "Called ExchangeUpload" << endl; @@ -75,9 +75,9 @@ ExchangeUpload::~ExchangeUpload() kdDebug() << "Finished ExchangeUpload destructor" << endl; } -void ExchangeUpload::findUid( QString const &uid ) +void ExchangeUpload::findUid( TQString const &uid ) { - QString query = + TQString query = "SELECT \"DAV:href\", \"urn:schemas:calendar:uid\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" "WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n"; @@ -88,8 +88,8 @@ void ExchangeUpload::findUid( QString const &uid ) KIO::DavJob* job = KIO::davSearch( mAccount->calendarURL(), "DAV:", "sql", query, false ); job->setWindow( mWindow ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotFindUidResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotFindUidResult( KIO::Job * ) ) ); } void ExchangeUpload::slotFindUidResult( KIO::Job * job ) @@ -100,16 +100,16 @@ void ExchangeUpload::slotFindUidResult( KIO::Job * job ) kdDebug() << "Error: " << job->error() << endl; job->showErrorDialog( 0 ); emit finished( this, ExchangeClient::CommunicationError, - "IO Error: " + QString::number(job->error()) + ":" + + "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } - QDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument &response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "Search uid result: " << endl << response.toString() << endl; - QDomElement item = response.documentElement().firstChild().toElement(); - QDomElement hrefElement = item.namedItem( "href" ).toElement(); + TQDomElement item = response.documentElement().firstChild().toElement(); + TQDomElement hrefElement = item.namedItem( "href" ).toElement(); if ( item.isNull() || hrefElement.isNull() ) { // No appointment with this UID in exchange database // Create a new filename for this appointment and store it there @@ -118,7 +118,7 @@ void ExchangeUpload::slotFindUidResult( KIO::Job * job ) } // The appointment is already in the exchange database // Overwrite it with the new data - QString href = hrefElement.text(); + TQString href = hrefElement.text(); KURL url( href ); kdDebug() << "Found URL with identical uid: " << url.prettyURL() << ", overwriting that one" << endl; @@ -134,21 +134,21 @@ void ExchangeUpload::tryExist() if ( m_currentUploadNumber == 0 ) url.addPath( m_currentUpload->summary() + ".EML" ); else - url.addPath( m_currentUpload->summary() + "-" + QString::number( m_currentUploadNumber ) + ".EML" ); + url.addPath( m_currentUpload->summary() + "-" + TQString::number( m_currentUploadNumber ) + ".EML" ); kdDebug() << "Trying to see whether " << url.prettyURL() << " exists" << endl; - QDomDocument doc; - QDomElement root = addElement( doc, doc, "DAV:", "propfind" ); - QDomElement prop = addElement( doc, root, "DAV:", "prop" ); + TQDomDocument doc; + TQDomElement root = addElement( doc, doc, "DAV:", "propfind" ); + TQDomElement prop = addElement( doc, root, "DAV:", "prop" ); addElement( doc, prop, "DAV:", "displayname" ); addElement( doc, prop, "urn:schemas:calendar", "uid" ); KIO::DavJob *job = KIO::davPropFind( url, doc, "0", false ); job->setWindow( mWindow ); job->addMetaData( "errorPage", "false" ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotPropFindResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotPropFindResult( KIO::Job * ) ) ); } void ExchangeUpload::slotPropFindResult( KIO::Job *job ) @@ -159,7 +159,7 @@ void ExchangeUpload::slotPropFindResult( KIO::Job *job ) if ( error && error != KIO::ERR_DOES_NOT_EXIST ) { job->showErrorDialog( 0 ); emit finished( this, ExchangeClient::CommunicationError, - "IO Error: " + QString::number(error) + ":" + + "IO Error: " + TQString::number(error) + ":" + job->errorString() ); return; } @@ -180,12 +180,12 @@ void ExchangeUpload::slotPropFindResult( KIO::Job *job ) url.addPath( m_currentUpload->summary() + ".EML" ); else url.addPath( m_currentUpload->summary() + "-" + - QString::number( m_currentUploadNumber ) + ".EML" ); + TQString::number( m_currentUploadNumber ) + ".EML" ); startUpload( url ); } -QString timezoneid( int offset ) +TQString timezoneid( int offset ) { switch ( offset ) { case 0: return "0"; @@ -232,10 +232,10 @@ void ExchangeUpload::startUpload( const KURL &url ) return; } - QDomDocument doc; - QDomElement root = addElement( doc, doc, "DAV:", "propertyupdate" ); - QDomElement set = addElement( doc, root, "DAV:", "set" ); - QDomElement prop = addElement( doc, set, "DAV:", "prop" ); + TQDomDocument doc; + TQDomElement root = addElement( doc, doc, "DAV:", "propertyupdate" ); + TQDomElement set = addElement( doc, root, "DAV:", "set" ); + TQDomElement prop = addElement( doc, set, "DAV:", "prop" ); addElement( doc, prop, "DAV:", "contentclass", "urn:content-classes:appointment" ); // addElement( doc, prop, "http://schemas.microsoft.com/exchange/", "outlookmessageclass", "IPM.appointment" ); addElement( doc, prop, "http://schemas.microsoft.com/exchange/", @@ -249,14 +249,14 @@ void ExchangeUpload::startUpload( const KURL &url ) // value that localUTCOffset() supplies... // FIXME: What do we need that offset for anyway??? int tzOffset = - KRFCDate::localUTCOffset(); - QString offsetString; + TQString offsetString; if ( tzOffset == 0 ) offsetString = "Z"; else if ( tzOffset > 0 ) - offsetString = QString( "+%1:%2" ).arg(tzOffset/60, 2).arg( tzOffset%60, 2 ); + offsetString = TQString( "+%1:%2" ).arg(tzOffset/60, 2).arg( tzOffset%60, 2 ); else - offsetString = QString( "-%1:%2" ).arg((-tzOffset)/60, 2).arg( (-tzOffset)%60, 2 ); - offsetString = offsetString.replace( QRegExp(" "), "0" ); + offsetString = TQString( "-%1:%2" ).arg((-tzOffset)/60, 2).arg( (-tzOffset)%60, 2 ); + offsetString = offsetString.replace( TQRegExp(" "), "0" ); kdDebug() << "Timezone offset: " << tzOffset << " : " << offsetString << endl; kdDebug() << "ExchangeUpload::mTimeZoneId=" << mTimeZoneId << endl; @@ -290,12 +290,12 @@ void ExchangeUpload::startUpload( const KURL &url ) if ( recurrence->recurrenceType() != KCal::Recurrence::rNone ) { addElement( doc, prop, "urn:schemas:calendar:", "instancetype", "1" ); KCal::ICalFormat *format = new KCal::ICalFormat(); - QString recurstr = format->toString( recurrence->defaultRRule() ); + TQString recurstr = format->toString( recurrence->defaultRRule() ); // Strip leading "RRULE\n :" and whitespace - recurstr = recurstr.replace( QRegExp("^[A-Z]*[\\s]*:"), "").stripWhiteSpace(); + recurstr = recurstr.replace( TQRegExp("^[A-Z]*[\\s]*:"), "").stripWhiteSpace(); kdDebug() << "Recurrence rule after replace: \"" << recurstr << "\"" << endl; delete format; - QDomElement rrule = addElement( doc, prop, "urn:schemas:calendar:", "rrule" ); + TQDomElement rrule = addElement( doc, prop, "urn:schemas:calendar:", "rrule" ); addElement( doc, rrule, "xml:", "v", recurstr ); addElement( doc, prop, "urn:schemas:calendar:", "timezoneid", timezoneid( tzOffset ) ); } else { @@ -304,11 +304,11 @@ void ExchangeUpload::startUpload( const KURL &url ) KCal::DateList exdates = recurrence->exDates(); if ( !exdates.isEmpty() ) { - QDomElement exdate = addElement( doc, prop, "urn:schemas:calendar:", "exdate" ); + TQDomElement exdate = addElement( doc, prop, "urn:schemas:calendar:", "exdate" ); KCal::DateList::iterator it; for ( it = exdates.begin(); it != exdates.end(); ++it ) { - QString date = (*it).toString( "yyyy-MM-ddT00:00:00.000" )+ offsetString; -// QString date = zoneAsUtc( (*it), mTimeZoneId ).toString( Qt::ISODate ); + TQString date = (*it).toString( "yyyy-MM-ddT00:00:00.000" )+ offsetString; +// TQString date = zoneAsUtc( (*it), mTimeZoneId ).toString( Qt::ISODate ); addElement( doc, exdate, "xml:", "v", date ); } } @@ -321,7 +321,7 @@ void ExchangeUpload::startUpload( const KURL &url ) // TODO: handle alarm types if ( alarm->hasStartOffset() ) { int offset = - alarm->startOffset().asSeconds(); - addElement( doc, prop, "urn:schemas:calendar:", "reminderoffset", QString::number( offset ) ); + addElement( doc, prop, "urn:schemas:calendar:", "reminderoffset", TQString::number( offset ) ); } } @@ -332,8 +332,8 @@ void ExchangeUpload::startUpload( const KURL &url ) KIO::DavJob *job = KIO::davPropPatch( url, doc, false ); job->setWindow( mWindow ); - connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotPatchResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotPatchResult( KIO::Job * ) ) ); } void ExchangeUpload::slotPatchResult( KIO::Job *job ) @@ -343,19 +343,19 @@ void ExchangeUpload::slotPatchResult( KIO::Job *job ) job->showErrorDialog( 0 ); kdDebug() << "Error: " << job->error() << endl; emit finished( this, ExchangeClient::CommunicationError, - "IO Error: " + QString::number(job->error()) + ":" + + "IO Error: " + TQString::number(job->error()) + ":" + job->errorString() ); return; } - QDomDocument response = static_cast<KIO::DavJob *>( job )->response(); + TQDomDocument response = static_cast<KIO::DavJob *>( job )->response(); kdDebug() << "Patch result: " << response.toString() << endl; // Either we have a "201 Created" (if a new event has been created) or // we have a "200 OK" (if an existing event has been altered), // or else an error has occurred ;) - QDomElement status = response.documentElement().namedItem( "response" ) + TQDomElement status = response.documentElement().namedItem( "response" ) .namedItem( "status" ).toElement(); - QDomElement propstat = response.documentElement().namedItem( "response" ) + TQDomElement propstat = response.documentElement().namedItem( "response" ) .namedItem( "propstat" ).namedItem( "status" ) .toElement(); kdDebug() << "status: " << status.text() << endl; @@ -365,7 +365,7 @@ void ExchangeUpload::slotPatchResult( KIO::Job *job ) emit finished( this, ExchangeClient::EventWriteError, "Upload error response: \n" + response.toString() ); else - emit finished( this, ExchangeClient::ResultOK, QString::null ); + emit finished( this, ExchangeClient::ResultOK, TQString::null ); } #include "exchangeupload.moc" diff --git a/libkpimexchange/core/exchangeupload.h b/libkpimexchange/core/exchangeupload.h index 5ed269297..953451a86 100644 --- a/libkpimexchange/core/exchangeupload.h +++ b/libkpimexchange/core/exchangeupload.h @@ -20,8 +20,8 @@ #ifndef KDEPIM_EXCHANGE_UPLOAD_H #define KDEPIM_EXCHANGE_UPLOAD_H -#include <qstring.h> -#include <qwidget.h> +#include <tqstring.h> +#include <tqwidget.h> #include <kio/job.h> #include <kdepimmacros.h> @@ -33,10 +33,10 @@ namespace KPIM { class ExchangeAccount; -class KDE_EXPORT ExchangeUpload : public QObject { +class KDE_EXPORT ExchangeUpload : public TQObject { Q_OBJECT public: - ExchangeUpload( KCal::Event* event, ExchangeAccount* account, const QString& timeZoneId, QWidget* window=0 ); + ExchangeUpload( KCal::Event* event, ExchangeAccount* account, const TQString& timeZoneId, TQWidget* window=0 ); ~ExchangeUpload(); private slots: @@ -47,18 +47,18 @@ class KDE_EXPORT ExchangeUpload : public QObject { signals: void startDownload(); void finishDownload(); - void finished( ExchangeUpload* worker, int result, const QString& moreInfo ); + void finished( ExchangeUpload* worker, int result, const TQString& moreInfo ); private: void tryExist(); void startUpload( const KURL& url ); - void findUid( QString const& uid ); + void findUid( TQString const& uid ); ExchangeAccount* mAccount; KCal::Event* m_currentUpload; int m_currentUploadNumber; - QString mTimeZoneId; - QWidget* mWindow; + TQString mTimeZoneId; + TQWidget* mWindow; }; } diff --git a/libkpimexchange/core/utils.cpp b/libkpimexchange/core/utils.cpp index 1d90cfcca..61847dbdd 100644 --- a/libkpimexchange/core/utils.cpp +++ b/libkpimexchange/core/utils.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include <qdatetime.h> +#include <tqdatetime.h> extern "C" { #include <ical.h> @@ -28,9 +28,9 @@ extern "C" { /** In a document doc with node node, add an element with name ns and tagname tag. Return the new element */ -QDomElement addElement( QDomDocument& doc, QDomNode& node, const QString& ns, const QString& tag ) +TQDomElement addElement( TQDomDocument& doc, TQDomNode& node, const TQString& ns, const TQString& tag ) { - QDomElement el = doc.createElementNS( ns, tag ); + TQDomElement el = doc.createElementNS( ns, tag ); node.appendChild( el ); return el; } @@ -39,10 +39,10 @@ QDomElement addElement( QDomDocument& doc, QDomNode& node, const QString& ns, co In a document doc with node node, add an element with namespace ns and tagname tag. Add a textnode in the element with text contents text. Return the new element. */ -QDomElement addElement( QDomDocument& doc, QDomNode& node, const QString& ns, const QString& tag, const QString& text ) +TQDomElement addElement( TQDomDocument& doc, TQDomNode& node, const TQString& ns, const TQString& tag, const TQString& text ) { - QDomElement el = doc.createElementNS( ns, tag ); - QDomText textnode = doc.createTextNode( text ); + TQDomElement el = doc.createElementNS( ns, tag ); + TQDomText textnode = doc.createTextNode( text ); el.appendChild( textnode ); node.appendChild( el ); return el; @@ -50,10 +50,10 @@ QDomElement addElement( QDomDocument& doc, QDomNode& node, const QString& ns, co //TODO: should not call libical functions directly -- better to make // a new libkcal abstraction method. -QDateTime utcAsZone( const QDateTime& utc, const QString& timeZoneId ) +TQDateTime utcAsZone( const TQDateTime& utc, const TQString& timeZoneId ) { int daylight; - QDateTime epoch; + TQDateTime epoch; epoch.setTime_t( 0 ); time_t v = epoch.secsTo( utc ); struct icaltimetype tt = icaltime_from_timet( v, 0 ); // 0: is_date=false @@ -66,10 +66,10 @@ QDateTime utcAsZone( const QDateTime& utc, const QString& timeZoneId ) //TODO: should not call libical functions directly -- better to make // a new libkcal abstraction method. -QDateTime zoneAsUtc( const QDateTime& zone, const QString& timeZoneId ) +TQDateTime zoneAsUtc( const TQDateTime& zone, const TQString& timeZoneId ) { int daylight; - QDateTime epoch; + TQDateTime epoch; epoch.setTime_t( 0 ); time_t v = epoch.secsTo( zone ); struct icaltimetype tt = icaltime_from_timet( v, 0 ); // 0: is_date=false diff --git a/libkpimexchange/core/utils.h b/libkpimexchange/core/utils.h index 20b681416..c26eb72b2 100644 --- a/libkpimexchange/core/utils.h +++ b/libkpimexchange/core/utils.h @@ -21,30 +21,30 @@ #ifndef KDEPIM_EXCHANGE_UTILS_H #define KDEPIM_EXCHANGE_UTILS_H -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> #include <kurl.h> /** In a document doc with node node, add an element with name ns and tagname tag. Return the new element */ -QDomElement addElement( QDomDocument& doc, QDomNode& node, const QString& ns, const QString& tag ); +TQDomElement addElement( TQDomDocument& doc, TQDomNode& node, const TQString& ns, const TQString& tag ); /** In a document doc with node node, add an element with namespace ns and tagname tag. Add a textnode in the element with text contents text. Return the new element. */ -QDomElement addElement( QDomDocument& doc, QDomNode& node, const QString& ns, const QString& tag, const QString& text ); +TQDomElement addElement( TQDomDocument& doc, TQDomNode& node, const TQString& ns, const TQString& tag, const TQString& text ); /** * Return the representation of utc time in the time zone indicated by timeZoneId */ -QDateTime utcAsZone( const QDateTime& utc, const QString& timeZoneId ); +TQDateTime utcAsZone( const TQDateTime& utc, const TQString& timeZoneId ); /** * Return the UTC representation of local time in the time zone indicated by timeZoneId */ -QDateTime zoneAsUtc( const QDateTime& zone, const QString& timeZoneId ); +TQDateTime zoneAsUtc( const TQDateTime& zone, const TQString& timeZoneId ); /** * Convert http:// url to webdav:// and https:// to webdavs:// |