summaryrefslogtreecommitdiffabout
path: root/libkcal/icalformatimpl.cpp
Unidiff
Diffstat (limited to 'libkcal/icalformatimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index fe7413f..2405682 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -692,18 +692,20 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
692 action = ICAL_ACTION_PROCEDURE; 692 action = ICAL_ACTION_PROCEDURE;
693 attach = icalattach_new_from_url( QFile::encodeName(alarm->programFile()).data() ); 693 attach = icalattach_new_from_url( QFile::encodeName(alarm->programFile()).data() );
694 icalcomponent_add_property(a,icalproperty_new_attach(attach)); 694 icalcomponent_add_property(a,icalproperty_new_attach(attach));
695 if (!alarm->programArguments().isEmpty()) { 695 if (!alarm->programArguments().isEmpty()) {
696 icalcomponent_add_property(a,icalproperty_new_description(alarm->programArguments().utf8())); 696 icalcomponent_add_property(a,icalproperty_new_description(alarm->programArguments().utf8()));
697 } 697 }
698 icalattach_unref( attach );
698 break; 699 break;
699 case Alarm::Audio: 700 case Alarm::Audio:
700 action = ICAL_ACTION_AUDIO; 701 action = ICAL_ACTION_AUDIO;
701 if (!alarm->audioFile().isEmpty()) { 702 if (!alarm->audioFile().isEmpty()) {
702 attach = icalattach_new_from_url(QFile::encodeName( alarm->audioFile() ).data()); 703 attach = icalattach_new_from_url(QFile::encodeName( alarm->audioFile() ).data());
703 icalcomponent_add_property(a,icalproperty_new_attach(attach)); 704 icalcomponent_add_property(a,icalproperty_new_attach(attach));
705 icalattach_unref( attach );
704 } 706 }
705 break; 707 break;
706 case Alarm::Email: { 708 case Alarm::Email: {
707 action = ICAL_ACTION_EMAIL; 709 action = ICAL_ACTION_EMAIL;
708 QValueList<Person> addresses = alarm->mailAddresses(); 710 QValueList<Person> addresses = alarm->mailAddresses();
709 for (QValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) { 711 for (QValueList<Person>::Iterator ad = addresses.begin(); ad != addresses.end(); ++ad) {
@@ -717,12 +719,13 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm)
717 icalcomponent_add_property(a,icalproperty_new_description(alarm->text().utf8())); 719 icalcomponent_add_property(a,icalproperty_new_description(alarm->text().utf8()));
718 QStringList attachments = alarm->mailAttachments(); 720 QStringList attachments = alarm->mailAttachments();
719 if (attachments.count() > 0) { 721 if (attachments.count() > 0) {
720 for (QStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) { 722 for (QStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) {
721 attach = icalattach_new_from_url(QFile::encodeName( *at ).data()); 723 attach = icalattach_new_from_url(QFile::encodeName( *at ).data());
722 icalcomponent_add_property(a,icalproperty_new_attach(attach)); 724 icalcomponent_add_property(a,icalproperty_new_attach(attach));
725 icalattach_unref( attach );
723 } 726 }
724 } 727 }
725 break; 728 break;
726 } 729 }
727 case Alarm::Display: 730 case Alarm::Display:
728 action = ICAL_ACTION_DISPLAY; 731 action = ICAL_ACTION_DISPLAY;