/* URI of the calendar that is being loaded or is already loaded, or
* NULL if we are not loaded.
*/
+ ESource *source;
char *uri;
CalObjType type;
priv->load_state = E_CAL_LOAD_NOT_LOADED;
+ if (priv->source) {
+ g_object_unref (priv->source);
+ priv->source = NULL;
+ }
+
if (priv->uri) {
g_free (priv->uri);
priv->uri = NULL;
return FALSE;
}
+ g_object_ref (source);
+ priv->source = source;
+
priv->uri = g_strdup (str_uri);
priv->type = type;
}
/**
+ * e_cal_get_source:
+ * @ecal: A calendar ecal.
+ *
+ * Queries the source that is open in a calendar ecal.
+ *
+ * Return value: The source of the calendar that is already loaded or is being
+ * loaded, or NULL if the ecal has not started a load request yet.
+ **/
+ESource *
+e_cal_get_source (ECal *ecal)
+{
+ ECalPrivate *priv;
+
+ g_return_val_if_fail (ecal != NULL, NULL);
+ g_return_val_if_fail (E_IS_CAL (ecal), NULL);
+
+ priv = ecal->priv;
+ return priv->source;
+}
+
+/**
* e_cal_get_uri:
* @ecal: A calendar ecal.
*
ECalLoadState e_cal_get_load_state (ECal *ecal);
+ESource *e_cal_get_source (ECal *ecal);
const char *e_cal_get_uri (ECal *ecal);
gboolean e_cal_is_read_only (ECal *ecal, gboolean *read_only, GError **error);