aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog13
-rw-r--r--src/date-time.cpp12
-rw-r--r--src/planner-eds.cpp18
3 files changed, 36 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog
index e284f78..248d4a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+indicator-datetime (13.10.0+14.04.20140227-0ubuntu1) trusty; urgency=low
+
+ [ Charles Kerr ]
+ * Don't log E_CLIENT_ERROR_NOT_SUPPORTED errors returned by
+ e_cal_client_get_attachment_uris() -- we can silently interpret that
+ as 'no attachments' (LP: #1285212)
+ * DateTime::format(), don't pass NULL to a std::string's assignment
+ operator (LP: #1285243)
+ * In EdsPlanner's get_appointments(), sort 'em before returning them
+ to the caller. (LP: #1285249)
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 27 Feb 2014 10:59:26 +0000
+
indicator-datetime (13.10.0+14.04.20140225-0ubuntu1) trusty; urgency=low
[ Charles Kerr ]
diff --git a/src/date-time.cpp b/src/date-time.cpp
index e6d99cd..432d877 100644
--- a/src/date-time.cpp
+++ b/src/date-time.cpp
@@ -85,9 +85,15 @@ GDateTime* DateTime::get() const
std::string DateTime::format(const std::string& fmt) const
{
- const auto str = g_date_time_format(get(), fmt.c_str());
- std::string ret = str;
- g_free(str);
+ std::string ret;
+
+ gchar* str = g_date_time_format(get(), fmt.c_str());
+ if (str)
+ {
+ ret = str;
+ g_free(str);
+ }
+
return ret;
}
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp
index da406eb..a9eecf2 100644
--- a/src/planner-eds.cpp
+++ b/src/planner-eds.cpp
@@ -26,6 +26,7 @@
#include <libecal/libecal.h>
#include <libedataserver/libedataserver.h>
+#include <algorithm> // std::sort()
#include <map>
#include <set>
@@ -407,11 +408,17 @@ private:
*** walk through the sources to build the appointment list
**/
- std::shared_ptr<Task> main_task(new Task(this, func), [](Task* task){
+ auto task_deleter = [](Task* task){
+ // give the caller the (sorted) finished product
+ auto& a = task->appointments;
+ std::sort(a.begin(), a.end(), [](const Appointment& a, const Appointment& b){return a.begin < b.begin;});
+ task->func(a);
+ // we're done; delete the task
g_debug("time to delete task %p", (void*)task);
- task->func(task->appointments);
delete task;
- });
+ };
+
+ std::shared_ptr<Task> main_task(new Task(this, func), task_deleter);
for (auto& kv : m_clients)
{
@@ -516,8 +523,11 @@ private:
e_cal_client_get_attachment_uris_finish(E_CAL_CLIENT(client), res, &uris, &error);
if (error != nullptr)
{
- if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
+ !g_error_matches(error, E_CLIENT_ERROR, E_CLIENT_ERROR_NOT_SUPPORTED))
+ {
g_warning("Error getting appointment uris: %s", error->message);
+ }
g_error_free(error);
}