summaryrefslogtreecommitdiffabout
path: root/libkcal/todo.cpp
Unidiff
Diffstat (limited to 'libkcal/todo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 70a7711..29f725f 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -146,25 +146,25 @@ void Todo::timerSlotSaveRunningInfoToFile()
146 } 146 }
147 restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS ); 147 restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS );
148 saveRunningInfoToFile( QString::null ); 148 saveRunningInfoToFile( QString::null );
149} 149}
150void Todo::saveRunningInfoToFile() 150void Todo::saveRunningInfoToFile()
151{ 151{
152 mRunEnd = QDateTime::currentDateTime(); 152 mRunEnd = QDateTime::currentDateTime();
153 saveRunningInfoToFile( QString::null ); 153 saveRunningInfoToFile( QString::null );
154} 154}
155void Todo::saveRunningInfoToFile( QString comment ) 155void Todo::saveRunningInfoToFile( QString comment )
156{ 156{
157#ifndef DESKTOP_VERSION 157#ifndef DESKTOP_VERSION
158 QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); 158 //QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable );
159#endif 159#endif
160 //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); 160 //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
161 if ( mRunStart.secsTo ( mRunEnd) < 15 ) { 161 if ( mRunStart.secsTo ( mRunEnd) < 15 ) {
162 qDebug("Running time < 15 seconds. Skipped. "); 162 qDebug("Running time < 15 seconds. Skipped. ");
163 return; 163 return;
164 } 164 }
165 QString dir = KGlobalSettings::timeTrackerDir(); 165 QString dir = KGlobalSettings::timeTrackerDir();
166 //qDebug("%s ", dir.latin1()); 166 //qDebug("%s ", dir.latin1());
167 QString file = "%1%2%3-%4%5%6-"; 167 QString file = "%1%2%3-%4%5%6-";
168 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 ); 168 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 );
169 file.replace ( QRegExp (" "), "0" ); 169 file.replace ( QRegExp (" "), "0" );
170 file += uid(); 170 file += uid();
@@ -182,25 +182,25 @@ void Todo::saveRunningInfoToFile( QString comment )
182 QString des = to->description(); 182 QString des = to->description();
183 if ( des.isEmpty () ) 183 if ( des.isEmpty () )
184 to->setDescription( "TT-Note: " + comment ); 184 to->setDescription( "TT-Note: " + comment );
185 else 185 else
186 to->setDescription( "TT-Note: " + comment +"\n" + des ); 186 to->setDescription( "TT-Note: " + comment +"\n" + des );
187 } 187 }
188 cal.addIncidence( to ); 188 cal.addIncidence( to );
189 ICalFormat format( false ); 189 ICalFormat format( false );
190 file = dir +"/" +file +".ics"; 190 file = dir +"/" +file +".ics";
191 format.save( &cal, file ); 191 format.save( &cal, file );
192 saveParents(); 192 saveParents();
193#ifndef DESKTOP_VERSION 193#ifndef DESKTOP_VERSION
194 QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); 194 //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable );
195#endif 195#endif
196} 196}
197void Todo::saveParents() 197void Todo::saveParents()
198{ 198{
199 if (!relatedTo() ) 199 if (!relatedTo() )
200 return; 200 return;
201 Incidence * inc = relatedTo(); 201 Incidence * inc = relatedTo();
202 if ( inc->typeID() != todoID ) 202 if ( inc->typeID() != todoID )
203 return; 203 return;
204 Todo* to = (Todo*)inc; 204 Todo* to = (Todo*)inc;
205 bool saveTodo = false; 205 bool saveTodo = false;
206 QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; 206 QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics";