summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-06-27 04:48:41 (UTC)
committer zautrix <zautrix>2005-06-27 04:48:41 (UTC)
commit9b2bf31715226dfa8210f31843616a04f810f012 (patch) (unidiff)
treeb502c4a379b26f74621ba8fabb59fcb53f5a5679 /libkcal
parent2e566a307bb50ac595fe729ebed0f5336f2af5a8 (diff)
downloadkdepimpi-9b2bf31715226dfa8210f31843616a04f810f012.zip
kdepimpi-9b2bf31715226dfa8210f31843616a04f810f012.tar.gz
kdepimpi-9b2bf31715226dfa8210f31843616a04f810f012.tar.bz2
strat stop tod fixes
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.h1
-rw-r--r--libkcal/calendarlocal.cpp6
-rw-r--r--libkcal/calendarlocal.h1
-rw-r--r--libkcal/todo.cpp4
4 files changed, 10 insertions, 2 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 3b7b183..2efa355 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -74,12 +74,13 @@ public:
74 Clears out the current calendar, freeing all used memory etc. 74 Clears out the current calendar, freeing all used memory etc.
75 */ 75 */
76 virtual void close() = 0; 76 virtual void close() = 0;
77 virtual void addCalendar( Calendar* ) = 0; 77 virtual void addCalendar( Calendar* ) = 0;
78 virtual bool addCalendarFile( QString name, int id ) = 0; 78 virtual bool addCalendarFile( QString name, int id ) = 0;
79 virtual void setSyncEventsReadOnly() = 0; 79 virtual void setSyncEventsReadOnly() = 0;
80 virtual void stopAllTodos() = 0;
80 81
81 /** 82 /**
82 Sync changes in memory to persistant storage. 83 Sync changes in memory to persistant storage.
83 */ 84 */
84 virtual void save() = 0; 85 virtual void save() = 0;
85 virtual QPtrList<Event> getExternLastSyncEvents() = 0; 86 virtual QPtrList<Event> getExternLastSyncEvents() = 0;
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 8c4dde1..18f1af8 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -144,12 +144,18 @@ bool CalendarLocal::load( const QString &fileName )
144bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 144bool CalendarLocal::save( const QString &fileName, CalFormat *format )
145{ 145{
146 FileStorage storage( this, fileName, format ); 146 FileStorage storage( this, fileName, format );
147 return storage.save(); 147 return storage.save();
148} 148}
149 149
150void CalendarLocal::stopAllTodos()
151{
152 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
153 it->setRunning( false );
154
155}
150void CalendarLocal::close() 156void CalendarLocal::close()
151{ 157{
152 158
153 Todo * i; 159 Todo * i;
154 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); 160 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false);
155 161
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 0286b48..d32597f 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -43,12 +43,13 @@ class CalendarLocal : public Calendar
43 */ 43 */
44 CalendarLocal( const QString &timeZoneId ); 44 CalendarLocal( const QString &timeZoneId );
45 ~CalendarLocal(); 45 ~CalendarLocal();
46 void addCalendar( Calendar* ); 46 void addCalendar( Calendar* );
47 bool addCalendarFile( QString name, int id ); 47 bool addCalendarFile( QString name, int id );
48 void setSyncEventsReadOnly(); 48 void setSyncEventsReadOnly();
49 void stopAllTodos();
49 /** 50 /**
50 Loads a calendar on disk in vCalendar or iCalendar format into the current 51 Loads a calendar on disk in vCalendar or iCalendar format into the current
51 calendar. Any information already present is lost. 52 calendar. Any information already present is lost.
52 @return true, if successfull, false on error. 53 @return true, if successfull, false on error.
53 @param fileName the name of the calendar on disk. 54 @param fileName the name of the calendar on disk.
54 */ 55 */
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 9a8b6e4..5260051 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -108,14 +108,14 @@ void Todo::saveRunningInfoToFile()
108 mRunEnd = QDateTime::currentDateTime(); 108 mRunEnd = QDateTime::currentDateTime();
109 saveRunningInfoToFile( QString::null ); 109 saveRunningInfoToFile( QString::null );
110} 110}
111void Todo::saveRunningInfoToFile( QString comment ) 111void Todo::saveRunningInfoToFile( QString comment )
112{ 112{
113 //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); 113 //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
114 if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 10 ) { 114 if ( mRunStart.secsTo ( mRunEnd) < 15 ) {
115 qDebug("Running time < 30 seconds. Skipped. "); 115 qDebug("Running time < 15 seconds. Skipped. ");
116 return; 116 return;
117 } 117 }
118 QString dir = KGlobalSettings::timeTrackerDir(); 118 QString dir = KGlobalSettings::timeTrackerDir();
119 //qDebug("%s ", dir.latin1()); 119 //qDebug("%s ", dir.latin1());
120 QString file = "%1%2%3-%4%5%6-"; 120 QString file = "%1%2%3-%4%5%6-";
121 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ); 121 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 );