From 3ce3c805e0db96ef61790ea6e74b6bde28f8c9e2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 26 Feb 2014 10:09:35 -0600 Subject: 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' --- src/planner-eds.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/planner-eds.cpp') diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp index da406eb..241e97f 100644 --- a/src/planner-eds.cpp +++ b/src/planner-eds.cpp @@ -516,8 +516,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); } -- cgit v1.2.3 From 69ed3bfcd45fc26e1fce01cba731494dc31554f2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 26 Feb 2014 11:34:20 -0600 Subject: in EdsPlanner's get_appointments(), sort 'em before returning them to the caller. --- src/planner-eds.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/planner-eds.cpp') diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp index da406eb..4f12ec1 100644 --- a/src/planner-eds.cpp +++ b/src/planner-eds.cpp @@ -26,6 +26,7 @@ #include #include +#include // std::sort() #include #include @@ -407,11 +408,17 @@ private: *** walk through the sources to build the appointment list **/ - std::shared_ptr 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 main_task(new Task(this, func), task_deleter); for (auto& kv : m_clients) { -- cgit v1.2.3