diff options
Diffstat (limited to 'kresources/slox/kcalresourceslox.cpp')
-rw-r--r-- | kresources/slox/kcalresourceslox.cpp | 296 |
1 files changed, 148 insertions, 148 deletions
diff --git a/kresources/slox/kcalresourceslox.cpp b/kresources/slox/kcalresourceslox.cpp index d446494f6..2fcb0baa3 100644 --- a/kresources/slox/kcalresourceslox.cpp +++ b/kresources/slox/kcalresourceslox.cpp @@ -22,11 +22,11 @@ #include <typeinfo> #include <stdlib.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kdebug.h> #include <kurl.h> @@ -173,9 +173,9 @@ bool KCalResourceSlox::doLoad() clearChanges(); - QString p = KURL( mPrefs->url() ).protocol(); + TQString p = KURL( mPrefs->url() ).protocol(); if ( p != "http" && p != "https" && p != "webdav" && p != "webdavs" ) { - QString err = i18n("Non-http protocol: '%1'").arg( p ); + TQString err = i18n("Non-http protocol: '%1'").arg( p ); kdDebug() << "KCalResourceSlox::load(): " << err << endl; loadError( err ); return false; @@ -202,17 +202,17 @@ void KCalResourceSlox::requestEvents() kdDebug() << "KCalResourceSlox::requestEvents(): " << url << endl; - QString lastsync = "0"; + TQString lastsync = "0"; if ( mPrefs->useLastSync() ) { - QDateTime dt = mPrefs->lastEventSync(); + TQDateTime dt = mPrefs->lastEventSync(); if ( dt.isValid() ) { lastsync = WebdavHandler::qDateTimeToSlox( dt.addDays( -1 ) ); } } - 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( this, doc, prop, fieldName( LastSync ), lastsync ); WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->calendarFolderId() ); if ( type() == "ox" ) { @@ -224,18 +224,18 @@ void KCalResourceSlox::requestEvents() kdDebug() << "REQUEST CALENDAR: \n" << doc.toString( 2 ) << endl; mLoadEventsJob = KIO::davPropFind( url, doc, "0", false ); - connect( mLoadEventsJob, SIGNAL( result( KIO::Job * ) ), - SLOT( slotLoadEventsResult( KIO::Job * ) ) ); - connect( mLoadEventsJob, SIGNAL( percent( KIO::Job *, unsigned long ) ), - SLOT( slotEventsProgress( KIO::Job *, unsigned long ) ) ); + connect( mLoadEventsJob, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotLoadEventsResult( KIO::Job * ) ) ); + connect( mLoadEventsJob, TQT_SIGNAL( percent( KIO::Job *, unsigned long ) ), + TQT_SLOT( slotEventsProgress( KIO::Job *, unsigned long ) ) ); mLoadEventsProgress = KPIM::ProgressManager::instance()->createProgressItem( KPIM::ProgressManager::getUniqueID(), i18n("Downloading events") ); connect( mLoadEventsProgress, - SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ), - SLOT( cancelLoadEvents() ) ); + TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ), + TQT_SLOT( cancelLoadEvents() ) ); - mPrefs->setLastEventSync( QDateTime::currentDateTime() ); + mPrefs->setLastEventSync( TQDateTime::currentDateTime() ); } void KCalResourceSlox::requestTodos() @@ -247,17 +247,17 @@ void KCalResourceSlox::requestTodos() kdDebug() << "KCalResourceSlox::requestTodos(): " << url << endl; - QString lastsync = "0"; + TQString lastsync = "0"; if ( mPrefs->useLastSync() ) { - QDateTime dt = mPrefs->lastTodoSync(); + TQDateTime dt = mPrefs->lastTodoSync(); if ( dt.isValid() ) { lastsync = WebdavHandler::qDateTimeToSlox( dt.addDays( -1 ) ); } } - 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( this, doc, prop, fieldName( LastSync ), lastsync ); WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->taskFolderId() ); if ( type() == "ox" ) { @@ -269,27 +269,27 @@ void KCalResourceSlox::requestTodos() kdDebug() << "REQUEST TASKS: \n" << doc.toString( 2 ) << endl; mLoadTodosJob = KIO::davPropFind( url, doc, "0", false ); - connect( mLoadTodosJob, SIGNAL( result( KIO::Job * ) ), - SLOT( slotLoadTodosResult( KIO::Job * ) ) ); - connect( mLoadTodosJob, SIGNAL( percent( KIO::Job *, unsigned long ) ), - SLOT( slotTodosProgress( KIO::Job *, unsigned long ) ) ); + connect( mLoadTodosJob, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotLoadTodosResult( KIO::Job * ) ) ); + connect( mLoadTodosJob, TQT_SIGNAL( percent( KIO::Job *, unsigned long ) ), + TQT_SLOT( slotTodosProgress( KIO::Job *, unsigned long ) ) ); mLoadTodosProgress = KPIM::ProgressManager::instance()->createProgressItem( KPIM::ProgressManager::getUniqueID(), i18n("Downloading to-dos") ); connect( mLoadTodosProgress, - SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ), - SLOT( cancelLoadTodos() ) ); + TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ), + TQT_SLOT( cancelLoadTodos() ) ); - mPrefs->setLastTodoSync( QDateTime::currentDateTime() ); + mPrefs->setLastTodoSync( TQDateTime::currentDateTime() ); } void KCalResourceSlox::uploadIncidences() { - QDomDocument doc; - QDomElement ms = WebdavHandler::addDavElement( doc, doc, "multistatus" ); - QDomElement pu = WebdavHandler::addDavElement( doc, ms, "propertyupdate" ); - QDomElement set = WebdavHandler::addElement( doc, pu, "D:set" ); - QDomElement prop = WebdavHandler::addElement( doc, set, "D:prop" ); + TQDomDocument doc; + TQDomElement ms = WebdavHandler::addDavElement( doc, doc, "multistatus" ); + TQDomElement pu = WebdavHandler::addDavElement( doc, ms, "propertyupdate" ); + TQDomElement set = WebdavHandler::addElement( doc, pu, "D:set" ); + TQDomElement prop = WebdavHandler::addElement( doc, set, "D:prop" ); mUploadIsDelete = false; Incidence::List added = addedIncidences(); @@ -320,7 +320,7 @@ void KCalResourceSlox::uploadIncidences() KURL url = mPrefs->url(); - QString sloxId = mUploadedIncidence->customProperty( "SLOX", "ID" ); + TQString sloxId = mUploadedIncidence->customProperty( "SLOX", "ID" ); if ( !sloxId.isEmpty() ) { WebdavHandler::addSloxElement( this, doc, prop, fieldName( ObjectId ), sloxId ); } else { @@ -348,8 +348,8 @@ void KCalResourceSlox::uploadIncidences() if ( type() == "ox" ) { WebdavHandler::addSloxElement( this, doc, prop, "method", "DELETE" ); } else { - QDomElement remove = WebdavHandler::addElement( doc, pu, "D:remove" ); - QDomElement prop = WebdavHandler::addElement( doc, remove, "D:prop" ); + TQDomElement remove = WebdavHandler::addElement( doc, pu, "D:remove" ); + TQDomElement prop = WebdavHandler::addElement( doc, remove, "D:prop" ); WebdavHandler::addSloxElement( this, doc, prop, "sloxid", sloxId ); } } else { @@ -378,20 +378,20 @@ void KCalResourceSlox::uploadIncidences() kdDebug() << "UPLOAD: \n" << doc.toString( 2 ) << endl; mUploadJob = KIO::davPropPatch( url, doc, false ); - connect( mUploadJob, SIGNAL( result( KIO::Job * ) ), - SLOT( slotUploadResult( KIO::Job * ) ) ); - connect( mUploadJob, SIGNAL( percent( KIO::Job *, unsigned long ) ), - SLOT( slotUploadProgress( KIO::Job *, unsigned long ) ) ); + connect( mUploadJob, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotUploadResult( KIO::Job * ) ) ); + connect( mUploadJob, TQT_SIGNAL( percent( KIO::Job *, unsigned long ) ), + TQT_SLOT( slotUploadProgress( KIO::Job *, unsigned long ) ) ); mUploadProgress = KPIM::ProgressManager::instance()->createProgressItem( KPIM::ProgressManager::getUniqueID(), i18n("Uploading incidence") ); connect( mUploadProgress, - SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ), - SLOT( cancelUpload() ) ); + TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ), + TQT_SLOT( cancelUpload() ) ); } -void KCalResourceSlox::createIncidenceAttributes( QDomDocument &doc, - QDomElement &parent, +void KCalResourceSlox::createIncidenceAttributes( TQDomDocument &doc, + TQDomElement &parent, Incidence *incidence ) { WebdavHandler::addSloxElement( this, doc, parent, fieldName( IncidenceTitle ), @@ -401,20 +401,20 @@ void KCalResourceSlox::createIncidenceAttributes( QDomDocument &doc, incidence->description() ); if ( incidence->attendeeCount() > 0 ) { - QDomElement members = WebdavHandler::addSloxElement( this, doc, parent, + TQDomElement members = WebdavHandler::addSloxElement( this, doc, parent, fieldName( Participants ) ); Attendee::List attendees = incidence->attendees(); Attendee::List::ConstIterator it; for( it = attendees.begin(); it != attendees.end(); ++it ) { if ( mAccounts ) { - QString userId = mAccounts->lookupId( (*it)->email() ); - QString status; + TQString userId = mAccounts->lookupId( (*it)->email() ); + TQString status; switch ( (*it)->status() ) { case Attendee::Accepted: status = "accept"; break; case Attendee::Declined: status = "decline"; break; default: status = "none"; break; } - QDomElement el = WebdavHandler::addSloxElement( this, doc, members, fieldName( Participant ), userId ); + TQDomElement el = WebdavHandler::addSloxElement( this, doc, members, fieldName( Participant ), userId ); el.setAttribute( "confirm", status ); } else { kdError() << "KCalResourceSlox: No accounts set." << endl; @@ -426,7 +426,7 @@ void KCalResourceSlox::createIncidenceAttributes( QDomDocument &doc, // TODO OX support if ( incidence->secrecy() == Incidence::SecrecyPublic && type() != "ox" ) { - QDomElement rights = WebdavHandler::addSloxElement( this, doc, parent, "readrights" ); + TQDomElement rights = WebdavHandler::addSloxElement( this, doc, parent, "readrights" ); WebdavHandler::addSloxElement( this, doc, rights, "group", "users" ); } @@ -434,7 +434,7 @@ void KCalResourceSlox::createIncidenceAttributes( QDomDocument &doc, KCal::Alarm::List alarms = incidence->alarms(); if ( !alarms.isEmpty() && alarms.first()->hasStartOffset() && alarms.first()->enabled() ) WebdavHandler::addSloxElement( this, doc, parent, fieldName( Reminder ), - QString::number( (-1) * alarms.first()->startOffset().asSeconds() / 60 ) ); + TQString::number( (-1) * alarms.first()->startOffset().asSeconds() / 60 ) ); else WebdavHandler::addSloxElement( this, doc, parent, fieldName( Reminder ), "0" ); @@ -442,11 +442,11 @@ void KCalResourceSlox::createIncidenceAttributes( QDomDocument &doc, WebdavHandler::addSloxElement( this, doc, parent, fieldName( Categories ), incidence->categories().join( ", " ) ); } -void KCalResourceSlox::createEventAttributes( QDomDocument &doc, - QDomElement &parent, +void KCalResourceSlox::createEventAttributes( TQDomDocument &doc, + TQDomElement &parent, Event *event ) { - QString folderId = mPrefs->calendarFolderId(); + TQString folderId = mPrefs->calendarFolderId(); if ( folderId.isEmpty() && type() == "ox" ) // SLOX and OX use diffrent default folders folderId = "-1"; WebdavHandler::addSloxElement( this, doc, parent, fieldName( FolderId ), folderId ); @@ -466,11 +466,11 @@ void KCalResourceSlox::createEventAttributes( QDomDocument &doc, } } -void KCalResourceSlox::createTodoAttributes( QDomDocument &doc, - QDomElement &parent, +void KCalResourceSlox::createTodoAttributes( TQDomDocument &doc, + TQDomElement &parent, Todo *todo ) { - QString folderId = mPrefs->taskFolderId(); + TQString folderId = mPrefs->taskFolderId(); if ( folderId.isEmpty() && type() == "ox" ) // SLOX and OX use diffrent default folders folderId = "-1"; WebdavHandler::addSloxElement( this, doc, parent, fieldName( FolderId ), folderId ); @@ -486,7 +486,7 @@ void KCalResourceSlox::createTodoAttributes( QDomDocument &doc, } int priority = todo->priority(); - QString txt; + TQString txt; switch ( priority ) { case 9: case 8: @@ -503,11 +503,11 @@ void KCalResourceSlox::createTodoAttributes( QDomDocument &doc, WebdavHandler::addSloxElement( this, doc, parent, fieldName( Priority ), txt ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( PercentComplete ), - QString::number( todo->percentComplete() ) ); + TQString::number( todo->percentComplete() ) ); } -void KCalResourceSlox::createRecurrenceAttributes( QDomDocument &doc, - QDomElement &parent, +void KCalResourceSlox::createRecurrenceAttributes( TQDomDocument &doc, + TQDomElement &parent, KCal::Incidence *incidence ) { if ( !incidence->doesRecur() ) { @@ -521,12 +521,12 @@ void KCalResourceSlox::createRecurrenceAttributes( QDomDocument &doc, case Recurrence::rDaily: WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "daily" ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceDailyFreq ), - QString::number( r->frequency() ) ); + TQString::number( r->frequency() ) ); break; case Recurrence::rWeekly: { WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "weekly" ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceWeeklyFreq ), - QString::number( r->frequency() ) ); + TQString::number( r->frequency() ) ); // TODO: SLOX support int oxDays = 0; for ( int i = 0; i < 7; ++i ) { @@ -534,33 +534,33 @@ void KCalResourceSlox::createRecurrenceAttributes( QDomDocument &doc, oxDays += 1 << ( ( i + 1 ) % 7 ); } if ( type() == "ox" ) - WebdavHandler::addSloxElement( this, doc, parent, "days", QString::number( oxDays ) ); + WebdavHandler::addSloxElement( this, doc, parent, "days", TQString::number( oxDays ) ); break; } case Recurrence::rMonthlyDay: WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "monthly" ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthlyFreq ), - QString::number( r->frequency() ) ); + TQString::number( r->frequency() ) ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthlyDay ), - QString::number( r->monthDays().first() ) ); + TQString::number( r->monthDays().first() ) ); break; case Recurrence::rMonthlyPos: { WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), type() == "ox" ? "monthly" : "monthly2" ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthly2Freq ), - QString::number( r->frequency() ) ); + TQString::number( r->frequency() ) ); RecurrenceRule::WDayPos wdp = r->monthPositions().first(); // TODO: SLOX support WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthly2Day ), - QString::number( 1 << wdp.day() ) ); + TQString::number( 1 << wdp.day() ) ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthly2Pos ), - QString::number( wdp.pos() ) ); + TQString::number( wdp.pos() ) ); break; } case Recurrence::rYearlyMonth: WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "yearly" ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearlyDay ), - QString::number( r->yearDates().first() ) ); + TQString::number( r->yearDates().first() ) ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearlyMonth ), - QString::number( r->yearMonths().first() + monthOffset ) ); + TQString::number( r->yearMonths().first() + monthOffset ) ); if ( type() == "ox" ) WebdavHandler::addSloxElement( this, doc, parent, "interval", "1" ); break; @@ -570,11 +570,11 @@ void KCalResourceSlox::createRecurrenceAttributes( QDomDocument &doc, RecurrenceRule::WDayPos wdp = r->monthPositions().first(); // TODO: SLOX support WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearly2Day ), - QString::number( 1 << wdp.day() ) ); + TQString::number( 1 << wdp.day() ) ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearly2Pos ), - QString::number( wdp.pos() ) ); + TQString::number( wdp.pos() ) ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearly2Month ), - QString::number( r->yearMonths().first() + monthOffset ) ); + TQString::number( r->yearMonths().first() + monthOffset ) ); if ( type() == "ox" ) WebdavHandler::addSloxElement( this, doc, parent, "interval", "1" ); break; } @@ -585,27 +585,27 @@ void KCalResourceSlox::createRecurrenceAttributes( QDomDocument &doc, WebdavHandler::qDateTimeToSlox( r->endDateTime() ) ); // delete exceptions DateList exlist = r->exDates(); - QStringList res; + TQStringList res; for ( DateList::Iterator it = exlist.begin(); it != exlist.end(); ++it ) res.append( WebdavHandler::qDateTimeToSlox( *it ) ); WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceDelEx ), res.join( "," ) ); } -void KCalResourceSlox::parseMembersAttribute( const QDomElement &e, +void KCalResourceSlox::parseMembersAttribute( const TQDomElement &e, Incidence *incidence ) { incidence->clearAttendees(); - QDomNode n; + TQDomNode n; for( n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement memberElement = n.toElement(); + TQDomElement memberElement = n.toElement(); if ( memberElement.tagName() == fieldName( Participant ) ) { - QString member = memberElement.text(); + TQString member = memberElement.text(); KABC::Addressee account; if ( mAccounts ) account = mAccounts->lookupUser( member ); else kdError() << "KCalResourceSlox: no accounts set" << endl; - QString name; - QString email; + TQString name; + TQString email; Attendee *a = incidence->attendeeByUid( member ); if ( account.isEmpty() ) { if ( a ) continue; @@ -624,7 +624,7 @@ void KCalResourceSlox::parseMembersAttribute( const QDomElement &e, a->setUid( member ); incidence->addAttendee( a ); } - QString status = memberElement.attribute( "confirm" ); + TQString status = memberElement.attribute( "confirm" ); if ( !status.isEmpty() ) { if ( status == "accept" ) { a->setStatus( Attendee::Accepted ); @@ -641,25 +641,25 @@ void KCalResourceSlox::parseMembersAttribute( const QDomElement &e, } } -void KCalResourceSlox::parseReadRightsAttribute( const QDomElement &e, +void KCalResourceSlox::parseReadRightsAttribute( const TQDomElement &e, Incidence *incidence ) { - QDomNode n; + TQDomNode n; for( n = e.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement rightElement = n.toElement(); + TQDomElement rightElement = n.toElement(); if ( rightElement.tagName() == "group" ) { - QString groupName = rightElement.text(); + TQString groupName = rightElement.text(); if ( groupName == "users" ) incidence->setSecrecy( Incidence::SecrecyPublic ); } } } -void KCalResourceSlox::parseIncidenceAttribute( const QDomElement &e, +void KCalResourceSlox::parseIncidenceAttribute( const TQDomElement &e, Incidence *incidence ) { - QString tag = e.tagName(); - QString text = decodeText( e.text() ); + TQString tag = e.tagName(); + TQString text = decodeText( e.text() ); if ( text.isEmpty() ) return; if ( tag == fieldName( IncidenceTitle ) ) { @@ -693,19 +693,19 @@ void KCalResourceSlox::parseIncidenceAttribute( const QDomElement &e, } else if ( tag == "readrights" ) { parseReadRightsAttribute( e, incidence ); } else if ( tag == fieldName( Categories ) ) { - incidence->setCategories( QStringList::split( QRegExp(",\\s*"), text ) ); + incidence->setCategories( TQStringList::split( TQRegExp(",\\s*"), text ) ); } } -void KCalResourceSlox::parseEventAttribute( const QDomElement &e, +void KCalResourceSlox::parseEventAttribute( const TQDomElement &e, Event *event ) { - QString tag = e.tagName(); - QString text = decodeText( e.text() ); + TQString tag = e.tagName(); + TQString text = decodeText( e.text() ); if ( text.isEmpty() ) return; if ( tag == fieldName( EventBegin ) ) { - QDateTime dt; + TQDateTime dt; if ( event->doesFloat() ) { if ( type() == "ox" ) dt = WebdavHandler::sloxToQDateTime( text, timeZoneId() ); @@ -715,7 +715,7 @@ void KCalResourceSlox::parseEventAttribute( const QDomElement &e, dt = WebdavHandler::sloxToQDateTime( text, timeZoneId() ); event->setDtStart( dt ); } else if ( tag == fieldName( EventEnd ) ) { - QDateTime dt; + TQDateTime dt; if ( event->doesFloat() ) { dt = WebdavHandler::sloxToQDateTime( text ); dt = dt.addSecs( -1 ); @@ -727,15 +727,15 @@ void KCalResourceSlox::parseEventAttribute( const QDomElement &e, } } -void KCalResourceSlox::parseRecurrence( const QDomNode &node, Event *event ) +void KCalResourceSlox::parseRecurrence( const TQDomNode &node, Event *event ) { - QString type; + TQString type; int dailyValue = -1; - QDateTime end; + TQDateTime end; int weeklyValue = -1; - QBitArray days( 7 ); // days, starting with monday + TQBitArray days( 7 ); // days, starting with monday bool daysSet = false; int monthlyValueDay = -1; @@ -754,12 +754,12 @@ void KCalResourceSlox::parseRecurrence( const QDomNode &node, Event *event ) DateList deleteExceptions; - QDomNode n; + TQDomNode n; for( n = node.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); - QString tag = e.tagName(); - QString text = decodeText( e.text() ); + TQDomElement e = n.toElement(); + TQString tag = e.tagName(); + TQString text = decodeText( e.text() ); kdDebug() << k_funcinfo << tag << ": " << text << endl; if ( tag == fieldName( RecurrenceType ) ) { @@ -818,8 +818,8 @@ void KCalResourceSlox::parseRecurrence( const QDomNode &node, Event *event ) yearlyMonth = text.toInt() + 1; // starts at 0 yearly2Month = text.toInt() + 1; } else if ( tag == fieldName( RecurrenceDelEx ) ) { - QStringList exdates = QStringList::split( ",", text ); - QStringList::Iterator it; + TQStringList exdates = TQStringList::split( ",", text ); + TQStringList::Iterator it; for ( it = exdates.begin(); it != exdates.end(); ++it ) deleteExceptions.append( WebdavHandler::sloxToQDateTime( *it ).date() ); } @@ -845,7 +845,7 @@ void KCalResourceSlox::parseRecurrence( const QDomNode &node, Event *event ) r->addYearlyMonth( yearlyMonth ); } else if ( type == "monthly2" ) { r->setMonthly( monthly2ValueMonth ); - QBitArray _days( 7 ); + TQBitArray _days( 7 ); if ( daysSet ) _days = days; else @@ -854,7 +854,7 @@ void KCalResourceSlox::parseRecurrence( const QDomNode &node, Event *event ) } else if ( type == "yearly2" ) { r->setYearly( 1 ); r->addYearlyMonth( yearly2Month ); - QBitArray _days( 7 ); + TQBitArray _days( 7 ); if ( daysSet ) _days = days; else @@ -865,21 +865,21 @@ void KCalResourceSlox::parseRecurrence( const QDomNode &node, Event *event ) r->setExDates( deleteExceptions ); } -void KCalResourceSlox::parseTodoAttribute( const QDomElement &e, +void KCalResourceSlox::parseTodoAttribute( const TQDomElement &e, Todo *todo ) { - QString tag = e.tagName(); - QString text = decodeText( e.text() ); + TQString tag = e.tagName(); + TQString text = decodeText( e.text() ); if ( text.isEmpty() ) return; if ( tag == fieldName( TaskBegin ) ) { - QDateTime dt = WebdavHandler::sloxToQDateTime( text ); + TQDateTime dt = WebdavHandler::sloxToQDateTime( text ); if ( dt.isValid() ) { todo->setDtStart( dt ); todo->setHasStartDate( true ); } } else if ( tag == fieldName( TaskEnd ) ) { - QDateTime dt = WebdavHandler::sloxToQDateTime( text ); + TQDateTime dt = WebdavHandler::sloxToQDateTime( text ); if ( dt.isValid() ) { todo->setDtDue( dt ); todo->setHasDueDate( true ); @@ -919,20 +919,20 @@ void KCalResourceSlox::slotLoadTodosResult( KIO::Job *job ) } else { kdDebug() << "KCalResourceSlox::slotLoadTodosJobResult() success" << endl; - QDomDocument doc = mLoadTodosJob->response(); + TQDomDocument doc = mLoadTodosJob->response(); mWebdavHandler.log( doc.toString( 2 ) ); - QValueList<SloxItem> items = WebdavHandler::getSloxItems( this, doc ); + TQValueList<SloxItem> items = WebdavHandler::getSloxItems( this, doc ); bool changed = false; disableChangeNotification(); - QValueList<SloxItem>::ConstIterator it; + TQValueList<SloxItem>::ConstIterator it; for( it = items.begin(); it != items.end(); ++it ) { SloxItem item = *it; - QString uid = sloxIdToTodoUid( item.sloxId ); + TQString uid = sloxIdToTodoUid( item.sloxId ); if ( item.status == SloxItem::Delete ) { Todo *todo = mCalendar.todo( uid ); if ( todo ) { @@ -953,9 +953,9 @@ void KCalResourceSlox::slotLoadTodosResult( KIO::Job *job ) mWebdavHandler.clearSloxAttributeStatus(); - QDomNode n; + TQDomNode n; for( n = item.domNode.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); mWebdavHandler.parseSloxAttribute( e ); parseIncidenceAttribute( e, todo ); parseTodoAttribute( e, todo ); @@ -993,20 +993,20 @@ void KCalResourceSlox::slotLoadEventsResult( KIO::Job *job ) } else { kdDebug() << "KCalResourceSlox::slotLoadEventsResult() success" << endl; - QDomDocument doc = mLoadEventsJob->response(); + TQDomDocument doc = mLoadEventsJob->response(); mWebdavHandler.log( doc.toString( 2 ) ); - QValueList<SloxItem> items = WebdavHandler::getSloxItems( this, doc ); + TQValueList<SloxItem> items = WebdavHandler::getSloxItems( this, doc ); bool changed = false; disableChangeNotification(); - QValueList<SloxItem>::ConstIterator it; + TQValueList<SloxItem>::ConstIterator it; for( it = items.begin(); it != items.end(); ++it ) { SloxItem item = *it; - QString uid = sloxIdToEventUid( item.sloxId ); + TQString uid = sloxIdToEventUid( item.sloxId ); if ( item.status == SloxItem::Delete ) { Event *event = mCalendar.event( uid ); if ( event ) { @@ -1025,7 +1025,7 @@ void KCalResourceSlox::slotLoadEventsResult( KIO::Job *job ) event->setCustomProperty( "SLOX", "ID", item.sloxId ); - QDomNode n = item.domNode.namedItem( fieldName( FullTime ) ); + TQDomNode n = item.domNode.namedItem( fieldName( FullTime ) ); event->setFloats( n.toElement().text() == boolToStr( true ) ); bool doesRecur = false; @@ -1033,7 +1033,7 @@ void KCalResourceSlox::slotLoadEventsResult( KIO::Job *job ) mWebdavHandler.clearSloxAttributeStatus(); for( n = item.domNode.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); mWebdavHandler.parseSloxAttribute( e ); parseIncidenceAttribute( e, event ); parseEventAttribute( e, event ); @@ -1089,69 +1089,69 @@ void KCalResourceSlox::slotUploadResult( KIO::Job *job ) return; } - QDomDocument doc = mUploadJob->response(); + TQDomDocument doc = mUploadJob->response(); kdDebug() << "UPLOAD RESULT:" << endl; kdDebug() << doc.toString( 2 ) << endl; - QDomElement docElement = doc.documentElement(); + TQDomElement docElement = doc.documentElement(); - QDomNode responseNode; + TQDomNode responseNode; for( responseNode = docElement.firstChild(); !responseNode.isNull(); responseNode = responseNode.nextSibling() ) { - QDomElement responseElement = responseNode.toElement(); + TQDomElement responseElement = responseNode.toElement(); if ( responseElement.tagName() == "response" ) { - QDomNode propstat = responseElement.namedItem( "propstat" ); + TQDomNode propstat = responseElement.namedItem( "propstat" ); if ( propstat.isNull() ) { kdError() << "Unable to find propstat tag." << endl; continue; } - QDomNode status = propstat.namedItem( "status" ); + TQDomNode status = propstat.namedItem( "status" ); if ( !status.isNull() ) { - QDomElement statusElement = status.toElement(); - QString response = statusElement.text(); + TQDomElement statusElement = status.toElement(); + TQString response = statusElement.text(); if ( !response.contains( "200" ) ) { - QString error = "'" + mUploadedIncidence->summary() + "'\n"; + TQString error = "'" + mUploadedIncidence->summary() + "'\n"; error += response; - QDomNode dn = propstat.namedItem( "responsedescription" ); - QString d = dn.toElement().text(); + TQDomNode dn = propstat.namedItem( "responsedescription" ); + TQString d = dn.toElement().text(); if ( !d.isEmpty() ) error += "\n" + d; saveError( error ); continue; } } - QDomNode prop = propstat.namedItem( "prop" ); + TQDomNode prop = propstat.namedItem( "prop" ); if ( prop.isNull() ) { kdError() << "Unable to find WebDAV property" << endl; continue; } - QDomNode sloxIdNode = prop.namedItem( fieldName( ObjectId ) ); + TQDomNode sloxIdNode = prop.namedItem( fieldName( ObjectId ) ); if ( sloxIdNode.isNull() ) { kdError() << "Unable to find SLOX id." << endl; continue; } - QDomElement sloxIdElement = sloxIdNode.toElement(); - QString sloxId = sloxIdElement.text(); + TQDomElement sloxIdElement = sloxIdNode.toElement(); + TQString sloxId = sloxIdElement.text(); kdDebug() << "SLOXID: " << sloxId << endl; if ( mUploadIsDelete ) { kdDebug() << "Incidence deleted" << endl; } else { - QDomNode clientIdNode = prop.namedItem( fieldName( ClientId ) ); + TQDomNode clientIdNode = prop.namedItem( fieldName( ClientId ) ); if ( clientIdNode.isNull() ) { kdError() << "Unable to find client id." << endl; continue; } - QDomElement clientidElement = clientIdNode.toElement(); - QString clientId = clientidElement.text(); + TQDomElement clientidElement = clientIdNode.toElement(); + TQString clientId = clientidElement.text(); kdDebug() << "CLIENTID: " << clientId << endl; Incidence *i = mUploadedIncidence->clone(); - QString uid; + TQString uid; if ( i->type() == "Event" ) uid = sloxIdToEventUid( sloxId ); else if ( i->type() == "Todo" ) uid = sloxIdToTodoUid( sloxId ); else { @@ -1228,7 +1228,7 @@ bool KCalResourceSlox::confirmSave() dlg.addIncidences( deletedIncidences(), i18n("Deleted") ); int result = dlg.exec(); - return result == QDialog::Accepted; + return result == TQDialog::Accepted; } bool KCalResourceSlox::doSave() @@ -1313,12 +1313,12 @@ void KCalResourceSlox::cancelUpload() if ( mUploadProgress ) mUploadProgress->setComplete(); } -QString KCalResourceSlox::sloxIdToEventUid( const QString &sloxId ) +TQString KCalResourceSlox::sloxIdToEventUid( const TQString &sloxId ) { return "KResources_SLOX_Event_" + sloxId; } -QString KCalResourceSlox::sloxIdToTodoUid( const QString &sloxId ) +TQString KCalResourceSlox::sloxIdToTodoUid( const TQString &sloxId ) { return "KResources_SLOX_Todo_" + sloxId; } |