diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kresources/slox/kcalresourceslox.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/slox/kcalresourceslox.cpp')
-rw-r--r-- | kresources/slox/kcalresourceslox.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/kresources/slox/kcalresourceslox.cpp b/kresources/slox/kcalresourceslox.cpp index 668631d37..40afcd7e8 100644 --- a/kresources/slox/kcalresourceslox.cpp +++ b/kresources/slox/kcalresourceslox.cpp @@ -213,7 +213,7 @@ void KCalResourceSlox::requestEvents() } TQDomDocument doc; - TQDomElement root = WebdavHandler::addDavElement( doc, doc, "propfind" ); + TQDomElement root = WebdavHandler::addDavElement( doc, doc, "proptqfind" ); TQDomElement prop = WebdavHandler::addDavElement( doc, root, "prop" ); WebdavHandler::addSloxElement( this, doc, prop, fieldName( LastSync ), lastsync ); WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->calendarFolderId() ); @@ -258,7 +258,7 @@ void KCalResourceSlox::requestTodos() } TQDomDocument doc; - TQDomElement root = WebdavHandler::addDavElement( doc, doc, "propfind" ); + TQDomElement root = WebdavHandler::addDavElement( doc, doc, "proptqfind" ); TQDomElement prop = WebdavHandler::addDavElement( doc, root, "prop" ); WebdavHandler::addSloxElement( this, doc, prop, fieldName( LastSync ), lastsync ); WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->taskFolderId() ); @@ -393,17 +393,17 @@ void KCalResourceSlox::uploadIncidences() } void KCalResourceSlox::createIncidenceAttributes( TQDomDocument &doc, - TQDomElement &parent, + TQDomElement &tqparent, Incidence *incidence ) { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( IncidenceTitle ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( IncidenceTitle ), incidence->summary() ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( Description ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Description ), incidence->description() ); if ( incidence->attendeeCount() > 0 ) { - TQDomElement members = WebdavHandler::addSloxElement( this, doc, parent, + TQDomElement members = WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Participants ) ); Attendee::List attendees = incidence->attendees(); Attendee::List::ConstIterator it; @@ -428,62 +428,62 @@ void KCalResourceSlox::createIncidenceAttributes( TQDomDocument &doc, // TODO OX support if ( incidence->secrecy() == Incidence::SecrecyPublic && type() != "ox" ) { - TQDomElement rights = WebdavHandler::addSloxElement( this, doc, parent, "readrights" ); + TQDomElement rights = WebdavHandler::addSloxElement( this, doc, tqparent, "readrights" ); WebdavHandler::addSloxElement( this, doc, rights, "group", "users" ); } // set reminder as the number of minutes to the start of the event KCal::Alarm::List alarms = incidence->alarms(); if ( !alarms.isEmpty() && alarms.first()->hasStartOffset() && alarms.first()->enabled() ) - WebdavHandler::addSloxElement( this, doc, parent, fieldName( Reminder ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Reminder ), TQString::number( (-1) * alarms.first()->startOffset().asSeconds() / 60 ) ); else - WebdavHandler::addSloxElement( this, doc, parent, fieldName( Reminder ), "0" ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Reminder ), "0" ); // categories - WebdavHandler::addSloxElement( this, doc, parent, fieldName( Categories ), incidence->categories().join( ", " ) ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Categories ), incidence->categories().join( ", " ) ); } void KCalResourceSlox::createEventAttributes( TQDomDocument &doc, - TQDomElement &parent, + TQDomElement &tqparent, Event *event ) { 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 ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( FolderId ), folderId ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( EventBegin ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( EventBegin ), WebdavHandler::qDateTimeToSlox( event->dtStart(), timeZoneId() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( EventEnd ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( EventEnd ), WebdavHandler::qDateTimeToSlox( event->dtEnd(), timeZoneId() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( Location ), event->location() ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Location ), event->location() ); if ( event->doesFloat() ) { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( FullTime ), boolToStr( true ) ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( FullTime ), boolToStr( true ) ); } else { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( FullTime ), boolToStr( false ) ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( FullTime ), boolToStr( false ) ); } } void KCalResourceSlox::createTodoAttributes( TQDomDocument &doc, - TQDomElement &parent, + TQDomElement &tqparent, Todo *todo ) { 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 ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( FolderId ), folderId ); if ( todo->hasStartDate() ) { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( TaskBegin ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( TaskBegin ), WebdavHandler::qDateTimeToSlox( todo->dtStart(), timeZoneId() ) ); } if ( todo->hasDueDate() ) { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( TaskEnd ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( TaskEnd ), WebdavHandler::qDateTimeToSlox( todo->dtDue(), timeZoneId() ) ); } @@ -502,18 +502,18 @@ void KCalResourceSlox::createTodoAttributes( TQDomDocument &doc, txt = "2"; break; } - WebdavHandler::addSloxElement( this, doc, parent, fieldName( Priority ), txt ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( Priority ), txt ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( PercentComplete ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( PercentComplete ), TQString::number( todo->percentComplete() ) ); } void KCalResourceSlox::createRecurrenceAttributes( TQDomDocument &doc, - TQDomElement &parent, + TQDomElement &tqparent, KCal::Incidence *incidence ) { if ( !incidence->doesRecur() ) { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), type() == "ox" ? "none" : "no" ); return; } @@ -521,13 +521,13 @@ void KCalResourceSlox::createRecurrenceAttributes( TQDomDocument &doc, int monthOffset = ( type() == "ox" ? -1 : 0 ); switch ( r->recurrenceType() ) { case Recurrence::rDaily: - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "daily" ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceDailyFreq ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), "daily" ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceDailyFreq ), TQString::number( r->frequency() ) ); break; case Recurrence::rWeekly: { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "weekly" ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceWeeklyFreq ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), "weekly" ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceWeeklyFreq ), TQString::number( r->frequency() ) ); // TODO: SLOX support int oxDays = 0; @@ -536,61 +536,61 @@ void KCalResourceSlox::createRecurrenceAttributes( TQDomDocument &doc, oxDays += 1 << ( ( i + 1 ) % 7 ); } if ( type() == "ox" ) - WebdavHandler::addSloxElement( this, doc, parent, "days", TQString::number( oxDays ) ); + WebdavHandler::addSloxElement( this, doc, tqparent, "days", TQString::number( oxDays ) ); break; } case Recurrence::rMonthlyDay: - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "monthly" ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthlyFreq ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), "monthly" ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceMonthlyFreq ), TQString::number( r->frequency() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthlyDay ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceMonthlyDay ), TQString::number( r->monthDays().first() ) ); break; case Recurrence::rMonthlyPos: { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), type() == "ox" ? "monthly" : "monthly2" ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthly2Freq ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceMonthly2Freq ), TQString::number( r->frequency() ) ); RecurrenceRule::WDayPos wdp = r->monthPositions().first(); // TODO: SLOX support - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthly2Day ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceMonthly2Day ), TQString::number( 1 << wdp.day() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceMonthly2Pos ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceMonthly2Pos ), TQString::number( wdp.pos() ) ); break; } case Recurrence::rYearlyMonth: - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), "yearly" ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearlyDay ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), "yearly" ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceYearlyDay ), TQString::number( r->yearDates().first() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearlyMonth ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceYearlyMonth ), TQString::number( r->yearMonths().first() + monthOffset ) ); if ( type() == "ox" ) - WebdavHandler::addSloxElement( this, doc, parent, "interval", "1" ); + WebdavHandler::addSloxElement( this, doc, tqparent, "interval", "1" ); break; case Recurrence::rYearlyPos: { - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceType ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceType ), type() == "ox" ? "yearly" : "yearly2" ); RecurrenceRule::WDayPos wdp = r->monthPositions().first(); // TODO: SLOX support - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearly2Day ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceYearly2Day ), TQString::number( 1 << wdp.day() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearly2Pos ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceYearly2Pos ), TQString::number( wdp.pos() ) ); - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceYearly2Month ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceYearly2Month ), TQString::number( r->yearMonths().first() + monthOffset ) ); if ( type() == "ox" ) - WebdavHandler::addSloxElement( this, doc, parent, "interval", "1" ); + WebdavHandler::addSloxElement( this, doc, tqparent, "interval", "1" ); break; } default: kdDebug() << k_funcinfo << "unsupported recurrence type: " << r->recurrenceType() << endl; } - WebdavHandler::addSloxElement( this, doc, parent, fieldName( RecurrenceEnd ), + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceEnd ), WebdavHandler::qDateTimeToSlox( r->endDateTime() ) ); // delete exceptions DateList exlist = r->exDates(); 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( "," ) ); + WebdavHandler::addSloxElement( this, doc, tqparent, fieldName( RecurrenceDelEx ), res.join( "," ) ); } void KCalResourceSlox::parseMembersAttribute( const TQDomElement &e, @@ -629,11 +629,11 @@ void KCalResourceSlox::parseMembersAttribute( const TQDomElement &e, TQString status = memberElement.attribute( "confirm" ); if ( !status.isEmpty() ) { if ( status == "accept" ) { - a->seStatus( Attendee::Accepted ); + a->setqStatus( Attendee::Accepted ); } else if ( status == "decline" ) { - a->seStatus( Attendee::Declined ); + a->setqStatus( Attendee::Declined ); } else { - a->seStatus( Attendee::NeedsAction ); + a->setqStatus( Attendee::NeedsAction ); } } } else { @@ -710,19 +710,19 @@ void KCalResourceSlox::parseEventAttribute( const TQDomElement &e, TQDateTime dt; if ( event->doesFloat() ) { if ( type() == "ox" ) - dt = WebdavHandler::sloxToQDateTime( text, timeZoneId() ); + dt = WebdavHandler::sloxToTQDateTime( text, timeZoneId() ); else - dt = WebdavHandler::sloxToQDateTime( text ); // ### is this really correct for SLOX? + dt = WebdavHandler::sloxToTQDateTime( text ); // ### is this really correct for SLOX? } else - dt = WebdavHandler::sloxToQDateTime( text, timeZoneId() ); + dt = WebdavHandler::sloxToTQDateTime( text, timeZoneId() ); event->setDtStart( dt ); } else if ( tag == fieldName( EventEnd ) ) { TQDateTime dt; if ( event->doesFloat() ) { - dt = WebdavHandler::sloxToQDateTime( text ); + dt = WebdavHandler::sloxToTQDateTime( text ); dt = dt.addSecs( -1 ); } - else dt = WebdavHandler::sloxToQDateTime( text, timeZoneId() ); + else dt = WebdavHandler::sloxToTQDateTime( text, timeZoneId() ); event->setDtEnd( dt ); } else if ( tag == fieldName( Location ) ) { event->setLocation( text ); @@ -769,7 +769,7 @@ void KCalResourceSlox::parseRecurrence( const TQDomNode &node, Event *event ) } else if ( tag == "daily_value" ) { dailyValue = text.toInt(); } else if ( tag == fieldName( RecurrenceEnd ) ) { - end = WebdavHandler::sloxToQDateTime( text ); + end = WebdavHandler::sloxToTQDateTime( text ); } else if ( tag == "weekly_value" ) { weeklyValue = text.toInt(); } else if ( tag.left( 11 ) == "weekly_day_" ) { @@ -823,7 +823,7 @@ void KCalResourceSlox::parseRecurrence( const TQDomNode &node, Event *event ) TQStringList exdates = TQStringList::split( ",", text ); TQStringList::Iterator it; for ( it = exdates.begin(); it != exdates.end(); ++it ) - deleteExceptions.append( WebdavHandler::sloxToQDateTime( *it ).date() ); + deleteExceptions.append( WebdavHandler::sloxToTQDateTime( *it ).date() ); } } @@ -875,13 +875,13 @@ void KCalResourceSlox::parseTodoAttribute( const TQDomElement &e, if ( text.isEmpty() ) return; if ( tag == fieldName( TaskBegin ) ) { - TQDateTime dt = WebdavHandler::sloxToQDateTime( text ); + TQDateTime dt = WebdavHandler::sloxToTQDateTime( text ); if ( dt.isValid() ) { todo->setDtStart( dt ); todo->setHasStartDate( true ); } } else if ( tag == fieldName( TaskEnd ) ) { - TQDateTime dt = WebdavHandler::sloxToQDateTime( text ); + TQDateTime dt = WebdavHandler::sloxToTQDateTime( text ); if ( dt.isValid() ) { todo->setDtDue( dt ); todo->setHasDueDate( true ); @@ -953,7 +953,7 @@ void KCalResourceSlox::slotLoadTodosResult( KIO::Job *job ) todo->setCustomProperty( "SLOX", "ID", item.sloxId ); - mWebdavHandler.clearSloxAttributeStatus(); + mWebdavHandler.clearSloxAttributetqStatus(); TQDomNode n; for( n = item.domNode.firstChild(); !n.isNull(); n = n.nextSibling() ) { @@ -1032,7 +1032,7 @@ void KCalResourceSlox::slotLoadEventsResult( KIO::Job *job ) bool doesRecur = false; - mWebdavHandler.clearSloxAttributeStatus(); + mWebdavHandler.clearSloxAttributetqStatus(); for( n = item.domNode.firstChild(); !n.isNull(); n = n.nextSibling() ) { TQDomElement e = n.toElement(); |