Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 2c2965e..c0d45c9 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -119,25 +119,25 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
119 | QActionGroup *g = new QActionGroup( this ); | 119 | QActionGroup *g = new QActionGroup( this ); |
120 | g->setExclusive( TRUE ); | 120 | g->setExclusive( TRUE ); |
121 | 121 | ||
122 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), | 122 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), |
123 | QString::null, 0, this, 0 ); | 123 | QString::null, 0, this, 0 ); |
124 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); | 124 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); |
125 | a->addTo( sub_bar ); | 125 | a->addTo( sub_bar ); |
126 | 126 | ||
127 | a = new QAction( tr( "Today" ), Resource::loadPixmap( "to_day" ), QString::null, 0, g, 0 ); | 127 | a = new QAction( tr( "Today" ), Resource::loadPixmap( "to_day" ), QString::null, 0, g, 0 ); |
128 | connect( a, SIGNAL( activated() ), this, SLOT( slotToday() ) ); | 128 | connect( a, SIGNAL( activated() ), this, SLOT( slotToday() ) ); |
129 | a->addTo( sub_bar ); | 129 | a->addTo( sub_bar ); |
130 | a->addTo( view ); | 130 | a->addTo( view ); |
131 | 131 | ||
132 | a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 ); | 132 | a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 ); |
133 | connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) ); | 133 | connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) ); |
134 | a->addTo( sub_bar ); | 134 | a->addTo( sub_bar ); |
135 | a->addTo( view ); | 135 | a->addTo( view ); |
136 | a->setToggleAction( TRUE ); | 136 | a->setToggleAction( TRUE ); |
137 | a->setOn( TRUE ); | 137 | a->setOn( TRUE ); |
138 | dayAction = a; | 138 | dayAction = a; |
139 | 139 | ||
140 | a = new QAction( tr( "Week" ), Resource::loadPixmap( "week" ), QString::null, 0, g, 0 ); | 140 | a = new QAction( tr( "Week" ), Resource::loadPixmap( "week" ), QString::null, 0, g, 0 ); |
141 | connect( a, SIGNAL( activated() ), this, SLOT( viewWeek() ) ); | 141 | connect( a, SIGNAL( activated() ), this, SLOT( viewWeek() ) ); |
142 | a->addTo( sub_bar ); | 142 | a->addTo( sub_bar ); |
143 | a->addTo( view ); | 143 | a->addTo( view ); |
@@ -164,67 +164,67 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
164 | 164 | ||
165 | a = new QAction( tr( "Alarm and Start Time..." ), QString::null, 0, 0 ); | 165 | a = new QAction( tr( "Alarm and Start Time..." ), QString::null, 0, 0 ); |
166 | connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); | 166 | connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); |
167 | a->addTo( settings ); | 167 | a->addTo( settings ); |
168 | 168 | ||
169 | QPopupMenu *default_view = new QPopupMenu(this); | 169 | QPopupMenu *default_view = new QPopupMenu(this); |
170 | settings->insertItem( tr( "Default View" ),default_view ); | 170 | settings->insertItem( tr( "Default View" ),default_view ); |
171 | default_view->setCheckable(TRUE); | 171 | default_view->setCheckable(TRUE); |
172 | 172 | ||
173 | Config config("DateBook"); | 173 | Config config("DateBook"); |
174 | config.setGroup("Main"); | 174 | config.setGroup("Main"); |
175 | int current=config.readNumEntry("defaultview", DAY); | 175 | int current=config.readNumEntry("defaultview", DAY); |
176 | 176 | ||
177 | QActionGroup *ag = new QActionGroup(this); | 177 | QActionGroup *ag = new QActionGroup(this); |
178 | a = new QAction( tr( "Day" ), QString::null, 0, 0, 0, true ); | 178 | a = new QAction( tr( "Day" ), QString::null, 0, 0, 0, true ); |
179 | if (current==DAY) a->setOn(true), viewDay(); | 179 | if (current==DAY) a->setOn(true), viewDay(); |
180 | ag->insert(a); | 180 | ag->insert(a); |
181 | a = new QAction( tr( "Week" ), QString::null, 0, 0, 0, true ); | 181 | a = new QAction( tr( "Week" ), QString::null, 0, 0, 0, true ); |
182 | if (current==WEEK) a->setOn(true), viewWeek(); | 182 | if (current==WEEK) a->setOn(true), viewWeek(); |
183 | ag->insert(a); | 183 | ag->insert(a); |
184 | a = new QAction( tr( "WeekLst" ), QString::null, 0, 0, 0, true ); | 184 | a = new QAction( tr( "WeekLst" ), QString::null, 0, 0, 0, true ); |
185 | if (current==WEEKLST) a->setOn(true), viewWeekLst(); | 185 | if (current==WEEKLST) a->setOn(true), viewWeekLst(); |
186 | ag->insert(a); | 186 | ag->insert(a); |
187 | a = new QAction( tr( "Month" ), QString::null, 0, 0, 0, true ); | 187 | a = new QAction( tr( "Month" ), QString::null, 0, 0, 0, true ); |
188 | if (current==MONTH) a->setOn(true), viewMonth(); | 188 | if (current==MONTH) a->setOn(true), viewMonth(); |
189 | ag->insert(a); | 189 | ag->insert(a); |
190 | 190 | ||
191 | ag->addTo(default_view); | 191 | ag->addTo(default_view); |
192 | connect(ag, SIGNAL( selected ( QAction * ) ), | 192 | connect(ag, SIGNAL( selected ( QAction * ) ), |
193 | this, SLOT( newDefaultView(QAction *) ) | 193 | this, SLOT( newDefaultView(QAction *) ) |
194 | ); | 194 | ); |
195 | 195 | ||
196 | connect( qApp, SIGNAL(clockChanged(bool)), | 196 | connect( qApp, SIGNAL(clockChanged(bool)), |
197 | this, SLOT(changeClock(bool)) ); | 197 | this, SLOT(changeClock(bool)) ); |
198 | connect( qApp, SIGNAL(weekChanged(bool)), | 198 | connect( qApp, SIGNAL(weekChanged(bool)), |
199 | this, SLOT(changeWeek(bool)) ); | 199 | this, SLOT(changeWeek(bool)) ); |
200 | 200 | ||
201 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 201 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
202 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), | 202 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), |
203 | this, SLOT(appMessage(const QCString&, const QByteArray&)) ); | 203 | this, SLOT(appMessage(const QCString&, const QByteArray&)) ); |
204 | #endif | 204 | #endif |
205 | 205 | ||
206 | // listen on QPE/System | 206 | // listen on QPE/System |
207 | #if defined(Q_WS_QWS) | 207 | #if defined(Q_WS_QWS) |
208 | #if !defined(QT_NO_COP) | 208 | #if !defined(QT_NO_COP) |
209 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); | 209 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); |
210 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 210 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
211 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 211 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
212 | channel = new QCopChannel( "QPE/Datebook", this ); | 212 | channel = new QCopChannel( "QPE/Datebook", this ); |
213 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 213 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
214 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 214 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
215 | qDebug("olle\n"); | 215 | qDebug("olle\n"); |
216 | #endif | 216 | #endif |
217 | #endif | 217 | #endif |
218 | 218 | ||
219 | qDebug("done t=%d", t.elapsed() ); | 219 | qDebug("done t=%d", t.elapsed() ); |
220 | 220 | ||
221 | } | 221 | } |
222 | 222 | ||
223 | void DateBook::receive( const QCString &msg, const QByteArray &data ) | 223 | void DateBook::receive( const QCString &msg, const QByteArray &data ) |
224 | { | 224 | { |
225 | QDataStream stream( data, IO_ReadOnly ); | 225 | QDataStream stream( data, IO_ReadOnly ); |
226 | if ( msg == "timeChange(QString)" ) { | 226 | if ( msg == "timeChange(QString)" ) { |
227 | // update active view! | 227 | // update active view! |
228 | if ( dayAction->isOn() ) | 228 | if ( dayAction->isOn() ) |
229 | viewDay(); | 229 | viewDay(); |
230 | else if ( weekAction->isOn() ) | 230 | else if ( weekAction->isOn() ) |
@@ -300,25 +300,25 @@ QString DateBook::checkEvent(const Event &e) | |||
300 | } | 300 | } |
301 | 301 | ||
302 | if(checkFailed) | 302 | if(checkFailed) |
303 | return tr("Event duration is potentially longer\n" | 303 | return tr("Event duration is potentially longer\n" |
304 | "than interval between repeats."); | 304 | "than interval between repeats."); |
305 | 305 | ||
306 | return QString::null; | 306 | return QString::null; |
307 | } | 307 | } |
308 | 308 | ||
309 | QDate DateBook::currentDate() | 309 | QDate DateBook::currentDate() |
310 | { | 310 | { |
311 | QDate d = QDate::currentDate(); | 311 | QDate d = QDate::currentDate(); |
312 | 312 | ||
313 | if ( dayView && views->visibleWidget() == dayView ) { | 313 | if ( dayView && views->visibleWidget() == dayView ) { |
314 | d = dayView->date(); | 314 | d = dayView->date(); |
315 | } else if ( weekView && views->visibleWidget() == weekView ) { | 315 | } else if ( weekView && views->visibleWidget() == weekView ) { |
316 | d = weekView->date(); | 316 | d = weekView->date(); |
317 | } else if ( weekLstView && views->visibleWidget() == weekLstView ) { | 317 | } else if ( weekLstView && views->visibleWidget() == weekLstView ) { |
318 | d = weekLstView->date(); | 318 | d = weekLstView->date(); |
319 | } else if ( monthView && views->visibleWidget() == monthView ) { | 319 | } else if ( monthView && views->visibleWidget() == monthView ) { |
320 | d = monthView->selectedDate(); | 320 | d = monthView->selectedDate(); |
321 | } | 321 | } |
322 | 322 | ||
323 | return d; | 323 | return d; |
324 | } | 324 | } |
@@ -397,25 +397,25 @@ void DateBook::editEvent( const Event &e ) | |||
397 | entry->timezone->setEnabled( FALSE ); | 397 | entry->timezone->setEnabled( FALSE ); |
398 | sv->addChild( entry ); | 398 | sv->addChild( entry ); |
399 | 399 | ||
400 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 400 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
401 | editDlg.showMaximized(); | 401 | editDlg.showMaximized(); |
402 | #endif | 402 | #endif |
403 | while (editDlg.exec() ) { | 403 | while (editDlg.exec() ) { |
404 | Event newEv = entry->event(); | 404 | Event newEv = entry->event(); |
405 | newEv.setUid(e.uid()); // FIXME: Hack not to clear uid | 405 | newEv.setUid(e.uid()); // FIXME: Hack not to clear uid |
406 | QString error = checkEvent(newEv); | 406 | QString error = checkEvent(newEv); |
407 | if (!error.isNull()) { | 407 | if (!error.isNull()) { |
408 | if (QMessageBox::warning(this, "error box", | 408 | if (QMessageBox::warning(this, "error box", |
409 | error, "Fix it", "Continue", | 409 | error, "Fix it", "Continue", |
410 | 0, 0, 1) == 0) | 410 | 0, 0, 1) == 0) |
411 | continue; | 411 | continue; |
412 | } | 412 | } |
413 | db->editEvent(e, newEv); | 413 | db->editEvent(e, newEv); |
414 | emit newEvent(); | 414 | emit newEvent(); |
415 | break; | 415 | break; |
416 | } | 416 | } |
417 | } | 417 | } |
418 | 418 | ||
419 | void DateBook::removeEvent( const Event &e ) | 419 | void DateBook::removeEvent( const Event &e ) |
420 | { | 420 | { |
421 | if (syncing) { | 421 | if (syncing) { |
@@ -479,46 +479,46 @@ void DateBook::initWeek() | |||
479 | connect( this, SIGNAL( newEvent() ), | 479 | connect( this, SIGNAL( newEvent() ), |
480 | weekView, SLOT( redraw() ) ); | 480 | weekView, SLOT( redraw() ) ); |
481 | } | 481 | } |
482 | //But also get it right: the year that we display can be different | 482 | //But also get it right: the year that we display can be different |
483 | //from the year of the current date. So, first find the year | 483 | //from the year of the current date. So, first find the year |
484 | //number of the current week. | 484 | //number of the current week. |
485 | 485 | ||
486 | int yearNumber, totWeeks; | 486 | int yearNumber, totWeeks; |
487 | calcWeek( currentDate(), totWeeks, yearNumber, onMonday ); | 487 | calcWeek( currentDate(), totWeeks, yearNumber, onMonday ); |
488 | 488 | ||
489 | QDate d = QDate( yearNumber, 12, 31 ); | 489 | QDate d = QDate( yearNumber, 12, 31 ); |
490 | calcWeek( d, totWeeks, yearNumber, onMonday ); | 490 | calcWeek( d, totWeeks, yearNumber, onMonday ); |
491 | 491 | ||
492 | while ( totWeeks == 1 ) { | 492 | while ( totWeeks == 1 ) { |
493 | d = d.addDays( -1 ); | 493 | d = d.addDays( -1 ); |
494 | calcWeek( d, totWeeks, yearNumber, onMonday ); | 494 | calcWeek( d, totWeeks, yearNumber, onMonday ); |
495 | } | 495 | } |
496 | if ( totWeeks != weekView->totalWeeks() ) | 496 | if ( totWeeks != weekView->totalWeeks() ) |
497 | weekView->setTotalWeeks( totWeeks ); | 497 | weekView->setTotalWeeks( totWeeks ); |
498 | } | 498 | } |
499 | void DateBook::initWeekLst() { | 499 | void DateBook::initWeekLst() { |
500 | if ( !weekLstView ) { | 500 | if ( !weekLstView ) { |
501 | weekLstView = new DateBookWeekLst( ampm, onMonday, db, | 501 | weekLstView = new DateBookWeekLst( ampm, onMonday, db, |
502 | views, "weeklst view" ); | 502 | views, "weeklst view" ); |
503 | views->addWidget( weekLstView, WEEKLST ); | 503 | views->addWidget( weekLstView, WEEKLST ); |
504 | 504 | ||
505 | //weekLstView->setStartViewTime( startTime ); | 505 | //weekLstView->setStartViewTime( startTime ); |
506 | connect( weekLstView, SIGNAL( showDate( int, int, int ) ), | 506 | connect( weekLstView, SIGNAL( showDate( int, int, int ) ), |
507 | this, SLOT( showDay( int, int, int ) ) ); | 507 | this, SLOT( showDay( int, int, int ) ) ); |
508 | connect( weekLstView, SIGNAL( addEvent( const QDateTime &, | 508 | connect( weekLstView, SIGNAL( addEvent( const QDateTime &, |
509 | const QDateTime &, | 509 | const QDateTime &, |
510 | const QString & ) ), | 510 | const QString & ) ), |
511 | this, SLOT( slotNewEntry( const QDateTime &, | 511 | this, SLOT( slotNewEntry( const QDateTime &, |
512 | const QDateTime &, | 512 | const QDateTime &, |
513 | const QString & ) ) ); | 513 | const QString & ) ) ); |
514 | connect( this, SIGNAL( newEvent() ), | 514 | connect( this, SIGNAL( newEvent() ), |
515 | weekLstView, SLOT( redraw() ) ); | 515 | weekLstView, SLOT( redraw() ) ); |
516 | connect( weekLstView, SIGNAL( editEvent( const Event & ) ), | 516 | connect( weekLstView, SIGNAL( editEvent( const Event & ) ), |
517 | this, SLOT( editEvent( const Event & ) ) ); | 517 | this, SLOT( editEvent( const Event & ) ) ); |
518 | } | 518 | } |
519 | } | 519 | } |
520 | 520 | ||
521 | 521 | ||
522 | void DateBook::initMonth() | 522 | void DateBook::initMonth() |
523 | { | 523 | { |
524 | if ( !monthView ) { | 524 | if ( !monthView ) { |
@@ -531,25 +531,25 @@ void DateBook::initMonth() | |||
531 | qApp->processEvents(); | 531 | qApp->processEvents(); |
532 | } | 532 | } |
533 | } | 533 | } |
534 | 534 | ||
535 | void DateBook::loadSettings() | 535 | void DateBook::loadSettings() |
536 | { | 536 | { |
537 | { | 537 | { |
538 | Config config( "qpe" ); | 538 | Config config( "qpe" ); |
539 | config.setGroup("Time"); | 539 | config.setGroup("Time"); |
540 | ampm = config.readBoolEntry( "AMPM", TRUE ); | 540 | ampm = config.readBoolEntry( "AMPM", TRUE ); |
541 | onMonday = config.readBoolEntry( "MONDAY" ); | 541 | onMonday = config.readBoolEntry( "MONDAY" ); |
542 | } | 542 | } |
543 | 543 | ||
544 | { | 544 | { |
545 | Config config("DateBook"); | 545 | Config config("DateBook"); |
546 | config.setGroup("Main"); | 546 | config.setGroup("Main"); |
547 | startTime = config.readNumEntry("startviewtime", 8); | 547 | startTime = config.readNumEntry("startviewtime", 8); |
548 | aPreset = config.readBoolEntry("alarmpreset"); | 548 | aPreset = config.readBoolEntry("alarmpreset"); |
549 | presetTime = config.readNumEntry("presettime"); | 549 | presetTime = config.readNumEntry("presettime"); |
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | void DateBook::saveSettings() | 553 | void DateBook::saveSettings() |
554 | { | 554 | { |
555 | Config config( "qpe" ); | 555 | Config config( "qpe" ); |
@@ -557,25 +557,25 @@ void DateBook::saveSettings() | |||
557 | configDB.setGroup( "Main" ); | 557 | configDB.setGroup( "Main" ); |
558 | configDB.writeEntry("startviewtime",startTime); | 558 | configDB.writeEntry("startviewtime",startTime); |
559 | configDB.writeEntry("alarmpreset",aPreset); | 559 | configDB.writeEntry("alarmpreset",aPreset); |
560 | configDB.writeEntry("presettime",presetTime); | 560 | configDB.writeEntry("presettime",presetTime); |
561 | } | 561 | } |
562 | 562 | ||
563 | void DateBook::newDefaultView(QAction *a) { | 563 | void DateBook::newDefaultView(QAction *a) { |
564 | int val=DAY; | 564 | int val=DAY; |
565 | if (a->text() == "Day") val=DAY; | 565 | if (a->text() == "Day") val=DAY; |
566 | if (a->text() == "Week") val=WEEK; | 566 | if (a->text() == "Week") val=WEEK; |
567 | if (a->text() == "WeekLst") val=WEEKLST; | 567 | if (a->text() == "WeekLst") val=WEEKLST; |
568 | if (a->text() == "Month") val=MONTH; | 568 | if (a->text() == "Month") val=MONTH; |
569 | 569 | ||
570 | Config configDB( "DateBook" ); | 570 | Config configDB( "DateBook" ); |
571 | configDB.setGroup( "Main" ); | 571 | configDB.setGroup( "Main" ); |
572 | configDB.writeEntry("defaultview",val); | 572 | configDB.writeEntry("defaultview",val); |
573 | } | 573 | } |
574 | 574 | ||
575 | void DateBook::appMessage(const QCString& msg, const QByteArray& data) | 575 | void DateBook::appMessage(const QCString& msg, const QByteArray& data) |
576 | { | 576 | { |
577 | bool needShow = FALSE; | 577 | bool needShow = FALSE; |
578 | if ( msg == "alarm(QDateTime,int)" ) { | 578 | if ( msg == "alarm(QDateTime,int)" ) { |
579 | QDataStream ds(data,IO_ReadOnly); | 579 | QDataStream ds(data,IO_ReadOnly); |
580 | QDateTime when; int warn; | 580 | QDateTime when; int warn; |
581 | ds >> when >> warn; | 581 | ds >> when >> warn; |
@@ -679,25 +679,25 @@ void DateBook::reload() | |||
679 | 679 | ||
680 | void DateBook::flush() | 680 | void DateBook::flush() |
681 | { | 681 | { |
682 | syncing = TRUE; | 682 | syncing = TRUE; |
683 | db->save(); | 683 | db->save(); |
684 | } | 684 | } |
685 | 685 | ||
686 | void DateBook::timerEvent( QTimerEvent *e ) | 686 | void DateBook::timerEvent( QTimerEvent *e ) |
687 | { | 687 | { |
688 | if ( alarmCounter < 10 ) { | 688 | if ( alarmCounter < 10 ) { |
689 | alarmCounter++; | 689 | alarmCounter++; |
690 | Sound::soundAlarm(); | 690 | Sound::soundAlarm(); |
691 | } | 691 | } |
692 | else | 692 | else |
693 | killTimer( e->timerId() ); | 693 | killTimer( e->timerId() ); |
694 | } | 694 | } |
695 | 695 | ||
696 | void DateBook::changeClock( bool newClock ) | 696 | void DateBook::changeClock( bool newClock ) |
697 | { | 697 | { |
698 | ampm = newClock; | 698 | ampm = newClock; |
699 | // repaint the affected objects... | 699 | // repaint the affected objects... |
700 | if (dayView) dayView->redraw(); | 700 | if (dayView) dayView->redraw(); |
701 | if (weekView) weekView->redraw(); | 701 | if (weekView) weekView->redraw(); |
702 | if (weekLstView) weekLstView->redraw(); | 702 | if (weekLstView) weekLstView->redraw(); |
703 | } | 703 | } |
@@ -967,23 +967,25 @@ void DateBook::slotDoFind( const QString& txt, const QDate &dt, | |||
967 | } | 967 | } |
968 | } | 968 | } |
969 | 969 | ||
970 | Event DateBookDBHack::eventByUID(int uid) { | 970 | Event DateBookDBHack::eventByUID(int uid) { |
971 | 971 | ||
972 | // FIXME: Dirty Hacks to get hold of the private event lists | 972 | // FIXME: Dirty Hacks to get hold of the private event lists |
973 | QDate start; | 973 | QDate start; |
974 | QDate end=start.addDays(-1); | 974 | QDate end=start.addDays(-1); |
975 | QValueList<Event> myEventList=getNonRepeatingEvents(start,end); | 975 | QValueList<Event> myEventList=getNonRepeatingEvents(start,end); |
976 | QValueList<Event> myRepeatEvents=getRawRepeats(); | 976 | QValueList<Event> myRepeatEvents=getRawRepeats(); |
977 | 977 | ||
978 | QValueList<Event>::ConstIterator it; | 978 | QValueList<Event>::ConstIterator it; |
979 | 979 | ||
980 | for (it = myEventList.begin(); it != myEventList.end(); it++) { | 980 | for (it = myEventList.begin(); it != myEventList.end(); it++) { |
981 | if ((*it).uid() == uid) return *it; | 981 | if ((*it).uid() == uid) return *it; |
982 | } | 982 | } |
983 | for (it = myRepeatEvents.begin(); it != myRepeatEvents.end(); it++) { | 983 | for (it = myRepeatEvents.begin(); it != myRepeatEvents.end(); it++) { |
984 | if ((*it).uid() == uid) return *it; | 984 | if ((*it).uid() == uid) return *it; |
985 | } | 985 | } |
986 | 986 | ||
987 | qDebug("Event not found: uid=%d\n", uid); | 987 | qDebug("Event not found: uid=%d\n", uid); |
988 | Event ev; | ||
989 | return ev; // return at least | ||
988 | } | 990 | } |
989 | 991 | ||