author | zautrix <zautrix> | 2005-04-17 08:24:43 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-17 08:24:43 (UTC) |
commit | fd67a473a94c5a3d63a89c52fb8f612cb19b5363 (patch) (unidiff) | |
tree | d5adc24b8c2662118934fb5ab7f6ac690ae21153 /libkcal | |
parent | 6cf5cc7d0b12af6bdc722e469f3f5aa293016c7d (diff) | |
download | kdepimpi-fd67a473a94c5a3d63a89c52fb8f612cb19b5363.zip kdepimpi-fd67a473a94c5a3d63a89c52fb8f612cb19b5363.tar.gz kdepimpi-fd67a473a94c5a3d63a89c52fb8f612cb19b5363.tar.bz2 |
fixes
-rw-r--r-- | libkcal/todo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 6a6c137..002d3f2 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -86,25 +86,25 @@ void Todo::saveRunningInfoToFile() | |||
86 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { | 86 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { |
87 | qDebug("Running time < 30 seconds. Skipped. "); | 87 | qDebug("Running time < 30 seconds. Skipped. "); |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | QString dir = KGlobalSettings::timeTrackerDir(); | 90 | QString dir = KGlobalSettings::timeTrackerDir(); |
91 | //qDebug("%s ", dir.latin1()); | 91 | //qDebug("%s ", dir.latin1()); |
92 | QString file = "%1%2%3-%4%5%6-"; | 92 | QString file = "%1%2%3-%4%5%6-"; |
93 | 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 ); | 93 | 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 ); |
94 | file.replace ( QRegExp (" "), "0" ); | 94 | file.replace ( QRegExp (" "), "0" ); |
95 | file += uid(); | 95 | file += uid(); |
96 | //qDebug("File %s ",file.latin1() ); | 96 | //qDebug("File %s ",file.latin1() ); |
97 | CalendarLocal cal; | 97 | CalendarLocal cal; |
98 | cal.setTimeZoneId( " 00:00 Europe/London(UTC)" ); | 98 | cal.setLocalTime(); |
99 | Todo * to = (Todo*) clone(); | 99 | Todo * to = (Todo*) clone(); |
100 | to->setFloats( false ); | 100 | to->setFloats( false ); |
101 | to->setDtStart( mRunStart ); | 101 | to->setDtStart( mRunStart ); |
102 | to->setHasStartDate( true ); | 102 | to->setHasStartDate( true ); |
103 | to->setDtDue( QDateTime::currentDateTime() ); | 103 | to->setDtDue( QDateTime::currentDateTime() ); |
104 | to->setHasDueDate( true ); | 104 | to->setHasDueDate( true ); |
105 | to->setUid( file ); | 105 | to->setUid( file ); |
106 | cal.addIncidence( to ); | 106 | cal.addIncidence( to ); |
107 | ICalFormat format; | 107 | ICalFormat format; |
108 | file = dir +"/" +file +".ics"; | 108 | file = dir +"/" +file +".ics"; |
109 | format.save( &cal, file ); | 109 | format.save( &cal, file ); |
110 | saveParents(); | 110 | saveParents(); |
@@ -120,25 +120,25 @@ void Todo::saveParents() | |||
120 | Todo* to = (Todo*)inc; | 120 | Todo* to = (Todo*)inc; |
121 | bool saveTodo = false; | 121 | bool saveTodo = false; |
122 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; | 122 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; |
123 | QFileInfo fi ( file ); | 123 | QFileInfo fi ( file ); |
124 | if ( fi.exists() ) { | 124 | if ( fi.exists() ) { |
125 | if ( fi.lastModified () < to->lastModified ()) | 125 | if ( fi.lastModified () < to->lastModified ()) |
126 | saveTodo = true; | 126 | saveTodo = true; |
127 | } else { | 127 | } else { |
128 | saveTodo = true; | 128 | saveTodo = true; |
129 | } | 129 | } |
130 | if ( saveTodo ) { | 130 | if ( saveTodo ) { |
131 | CalendarLocal cal; | 131 | CalendarLocal cal; |
132 | cal.setTimeZoneId( " 00:00 Europe/London(UTC)" ); | 132 | cal.setLocalTime(); |
133 | Todo * par = (Todo *) to->clone(); | 133 | Todo * par = (Todo *) to->clone(); |
134 | cal.addIncidence( par ); | 134 | cal.addIncidence( par ); |
135 | ICalFormat format; | 135 | ICalFormat format; |
136 | format.save( &cal, file ); | 136 | format.save( &cal, file ); |
137 | } | 137 | } |
138 | to->saveParents(); | 138 | to->saveParents(); |
139 | } | 139 | } |
140 | 140 | ||
141 | int Todo::runTime() | 141 | int Todo::runTime() |
142 | { | 142 | { |
143 | if ( !mRunning ) | 143 | if ( !mRunning ) |
144 | return 0; | 144 | return 0; |