diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-03-02 16:09:05 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-03-02 16:09:05 -0600 |
commit | 422401c1b00f0dfa8926acba116e33b29f2ad7d7 (patch) | |
tree | 846560db71988c75c514a5d9706327082a82293d /src/planner-eds.cpp | |
parent | e5f71ea767515f50f5ed8c34946a87746a3d4ed7 (diff) | |
parent | 58dd68d0f2d513f70c0348bc26bb6b4db09377df (diff) | |
download | ayatana-indicator-datetime-422401c1b00f0dfa8926acba116e33b29f2ad7d7.tar.gz ayatana-indicator-datetime-422401c1b00f0dfa8926acba116e33b29f2ad7d7.tar.bz2 ayatana-indicator-datetime-422401c1b00f0dfa8926acba116e33b29f2ad7d7.zip |
sync with trunk
Diffstat (limited to 'src/planner-eds.cpp')
-rw-r--r-- | src/planner-eds.cpp | 18 |
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); } |