diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-02-25 09:37:37 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-02-25 09:37:37 -0600 |
commit | 7c9e1197d27170a3cb43e61b523a3b01a0c1f4bd (patch) | |
tree | 180c4a595b0679678f3003ea2053c5ed9b86c66f /src | |
parent | e3ce38f4690f01968fb9cc5da5aa606fe9fcc499 (diff) | |
download | ayatana-indicator-datetime-7c9e1197d27170a3cb43e61b523a3b01a0c1f4bd.tar.gz ayatana-indicator-datetime-7c9e1197d27170a3cb43e61b523a3b01a0c1f4bd.tar.bz2 ayatana-indicator-datetime-7c9e1197d27170a3cb43e61b523a3b01a0c1f4bd.zip |
In EdsPlanner::on_source_enabled(), don't use ESources that don't have calendars or tasks.
Diffstat (limited to 'src')
-rw-r--r-- | src/planner-eds.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp index 7d9416c..ee023a4 100644 --- a/src/planner-eds.cpp +++ b/src/planner-eds.cpp @@ -128,20 +128,33 @@ private: { auto self = static_cast<Impl*>(gself); ECalClientSourceType source_type; + bool client_wanted = false; if (e_source_has_extension(source, E_SOURCE_EXTENSION_CALENDAR)) + { source_type = E_CAL_CLIENT_SOURCE_TYPE_EVENTS; + client_wanted = true; + } else if (e_source_has_extension(source, E_SOURCE_EXTENSION_TASK_LIST)) + { source_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS; + client_wanted = true; + } + + const auto source_uid = e_source_get_uid(source); + if (client_wanted) + { + g_debug("%s connecting a client to source %s", G_STRFUNC, source_uid); + e_cal_client_connect(source, + source_type, + self->m_cancellable, + on_client_connected, + gself); + } else - g_assert_not_reached(); - - g_debug("connecting a client to source %s", e_source_get_uid(source)); - e_cal_client_connect(source, - source_type, - self->m_cancellable, - on_client_connected, - gself); + { + g_debug("%s not using source %s -- no tasks/calendar", G_STRFUNC, source_uid); + } } static void on_client_connected(GObject* /*source*/, GAsyncResult * res, gpointer gself) |