[gnome-calendar/calendar-editor] source-dialog: implement helper function



commit 9c8789599f7ad4324f1eef167379afc61cb9e11a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Apr 8 19:35:51 2015 -0300

    source-dialog: implement helper function

 src/gcal-source-dialog.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 0640755..54bc554 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);
 
@@ -368,6 +371,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:
  *
  * Create a GtkListBoxRow for a given


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]