From f314480d3eb0b11509d42ed0c357b2013f23b0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ove=20K=C3=A5ven?= Date: Sun, 12 Aug 2012 17:37:44 +0200 Subject: [PATCH] Activate the SyncSourceLogging stuff in the Maemo calendar backend. --- src/backends/maemo/MaemoCalendarSource.cpp | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/backends/maemo/MaemoCalendarSource.cpp b/src/backends/maemo/MaemoCalendarSource.cpp index bab5ea69..6b7300c1 100644 --- a/src/backends/maemo/MaemoCalendarSource.cpp +++ b/src/backends/maemo/MaemoCalendarSource.cpp @@ -46,6 +46,26 @@ MaemoCalendarSource::MaemoCalendarSource(int EntryType, int EntryFormat, TrackingSyncSource(params), entry_type(EntryType), entry_format(EntryFormat) { + switch (EntryType) { + case EVENT: + SyncSourceLogging::init(InitList("SUMMARY") + "LOCATION", + ", ", + m_operations); + break; + case TODO: + SyncSourceLogging::init(InitList("SUMMARY"), + ", ", + m_operations); + break; + case JOURNAL: + SyncSourceLogging::init(InitList("SUBJECT"), + ", ", + m_operations); + break; + default: + throwError("invalid calendar type"); + break; + } mc = CMulticalendar::MCInstance(); cal = NULL; if (!mc) { @@ -327,7 +347,20 @@ std::string MaemoCalendarSource::getDescription(const string &uid) int err; CComponent * c = cal->getEntry(uid, entry_type, err); if (c) { - ret = c->getSummary(); + list parts; + string str; + str = c->getSummary(); + if (!str.empty()) { + parts.push_back(str); + } + if (entry_type == EVENT) + { + str = c->getLocation(); + if (!str.empty()) { + parts.push_back(str); + } + } + ret = boost::join(parts, ", "); delete c; } return ret;