diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkcal/todo.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/todo.cpp')
-rw-r--r-- | libkcal/todo.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 87d34c4b1..9787ff2ad 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -82,7 +82,7 @@ bool Todo::operator==( const Todo& t2 ) const percentComplete() == t2.percentComplete(); } -void Todo::setDtDue(const QDateTime &dtDue, bool first ) +void Todo::setDtDue(const TQDateTime &dtDue, bool first ) { //int diffsecs = mDtDue.secsTo(dtDue); @@ -114,7 +114,7 @@ void Todo::setDtDue(const QDateTime &dtDue, bool first ) updated(); } -QDateTime Todo::dtDue( bool first ) const +TQDateTime Todo::dtDue( bool first ) const { if ( doesRecur() && !first && mDtRecurrence.isValid() ) return mDtRecurrence; @@ -122,18 +122,18 @@ QDateTime Todo::dtDue( bool first ) const return mDtDue; } -QString Todo::dtDueTimeStr() const +TQString Todo::dtDueTimeStr() const { return KGlobal::locale()->formatTime( dtDue(!doesRecur()).time() ); } -QString Todo::dtDueDateStr(bool shortfmt) const +TQString Todo::dtDueDateStr(bool shortfmt) const { return KGlobal::locale()->formatDate(dtDue( !doesRecur() ).date(),shortfmt); } // TODO: Add shortfmt param!!! -QString Todo::dtDueStr() const +TQString Todo::dtDueStr() const { return KGlobal::locale()->formatDateTime( dtDue( !doesRecur() ) ); } @@ -164,14 +164,14 @@ void Todo::setHasStartDate(bool f) if ( !comments().grep("NoStartDate").count() ) addComment("NoStartDate"); //TODO: --> custom flag? } else { - QString s("NoStartDate"); + TQString s("NoStartDate"); removeComment(s); } mHasStartDate = f; updated(); } -QDateTime Todo::dtStart( bool first ) const +TQDateTime Todo::dtStart( bool first ) const { if ( doesRecur() && !first ) return mDtRecurrence.addDays( dtDue( first ).daysTo( IncidenceBase::dtStart() ) ); @@ -179,7 +179,7 @@ QDateTime Todo::dtStart( bool first ) const return IncidenceBase::dtStart(); } -void Todo::setDtStart( const QDateTime &dtStart ) +void Todo::setDtStart( const TQDateTime &dtStart ) { // TODO: This doesn't seem right (rfc 2445/6 says, recurrence is calculated from the dtstart...) if ( doesRecur() ) { @@ -189,17 +189,17 @@ void Todo::setDtStart( const QDateTime &dtStart ) IncidenceBase::setDtStart( dtStart ); } -QString Todo::dtStartTimeStr( bool first ) const +TQString Todo::dtStartTimeStr( bool first ) const { return KGlobal::locale()->formatTime(dtStart(first).time()); } -QString Todo::dtStartDateStr(bool shortfmt, bool first) const +TQString Todo::dtStartDateStr(bool shortfmt, bool first) const { return KGlobal::locale()->formatDate(dtStart(first).date(),shortfmt); } -QString Todo::dtStartStr(bool first) const +TQString Todo::dtStartStr(bool first) const { return KGlobal::locale()->formatDateTime(dtStart(first)); } @@ -217,25 +217,25 @@ void Todo::setCompleted(bool completed) else { mPercentComplete = 0; mHasCompletedDate = false; - mCompleted = QDateTime(); + mCompleted = TQDateTime(); } updated(); } -QDateTime Todo::completed() const +TQDateTime Todo::completed() const { if ( hasCompletedDate() ) return mCompleted; else - return QDateTime(); + return TQDateTime(); } -QString Todo::completedStr() const +TQString Todo::completedStr() const { return KGlobal::locale()->formatDateTime(mCompleted); } -void Todo::setCompleted(const QDateTime &completed) +void Todo::setCompleted(const TQDateTime &completed) { if( !recurTodo() ) { mHasCompletedDate = true; @@ -262,19 +262,19 @@ void Todo::setPercentComplete(int v) updated(); } -void Todo::setDtRecurrence( const QDateTime &dt ) +void Todo::setDtRecurrence( const TQDateTime &dt ) { mDtRecurrence = dt; } -QDateTime Todo::dtRecurrence() const +TQDateTime Todo::dtRecurrence() const { return mDtRecurrence.isValid() ? mDtRecurrence : mDtDue; } -bool Todo::recursOn( const QDate &date ) const +bool Todo::recursOn( const TQDate &date ) const { - QDate today = QDate::currentDate(); + TQDate today = TQDate::currentDate(); return ( Incidence::recursOn(date) && !( date < today && mDtRecurrence.date() < today && mDtRecurrence > recurrence()->startDateTime() ) ); @@ -284,13 +284,13 @@ bool Todo::recurTodo() { if ( doesRecur() ) { Recurrence *r = recurrence(); - QDateTime endDateTime = r->endDateTime(); - QDateTime nextDate = r->getNextDateTime( dtDue() ); + TQDateTime endDateTime = r->endDateTime(); + TQDateTime nextDate = r->getNextDateTime( dtDue() ); if ( ( r->duration() == -1 || ( nextDate.isValid() && endDateTime.isValid() && nextDate <= endDateTime ) ) ) { - while ( !recursAt( nextDate ) || nextDate <= QDateTime::currentDateTime() ) { + while ( !recursAt( nextDate ) || nextDate <= TQDateTime::currentDateTime() ) { if ( !nextDate.isValid() || nextDate > endDateTime ) { return false; @@ -312,7 +312,7 @@ bool Todo::recurTodo() bool Todo::isOverdue() const { - bool inPast = doesFloat() ? dtDue().date() < QDate::currentDate() - : dtDue() < QDateTime::currentDateTime(); + bool inPast = doesFloat() ? dtDue().date() < TQDate::currentDate() + : dtDue() < TQDateTime::currentDateTime(); return ( inPast && !isCompleted() ); } |