summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 1edddac..6bdee18 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -187,48 +187,52 @@ void KOTodoViewItem::setMyPixmap()
pixi.resize(size, pixSize+size);
pPix.fill( Qt::red );
p.begin( &pixi );
p. drawPixmap ( 0, pixSize, pPix);
p.end();
pixSize += size;
}
// }
if ( pixi.width() > 1 ) {
setPixmap ( 0,pixi ) ;
} else {
setPixmap ( 0,QPixmap() ) ;
}
}
void KOTodoViewItem::stateChange(bool state)
{
// qDebug("KOTodoViewItem::stateChange ");
// do not change setting on startup
if ( m_init ) return;
if (isOn()!=state) {
setOn(state);
//qDebug("SETON ");
return;
}
+ if ( mTodo->isCompleted() == state ) {
+ //qDebug("STATECHANGE:nothing to do ");
+ return;
+ }
QString keyd = "==";
QString keyt = "==";
//qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1());
mTodo->setCompleted(state);
if (state) mTodo->setCompleted(QDateTime::currentDateTime());
if (mTodo->hasDueDate()) {
setText(3, mTodo->dtDueDateStr());
QDate d = mTodo->dtDue().date();
keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
setSortKey(3,keyd);
if (mTodo->doesFloat()) {
setText(4,"");
}
else {
setText(4,mTodo->dtDueTimeStr());
QTime t = mTodo->dtDue().time();
keyt.sprintf("%02d%02d",t.hour(),t.minute());
setSortKey(4,keyt);
}
}
if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);