aboutsummaryrefslogtreecommitdiff
path: root/src/planner-eds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/planner-eds.cpp')
-rw-r--r--src/planner-eds.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp
index 8bf4665..8eeca43 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>
@@ -408,11 +409,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)
{
@@ -517,8 +524,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);
}