summaryrefslogtreecommitdiffabout
path: root/libkcal/event.cpp
Unidiff
Diffstat (limited to 'libkcal/event.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/event.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index 9b99855..7cd81fa 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -152,49 +152,51 @@ bool Event::isMultiDay() const
152{ 152{
153 bool multi = !(dtStart().date() == dtEnd().date()); 153 bool multi = !(dtStart().date() == dtEnd().date());
154 return multi; 154 return multi;
155} 155}
156 156
157void Event::setTransparency(Event::Transparency transparency) 157void Event::setTransparency(Event::Transparency transparency)
158{ 158{
159 if (mReadOnly) return; 159 if (mReadOnly) return;
160 mTransparency = transparency; 160 mTransparency = transparency;
161 updated(); 161 updated();
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, QDateTime start_dt ) const 174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
175{ 175{
176 176 *ok = false;
177 if ( !alarmEnabled() )
178 return QDateTime ();
177 bool yes; 179 bool yes;
178 QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); 180 QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
179 if ( ! yes || cancelled() ) { 181 if ( ! yes || cancelled() ) {
180 *ok = false; 182 *ok = false;
181 return QDateTime (); 183 return QDateTime ();
182 } 184 }
183 185
184 bool enabled = false; 186 bool enabled = false;
185 Alarm* alarm; 187 Alarm* alarm;
186 int off = 0; 188 int off = 0;
187 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; 189 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
188 // if ( QDateTime::currentDateTime() > incidenceStart ){ 190 // if ( QDateTime::currentDateTime() > incidenceStart ){
189// *ok = false; 191// *ok = false;
190// return incidenceStart; 192// return incidenceStart;
191// } 193// }
192 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 194 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
193 if (alarm->enabled()) { 195 if (alarm->enabled()) {
194 if ( alarm->hasTime () ) { 196 if ( alarm->hasTime () ) {
195 if ( alarm->time() < alarmStart ) { 197 if ( alarm->time() < alarmStart ) {
196 alarmStart = alarm->time(); 198 alarmStart = alarm->time();
197 enabled = true; 199 enabled = true;
198 off = alarmStart.secsTo( incidenceStart ); 200 off = alarmStart.secsTo( incidenceStart );
199 } 201 }
200 202