summaryrefslogtreecommitdiff
path: root/gdata/services/calendar/gdata-calendar-service.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2009-02-24 21:18:40 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2009-02-24 21:18:40 +0000
commit26f35eac2fc9c07f24cb6d29b93281aad3e2169e (patch)
tree0bba6da8b61827f7c708a71172f6eca7ac3de9e9 /gdata/services/calendar/gdata-calendar-service.c
parent1ea0f3cc26f2abf8788166cf0728b764c19dc1f5 (diff)
downloadlibgdata-26f35eac2fc9c07f24cb6d29b93281aad3e2169e.tar.gz
Changed to use g_set_error_literal instead of g_set_error where possible.
Changed "log in" terminology to "authenticate" to be more in-line with the specification.
Diffstat (limited to 'gdata/services/calendar/gdata-calendar-service.c')
-rw-r--r--gdata/services/calendar/gdata-calendar-service.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdata/services/calendar/gdata-calendar-service.c b/gdata/services/calendar/gdata-calendar-service.c
index dbaec53f..3802f5cd 100644
--- a/gdata/services/calendar/gdata-calendar-service.c
+++ b/gdata/services/calendar/gdata-calendar-service.c
@@ -62,6 +62,13 @@ gdata_calendar_service_query_all_calendars (GDataCalendarService *self, gint sta
GDataQuery *query;
GDataFeed *feed;
+ /* Ensure we're authenticated first */
+ if (gdata_service_is_authenticated (GDATA_SERVICE (self)) == FALSE) {
+ g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
+ _("You must be authenticated to query all calendars."));
+ return NULL;
+ }
+
query = gdata_query_new_with_limits (GDATA_SERVICE (self), NULL, start_index, max_results);
feed = gdata_service_query (GDATA_SERVICE (self), "http://www.google.com/calendar/feeds/default/allcalendars/full", query,
(GDataEntryParserFunc) _gdata_calendar_calendar_new_from_xml_node, cancellable, error);
@@ -76,6 +83,14 @@ gdata_calendar_service_query_all_calendars_async (GDataCalendarService *self, gi
{
GDataQuery *query;
+ /* Ensure we're authenticated first */
+ if (gdata_service_is_authenticated (GDATA_SERVICE (self)) == FALSE) {
+ g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data,
+ GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
+ _("You must be authenticated to query all calendars."));
+ return;
+ }
+
query = gdata_query_new_with_limits (GDATA_SERVICE (self), NULL, start_index, max_results);
gdata_service_query_async (GDATA_SERVICE (self), "http://www.google.com/calendar/feeds/default/allcalendars/full", query,
(GDataEntryParserFunc) _gdata_calendar_calendar_new_from_xml_node,