diff --git a/src/gcal-utils.c b/src/gcal-utils.c index d93ad74c..83db78da 100644 --- a/src/gcal-utils.c +++ b/src/gcal-utils.c @@ -686,3 +686,21 @@ uri_get_fields (const gchar *uri, g_regex_unref (regex); return valid; } + +void +get_source_parent_name_color (GcalManager *manager, + ESource *source, + gchar **name, + gchar **color) +{ + ESource *parent_source; + + g_assert (source && E_IS_SOURCE (source)); + + parent_source = gcal_manager_get_source (manager, e_source_get_parent (source)); + + if (name) + *name = e_source_dup_display_name (parent_source); + if (color) + *color = g_strdup (get_color_name_from_source (parent_source)); +} diff --git a/src/gcal-utils.h b/src/gcal-utils.h index e4f6cc95..cbc8e7df 100644 --- a/src/gcal-utils.h +++ b/src/gcal-utils.h @@ -20,6 +20,7 @@ #ifndef __GCAL_UTILS_H__ #define __GCAL_UTILS_H__ +#include "gcal-manager.h" #include #include #include @@ -106,4 +107,9 @@ gboolean uri_get_fields (const gchar gchar **host, gchar **path); +void get_source_parent_name_color (GcalManager *manager, + ESource *source, + gchar **name, + gchar **color); + #endif // __GCAL_UTILS_H__