summaryrefslogtreecommitdiffabout
path: root/libkcal/event.cpp
Unidiff
Diffstat (limited to 'libkcal/event.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/event.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index de8dceb..9b99855 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -162,29 +162,29 @@ void Event::setTransparency(Event::Transparency transparency)
162} 162}
163 163
164Event::Transparency Event::transparency() const 164Event::Transparency Event::transparency() const
165{ 165{
166 return mTransparency; 166 return mTransparency;
167} 167}
168 168
169void Event::setDuration(int seconds) 169void Event::setDuration(int seconds)
170{ 170{
171 setHasEndDate(false); 171 setHasEndDate(false);
172 Incidence::setDuration(seconds); 172 Incidence::setDuration(seconds);
173} 173}
174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const 174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
175{ 175{
176 176
177 bool yes; 177 bool yes;
178 QDateTime incidenceStart = getNextOccurence( QDateTime::currentDateTime(), &yes ); 178 QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
179 if ( ! yes || cancelled() ) { 179 if ( ! yes || cancelled() ) {
180 *ok = false; 180 *ok = false;
181 return QDateTime (); 181 return QDateTime ();
182 } 182 }
183 183
184 bool enabled = false; 184 bool enabled = false;
185 Alarm* alarm; 185 Alarm* alarm;
186 int off = 0; 186 int off = 0;
187 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; 187 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
188 // if ( QDateTime::currentDateTime() > incidenceStart ){ 188 // if ( QDateTime::currentDateTime() > incidenceStart ){
189// *ok = false; 189// *ok = false;
190// return incidenceStart; 190// return incidenceStart;
@@ -200,22 +200,22 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const
200 200
201 } else { 201 } else {
202 int secs = alarm->startOffset().asSeconds(); 202 int secs = alarm->startOffset().asSeconds();
203 if ( incidenceStart.addSecs( secs ) < alarmStart ) { 203 if ( incidenceStart.addSecs( secs ) < alarmStart ) {
204 alarmStart = incidenceStart.addSecs( secs ); 204 alarmStart = incidenceStart.addSecs( secs );
205 enabled = true; 205 enabled = true;
206 off = -secs; 206 off = -secs;
207 } 207 }
208 } 208 }
209 } 209 }
210 } 210 }
211 if ( enabled ) { 211 if ( enabled ) {
212 if ( alarmStart > QDateTime::currentDateTime() ) { 212 if ( alarmStart > start_dt ) {
213 *ok = true; 213 *ok = true;
214 * offset = off; 214 * offset = off;
215 return alarmStart; 215 return alarmStart;
216 } 216 }
217 } 217 }
218 *ok = false; 218 *ok = false;
219 return QDateTime (); 219 return QDateTime ();
220 220
221} 221}