summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-06-17 09:29:18 (UTC)
committer zautrix <zautrix>2005-06-17 09:29:18 (UTC)
commit160b471e4d254fd45dbbd161178de15a14163a0c (patch) (side-by-side diff)
tree149a5bf6ef1eb0399c46c928a53d31fa298ac383 /libkcal
parentcd71ce2dd43e4cca3b3da3f599616e7b1b6b8deb (diff)
downloadkdepimpi-160b471e4d254fd45dbbd161178de15a14163a0c.zip
kdepimpi-160b471e4d254fd45dbbd161178de15a14163a0c.tar.gz
kdepimpi-160b471e4d254fd45dbbd161178de15a14163a0c.tar.bz2
fixxx
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp2
-rw-r--r--libkcal/todo.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 62b74f1..9a8b6e4 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -88,24 +88,26 @@ void Todo::setRunning( bool run )
}
mRunning = run;
if ( mRunning ) {
mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min
mRunStart = QDateTime::currentDateTime();
} else {
mRunSaveTimer->stop();
saveRunningInfoToFile();
}
}
void Todo::saveRunningInfo( QString comment, QDateTime start, QDateTime end )
{
+ if ( !mRunning) return;
+ mRunning = false;
mRunStart = start;
mRunEnd = end;
saveRunningInfoToFile( comment );
}
void Todo::saveRunningInfoToFile()
{
mRunEnd = QDateTime::currentDateTime();
saveRunningInfoToFile( QString::null );
}
void Todo::saveRunningInfoToFile( QString comment )
{
//qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 11f848e..425dfad 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -33,25 +33,24 @@ namespace KCal {
This class provides a Todo in the sense of RFC2445.
*/
class Todo : public QObject,public Incidence
{
Q_OBJECT
public:
Todo();
Todo(const Todo &);
~Todo();
typedef ListBase<Todo> List;
QCString type() const { return "Todo"; }
IncTypeID typeID() const { return todoID; }
- void saveRunningInfo( QString comment, QDateTime start, QDateTime end );
/** Return an exact copy of this todo. */
Incidence *clone();
QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const;
/** for setting the todo's due date/time with a QDateTime. */
void setDtDue(const QDateTime &dtDue);
/** returns an event's Due date/time as a QDateTime. */
QDateTime dtDue() const;
/** returns an event's due time as a string formatted according to the
users locale settings */
QString dtDueTimeStr() const;
@@ -117,24 +116,25 @@ namespace KCal {
/** Return true, if todo has a date associated with completion */
bool hasCompletedDate() const;
bool contains ( Todo*);
void checkSetCompletedFalse();
bool setRecurDates();
bool isRunning() {return mRunning;}
bool hasRunningSub();
void setRunning( bool );
void setRunningFalse( QString );
void stopRunning();
int runTime();
QDateTime runStart () const { return mRunStart;}
+ void saveRunningInfo( QString comment, QDateTime start, QDateTime end );
public slots:
void saveRunningInfoToFile( QString st );
void saveRunningInfoToFile( );
void saveParents();
private:
bool mRunning;
QTimer * mRunSaveTimer;
QDateTime mRunStart;
QDateTime mRunEnd;
bool accept(Visitor &v) { return v.visit(this); }
QDateTime mDtDue; // due date of todo