summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 07bfdbf..a12c43e 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -122,8 +122,9 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name
connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) );
sde->setDate( mTodo->runStart().date() );
ste->setTime( mTodo->runStart().time() );
- ede->setDate( QDate::currentDate());
- ete->setTime( QTime::currentTime() );
+ mStop = QDateTime::currentDateTime();
+ ede->setDate( mStop.date());
+ ete->setTime( mStop.time() );
QPushButton * ok = new QPushButton( i18n("Stop and save"), this );
lay->addWidget( ok );
ok->setDefault( true );
@@ -151,6 +152,14 @@ void KOStopTodoPrefs::accept()
i18n("Time mismatch!"));
return;
}
+ // restoring the seconds
+ if ( start == QDateTime( mTodo->runStart().date(),
+ QTime(mTodo->runStart().time().hour() , mTodo->runStart().time().minute() ) ) )
+ start = mTodo->runStart();
+ if ( stop == QDateTime( mStop.date(),
+ QTime( mStop.time().hour() , mStop.time().minute() ) ) )
+ stop = mStop;
+
mTodo->saveRunningInfo( mComment->text(), start, stop );
QDialog::accept();
}