33 mHasStartDate =
false;
35 mHasCompletedDate =
false;
42 mHasDueDate = t.mHasDueDate;
43 mHasStartDate = t.mHasStartDate;
44 mCompleted = t.mCompleted;
45 mHasCompletedDate = t.mHasCompletedDate;
46 mPercentComplete = t.mPercentComplete;
47 mDtRecurrence = t.mDtRecurrence;
56 return new Todo( *
this );
60 Todo& Todo::operator=(
const Todo &t )
62 Incidence::operator=( t );
64 mHasDueDate = t.mHasDueDate;
65 mHasStartDate = t.mHasStartDate;
66 mCompleted = t.mCompleted;
67 mHasCompletedDate = t.mHasCompletedDate;
68 mPercentComplete = t.mPercentComplete;
69 mDtRecurrence = t.mDtRecurrence;
73 bool Todo::operator==(
const Todo& t2 )
const
97 mDtRecurrence =
dtDue;
119 if (
doesRecur() && !first && mDtRecurrence.isValid() ) {
120 return mDtRecurrence;
130 return KGlobal::locale()->formatTime(
dtDue(!
doesRecur()).time() );
135 return KGlobal::locale()->formatDate(
dtDue( !
doesRecur() ).date(),shortfmt);
141 return KGlobal::locale()->formatDateTime(
dtDue( !
doesRecur() ) );
151 if (mReadOnly)
return;
159 return mHasStartDate;
164 if (mReadOnly)
return;
167 if ( !
comments().grep(
"NoStartDate").count() )
170 TQString s(
"NoStartDate");
204 return KGlobal::locale()->formatTime(
dtStart(first).time());
209 return KGlobal::locale()->formatDate(
dtStart(first).date(),shortfmt);
214 return KGlobal::locale()->formatDateTime(
dtStart(first));
219 if (mPercentComplete == 100)
return true;
226 mPercentComplete = 100;
228 mPercentComplete = 0;
229 mHasCompletedDate =
false;
230 mCompleted = TQDateTime();
245 return KGlobal::locale()->formatDateTime(mCompleted);
251 mHasCompletedDate =
true;
252 mPercentComplete = 100;
260 return mHasCompletedDate;
265 return mPercentComplete;
270 mPercentComplete = v;
272 mHasCompletedDate =
false;
273 mCompleted = TQDateTime();
286 return mDtRecurrence.isValid() ? mDtRecurrence : mDtDue;
291 TQDate today = TQDate::currentDate();
293 !( date < today && mDtRecurrence.date() < today &&
297 bool Todo::recurTodo()
304 if ( ( r->
duration() == -1 || ( nextDate.isValid() && endDateTime.isValid()
305 && nextDate <= endDateTime ) ) ) {
307 while ( !
recursAt( nextDate ) || nextDate <= TQDateTime::currentDateTime() ) {
309 if ( !nextDate.isValid() ||
310 ( nextDate > endDateTime && r->
duration() != -1 ) ) {
330 bool inPast =
doesFloat() ?
dtDue().date() < TQDate::currentDate()
331 :
dtDue() < TQDateTime::currentDateTime();