summaryrefslogtreecommitdiff
path: root/src/xcalconversions.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xcalconversions.h')
-rw-r--r--src/xcalconversions.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/xcalconversions.h b/src/xcalconversions.h
index 1390016..759893a 100644
--- a/src/xcalconversions.h
+++ b/src/xcalconversions.h
@@ -1014,7 +1014,8 @@ std::auto_ptr< icalendar_2_0::RrulePropType > recurrenceProperty(const Recurrenc
if (!r.byday().empty()) {
RecurType::byday_sequence byday;
- BOOST_FOREACH(const Kolab::DayPos &daypos, r.byday()) {
+ const std::vector<Kolab::DayPos> &l = r.byday();
+ BOOST_FOREACH(Kolab::DayPos daypos, l) {
byday.push_back(fromDayPos(daypos));
}
recur.byday(byday);
@@ -1112,8 +1113,8 @@ void getIncidenceProperties(T &prop, const I &inc)
}
if (!inc.attendees().empty()) {
-
- BOOST_FOREACH(const Kolab::Attendee &a, inc.attendees()) {
+ const std::vector<Kolab::Attendee> &l = inc.attendees();
+ BOOST_FOREACH(const Kolab::Attendee &a, l) {
const Kolab::ContactReference &c = a.contact();
typename properties::attendee_type attendee = fromContactReference<typename properties::attendee_type>(c);
@@ -1140,13 +1141,15 @@ void getIncidenceProperties(T &prop, const I &inc)
}
if (!inc.attachments().empty()) {
- BOOST_FOREACH(const Kolab::Attachment &a, inc.attachments()) {
+ const std::vector<Kolab::Attachment> &l = inc.attachments();
+ BOOST_FOREACH(const Kolab::Attachment &a, l) {
prop.attach().push_back(fromAttachment(a));
}
}
if (!inc.customProperties().empty()) {
- BOOST_FOREACH(const Kolab::CustomProperty &a, inc.customProperties()) {
+ const std::vector<Kolab::CustomProperty> &l = inc.customProperties();
+ BOOST_FOREACH(const Kolab::CustomProperty &a, l) {
prop.x_custom().push_back(typename properties::x_custom_type(a.identifier, a.value));
}
}
@@ -1206,7 +1209,8 @@ void getTodoEventProperties(T &prop, const I &inc)
template <typename KolabType, typename IncidenceType>
void setAlarms(typename KolabType::components_type& components, const IncidenceType &incidence)
{
- BOOST_FOREACH(const Kolab::Alarm &alarm, incidence.alarms()) {
+ const std::vector<Kolab::Alarm> &alarms = incidence.alarms();
+ BOOST_FOREACH(const Kolab::Alarm &alarm, alarms) {
typedef icalendar_2_0::ValarmType::properties_type PropType;
PropType::trigger_type trigger;
@@ -1237,14 +1241,16 @@ void setAlarms(typename KolabType::components_type& components, const IncidenceT
p = std::auto_ptr<PropType>(new PropType(PropType::action_type(DISPLAYALARM), trigger));
p->description(PropType::description_type(alarm.description()));
break;
- case Kolab::Alarm::EMailAlarm:
+ case Kolab::Alarm::EMailAlarm: {
p = std::auto_ptr<PropType>(new PropType(PropType::action_type(EMAILALARM), trigger));
p->summary(PropType::summary_type(alarm.summary()));
p->description(PropType::description_type(alarm.description()));
- BOOST_FOREACH(const Kolab::ContactReference &attendee, alarm.attendees()) {
+ const std::vector<Kolab::ContactReference> &l = alarm.attendees();
+ BOOST_FOREACH(const Kolab::ContactReference &attendee, l) {
p->attendee().push_back(icalendar_2_0::ContactType(toMailto(attendee.email(), attendee.name())));
}
break;
+ }
case Kolab::Alarm::AudioAlarm:
p = std::auto_ptr<PropType>(new PropType(PropType::action_type(AUDIOALARM), trigger));
p->description(PropType::description_type(alarm.description()));
@@ -1493,7 +1499,8 @@ template < > struct IncidenceTrait <Kolab::Todo>
if (!todo.relatedTo().empty()) {
icalendar_2_0::KolabTodo::properties_type::related_to_sequence list;
- BOOST_FOREACH(std::string relatedTo, todo.relatedTo()) {
+ const std::vector<std::string> &l = todo.relatedTo();
+ BOOST_FOREACH(const std::string &relatedTo, l) {
list.push_back(icalendar_2_0::KolabTodo::properties_type::related_to_type(relatedTo));
}
prop.related_to(list);