summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-04-15 20:51:58 (UTC)
committer zautrix <zautrix>2005-04-15 20:51:58 (UTC)
commit85bdc33419eef0ffa9f00eb7222944518fe39b6c (patch) (unidiff)
tree57000de41f5e29c5ebd07f3ed2951a7b89730fb1 /libkcal
parente1d62b2afac2b625a3e0b8d4df137647de34e04f (diff)
downloadkdepimpi-85bdc33419eef0ffa9f00eb7222944518fe39b6c.zip
kdepimpi-85bdc33419eef0ffa9f00eb7222944518fe39b6c.tar.gz
kdepimpi-85bdc33419eef0ffa9f00eb7222944518fe39b6c.tar.bz2
fixxx
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp4
-rw-r--r--libkcal/todo.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 00a43e5..e75df70 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -73,24 +73,28 @@ bool CalendarLocal::load( const QString &fileName )
73 FileStorage storage( this, fileName ); 73 FileStorage storage( this, fileName );
74 return storage.load(); 74 return storage.load();
75} 75}
76 76
77bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 77bool CalendarLocal::save( const QString &fileName, CalFormat *format )
78{ 78{
79 FileStorage storage( this, fileName, format ); 79 FileStorage storage( this, fileName, format );
80 return storage.save(); 80 return storage.save();
81} 81}
82 82
83void CalendarLocal::close() 83void CalendarLocal::close()
84{ 84{
85
86 Todo * i;
87 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false);
88
85 mEventList.setAutoDelete( true ); 89 mEventList.setAutoDelete( true );
86 mTodoList.setAutoDelete( true ); 90 mTodoList.setAutoDelete( true );
87 mJournalList.setAutoDelete( false ); 91 mJournalList.setAutoDelete( false );
88 92
89 mEventList.clear(); 93 mEventList.clear();
90 mTodoList.clear(); 94 mTodoList.clear();
91 mJournalList.clear(); 95 mJournalList.clear();
92 96
93 mEventList.setAutoDelete( false ); 97 mEventList.setAutoDelete( false );
94 mTodoList.setAutoDelete( false ); 98 mTodoList.setAutoDelete( false );
95 mJournalList.setAutoDelete( false ); 99 mJournalList.setAutoDelete( false );
96 100
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index b89abce..5e6ac22 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -56,24 +56,25 @@ Todo::Todo(const Todo &t) : QObject(),Incidence(t)
56} 56}
57 57
58Todo::~Todo() 58Todo::~Todo()
59{ 59{
60 setRunning( false ); 60 setRunning( false );
61 //qDebug("Todo::~Todo() "); 61 //qDebug("Todo::~Todo() ");
62} 62}
63 63
64void Todo::setRunning( bool run ) 64void Todo::setRunning( bool run )
65{ 65{
66 if ( run == mRunning ) 66 if ( run == mRunning )
67 return; 67 return;
68 //qDebug("Todo::setRunning %d ", run);
68 if ( !mRunSaveTimer ) { 69 if ( !mRunSaveTimer ) {
69 mRunSaveTimer = new QTimer ( this ); 70 mRunSaveTimer = new QTimer ( this );
70 connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); 71 connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) );
71 } 72 }
72 mRunning = run; 73 mRunning = run;
73 if ( mRunning ) { 74 if ( mRunning ) {
74 mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min 75 mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min
75 mRunStart = QDateTime::currentDateTime(); 76 mRunStart = QDateTime::currentDateTime();
76 } else { 77 } else {
77 mRunSaveTimer->stop(); 78 mRunSaveTimer->stop();
78 saveRunningInfoToFile(); 79 saveRunningInfoToFile();
79 } 80 }