aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-02-02 19:23:08 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-02-02 19:23:08 -0600
commita03811363619c178fd5156fa94eb5d5a4897afa5 (patch)
treedd624f24f45b2bdf7217e460102756d7509257c8
parent33425752728cef43c566a2ace5a54a3a31f6b36f (diff)
downloadayatana-indicator-datetime-a03811363619c178fd5156fa94eb5d5a4897afa5.tar.gz
ayatana-indicator-datetime-a03811363619c178fd5156fa94eb5d5a4897afa5.tar.bz2
ayatana-indicator-datetime-a03811363619c178fd5156fa94eb5d5a4897afa5.zip
aha! ubntu-ui-toolkit stores its alarms in E_SOURCE_EXTENSION_TASK_LIST instead of E_SOURCE_EXTENSION_CALENDAR. Let's handle both in indicator-datetime.
-rw-r--r--src/planner-eds.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp
index 22e834f..79b340a 100644
--- a/src/planner-eds.cpp
+++ b/src/planner-eds.cpp
@@ -86,23 +86,28 @@ private:
}
else
{
- auto self = static_cast<Impl*>(gself);
-
- g_signal_connect(r, "source-added", G_CALLBACK(on_source_added), self);
- g_signal_connect(r, "source-removed", G_CALLBACK(on_source_removed), self);
- g_signal_connect(r, "source-changed", G_CALLBACK(on_source_changed), self);
- g_signal_connect(r, "source-disabled", G_CALLBACK(on_source_disabled), self);
- g_signal_connect(r, "source-enabled", G_CALLBACK(on_source_enabled), self);
+ g_signal_connect(r, "source-added", G_CALLBACK(on_source_added), gself);
+ g_signal_connect(r, "source-removed", G_CALLBACK(on_source_removed), gself);
+ g_signal_connect(r, "source-changed", G_CALLBACK(on_source_changed), gself);
+ g_signal_connect(r, "source-disabled", G_CALLBACK(on_source_disabled), gself);
+ g_signal_connect(r, "source-enabled", G_CALLBACK(on_source_enabled), gself);
+ auto self = static_cast<Impl*>(gself);
self->m_source_registry = r;
-
- GList* sources = e_source_registry_list_sources(r, E_SOURCE_EXTENSION_CALENDAR);
- for (auto l=sources; l!=nullptr; l=l->next)
- on_source_added(r, E_SOURCE(l->data), gself);
- g_list_free_full(sources, g_object_unref);
+ self->add_sources_by_extension(E_SOURCE_EXTENSION_CALENDAR);
+ self->add_sources_by_extension(E_SOURCE_EXTENSION_TASK_LIST);
}
}
+ void add_sources_by_extension(const char* extension)
+ {
+ auto& r = m_source_registry;
+ auto sources = e_source_registry_list_sources(r, extension);
+ for (auto l=sources; l!=nullptr; l=l->next)
+ on_source_added(r, E_SOURCE(l->data), this);
+ g_list_free_full(sources, g_object_unref);
+ }
+
static void on_source_added(ESourceRegistry* registry, ESource* source, gpointer gself)
{
auto self = static_cast<Impl*>(gself);