-rw-r--r-- | korganizer/kolistview.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 7783dd4..d25f671 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -514,15 +514,13 @@ void KOListView::setAlarm() | |||
514 | int count = 0; | 514 | int count = 0; |
515 | while ( inc ) { | 515 | while ( inc ) { |
516 | ++count; | 516 | ++count; |
517 | if (kap.mAlarmButton->isChecked()) { | 517 | if (kap.mAlarmButton->isChecked()) { |
518 | if (inc->alarms().count() == 0) | 518 | if (inc->alarms().count() == 0) |
519 | inc->newAlarm(); | 519 | inc->newAlarm(); |
520 | QPtrList<Alarm> alarms = inc->alarms(); | 520 | Alarm *alarm = inc->alarms().first(); |
521 | Alarm *alarm; | ||
522 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | ||
523 | alarm->setEnabled(true); | 521 | alarm->setEnabled(true); |
524 | int j = kap.mAlarmTimeEdit->value()* -60; | 522 | int j = kap.mAlarmTimeEdit->value()* -60; |
525 | if (kap.mAlarmIncrCombo->currentItem() == 1) | 523 | if (kap.mAlarmIncrCombo->currentItem() == 1) |
526 | j = j * 60; | 524 | j = j * 60; |
527 | else if (kap.mAlarmIncrCombo->currentItem() == 2) | 525 | else if (kap.mAlarmIncrCombo->currentItem() == 2) |
528 | j = j * (60 * 24); | 526 | j = j * (60 * 24); |
@@ -532,19 +530,16 @@ void KOListView::setAlarm() | |||
532 | alarm->setProcedureAlarm(kap.mAlarmProgram); | 530 | alarm->setProcedureAlarm(kap.mAlarmProgram); |
533 | } | 531 | } |
534 | else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) | 532 | else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) |
535 | alarm->setAudioAlarm(kap.mAlarmSound); | 533 | alarm->setAudioAlarm(kap.mAlarmSound); |
536 | else | 534 | else |
537 | alarm->setType(Alarm::Invalid); | 535 | alarm->setType(Alarm::Invalid); |
538 | //alarm->setAudioAlarm("default"); | ||
539 | // TODO: Deal with multiple alarms | ||
540 | break; // For now, stop after the first alarm | ||
541 | } | ||
542 | } else { | 536 | } else { |
543 | Alarm* alarm = inc->alarms().first(); | 537 | QPtrList<Alarm> alarms = inc->alarms(); |
544 | if ( alarm ) { | 538 | Alarm *alarm; |
539 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | ||
545 | alarm->setEnabled(false); | 540 | alarm->setEnabled(false); |
546 | alarm->setType(Alarm::Invalid); | 541 | alarm->setType(Alarm::Invalid); |
547 | } | 542 | } |
548 | } | 543 | } |
549 | KOListViewItem* item = getItemForEvent(inc); | 544 | KOListViewItem* item = getItemForEvent(inc); |
550 | if (item) { | 545 | if (item) { |