From 68569cd802ddc6b53decee1d4c774572c625237e Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 8 Apr 2015 19:35:51 -0300 Subject: [PATCH] source-dialog: implement helper function --- src/gcal-source-dialog.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c index 06407557..54bc554f 100644 --- a/src/gcal-source-dialog.c +++ b/src/gcal-source-dialog.c @@ -118,6 +118,9 @@ static void display_header_func (GtkListBoxRow *r GtkListBoxRow *before, gpointer user_data); +static gboolean is_goa_source (GcalSourceDialog *dialog, + ESource *source); + static GtkWidget* make_row_from_source (GcalSourceDialog *dialog, ESource *source); @@ -367,6 +370,33 @@ display_header_func (GtkListBoxRow *row, } } +/** + * is_goa_source: + * + * Checks whether the source comes from + * a online account. + * + * Returns: %TRUE if the source came from a GOA account + */ +static gboolean +is_goa_source (GcalSourceDialog *dialog, + ESource *source) +{ + GcalSourceDialogPrivate *priv = dialog->priv; + ESource *parent; + gboolean is_goa; + + g_assert (source && E_IS_SOURCE (source)); + + parent = gcal_manager_get_source (priv->manager, e_source_get_parent (source)); + + is_goa = e_source_has_extension (parent, E_SOURCE_EXTENSION_GOA); + + g_object_unref (parent); + + return is_goa; +} + /** * make_row_from_source: *